Sahayam

Sahayam - Emergency Relief & Donation Network

A hyper-local, real-time platform connecting those in need with community heroes.

1. Project Overview

Sahayam is a full-stack disaster relief, emergency response, and community donation platform. It solves the critical problem of delayed emergency assistance by instantly connecting people in need—whether for blood donations, food supplies, or emergency rescues—with nearby users willing to help.

Who it is for:


2. Key Features


3. Tech Stack

Frontend

Backend

Deployment Platforms


4. Architecture Overview

Sahayam operates on a decoupled client-server architecture:


5. Setup Instructions (Developer Guide)

Prerequisites

Installation Steps

  1. Clone the repository
    git clone <repository-url>
    cd hope-link
    
  2. Install Backend Dependencies
    cd backend
    npm install
    
  3. Install Frontend Dependencies
    cd ../frontend
    npm install
    

Environment Variables

Backend (backend/.env) Create a .env file in the backend directory:

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_super_secret_jwt_key
FRONTEND_URL=http://localhost:5173
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
GEMINI_API_KEY=your_google_gemini_api_key
# VAPID keys for Web-Push
VAPID_PUBLIC_KEY=your_vapid_public
VAPID_PRIVATE_KEY=your_vapid_private
VAPID_EMAIL=mailto:admin@example.com

Frontend (frontend/.env) Create a .env file in the frontend directory:

VITE_API_URL=http://localhost:5000
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id

Running Locally

Open two terminal windows:

Terminal 1 (Backend):

cd backend
npm run dev

Terminal 2 (Frontend):

cd frontend
npm run dev

The frontend will be available at http://localhost:5173 and the backend API at http://localhost:5000.


6. API Documentation

Authentication (/api/auth)

Donations & Requests (/api/donations)

Real-Time Chat (/api/chat)

Admin (/api/admin)


7. Usage Guide (User Flow)

  1. Sign Up: User registers and selects their primary role (Requester or Donor).
  2. Post a Request / SOS: A user in need drops a pin on the map and submits an SOS (e.g., Blood needed urgently).
  3. Smart Routing: The system calculates the radius and sends push notifications/emails to nearby available donors.
  4. Acceptance: A donor clicks “Accept” on the notification, immediately opening a secure, real-time chat with the requester.
  5. Fulfillment: Once the help is provided, the request is marked as “Fulfilled,” and the donor receives leaderboard points and a generated AI “Hero Story.”

8. Design & UX Principles


9. Security Considerations


10. Limitations (Known Issues)


11. Future Improvements / Roadmap


12. Contribution Guidelines

  1. Fork the repo and clone it locally.
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: Follow standard conventional commits.
  4. Push to the branch: git push origin feature/your-feature-name
  5. Submit a Pull Request: Explain the scope and purpose of your feature.

Please ensure your code passes ESLint rules and follows the existing component structure before submitting a PR.


13. License

This project is licensed under the ISC License.