"Command, Clarity, Coordination."
A real-time disaster response coordination platform connecting agencies, volunteers, and civilians during emergencies.
- Tech Stack
- Project Structure
- Database Setup
- Backend API
- Frontend Features
- Deployment Guide
- Environment Variables
- Running Locally
| Technology | Purpose |
|---|---|
| React 18 | UI Framework |
| Vite | Build tool & dev server |
| Tailwind CSS | Styling (with dark mode) |
| React Router | Navigation |
| React-Leaflet | Interactive maps |
| Recharts | Analytics charts |
| Lucide React | Icons |
| Framer Motion | Animations |
| Technology | Purpose |
|---|---|
| Node.js | Runtime |
| Express.js | API Framework |
| PostgreSQL | Database |
| pg | PostgreSQL client |
| Twilio | SMS/WhatsApp notifications |
| dotenv | Environment config |
| Service | Purpose |
|---|---|
| Vercel | Frontend hosting |
| Render | Backend API hosting |
| Neon | PostgreSQL database |
ResQLink/
├── src/ # Frontend source
│ ├── components/
│ │ ├── layout/
│ │ │ ├── Header.jsx # Top navigation bar with stats & theme toggle
│ │ │ ├── Sidebar.jsx # Left navigation menu
│ │ │ └── Layout.jsx # Main layout wrapper
│ │ ├── chatbot/
│ │ │ └── ChatBot.jsx # Emergency assistance chatbot
│ │ ├── dashboard/
│ │ │ └── MapWidget.jsx # Leaflet map component
│ │ ├── LanguageSwitcher.jsx # Multi-language selector
│ │ └── ...
│ ├── pages/
│ │ ├── auth/
│ │ │ ├── LoginSelection.jsx # Role selection screen
│ │ │ ├── LoginAgency.jsx # Agency login
│ │ │ ├── LoginVolunteer.jsx # Volunteer login
│ │ │ └── LoginCivilian.jsx # Civilian login
│ │ ├── DashboardHome.jsx # Main dashboard
│ │ ├── CrisisMap.jsx # Tactical map view
│ │ ├── SubmitReport.jsx # Incident reporting form
│ │ ├── Resources.jsx # Resource management
│ │ ├── Analytics.jsx # Data analytics
│ │ ├── AdminPanel.jsx # Admin controls
│ │ └── CrisisMap.jsx # Full-screen map
│ ├── context/
│ │ ├── AppStateContext.jsx # Global state (incidents, users, resources)
│ │ └── LanguageContext.jsx # i18n language state
│ ├── data/
│ │ └── mockData.js # Static data definitions
│ ├── locales/ # Translation files
│ │ ├── en.json # English
│ │ ├── hi.json # Hindi
│ │ ├── gu.json # Gujarati
│ │ └── mr.json # Marathi
│ ├── lib/
│ │ ├── utils.js # Utility functions
│ │ └── i18n.js # i18n configuration
│ ├── App.jsx # Main app component
│ ├── main.jsx # Entry point
│ └── index.css # Global styles
│
├── server/ # Backend API
│ ├── server.js # Express server with all endpoints
│ ├── package.json # Backend dependencies
│ └── .env.example # Example environment config
│
├── public/ # Static assets
├── tailwind.config.js # Tailwind configuration
├── vite.config.js # Vite configuration
├── package.json # Frontend dependencies
└── README.md # This file
We use Neon - a serverless PostgreSQL platform with free tier.
postgresql://username:password@host.neon.tech/dbname?sslmode=require
-- Users table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
phone VARCHAR(20) UNIQUE NOT NULL,
name VARCHAR(100),
role VARCHAR(20) DEFAULT 'CIVILIAN',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Incidents table
CREATE TABLE incidents (
id SERIAL PRIMARY KEY,
external_id VARCHAR(50) UNIQUE,
type VARCHAR(50) NOT NULL,
severity VARCHAR(20) NOT NULL,
status VARCHAR(20) DEFAULT 'REPORTED',
description TEXT,
lat FLOAT,
lng FLOAT,
location_name VARCHAR(255),
reporter_phone VARCHAR(20),
reporter_id VARCHAR(50),
verified BOOLEAN DEFAULT FALSE,
votes INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Resources table
CREATE TABLE resources (
id SERIAL PRIMARY KEY,
type VARCHAR(100) NOT NULL,
quantity INTEGER,
unit VARCHAR(20),
lat FLOAT,
lng FLOAT,
status VARCHAR(20) DEFAULT 'AVAILABLE',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Volunteers table
CREATE TABLE volunteers (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
status VARCHAR(20) DEFAULT 'AVAILABLE',
lat FLOAT,
lng FLOAT,
current_task_id VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Notifications table
CREATE TABLE notifications (
id SERIAL PRIMARY KEY,
incident_id INTEGER,
phone VARCHAR(20),
channel VARCHAR(20),
status VARCHAR(20) DEFAULT 'SENT',
twilio_sid VARCHAR(100),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);https://resqlink-backend.onrender.com/api
| Method | Endpoint | Description |
|---|---|---|
| GET | /incidents |
Get all incidents |
| POST | /incidents |
Create new incident |
| GET | /incidents/:id |
Get single incident |
| PATCH | /incidents/:id |
Update incident status |
| GET | /resources |
Get all resources |
| GET | /volunteers |
Get all volunteers |
| GET | /stats |
Get dashboard statistics |
| POST | /users |
Create/update user |
| POST | /auth/send-otp |
Send OTP for login |
| POST | /auth/verify-otp |
Verify OTP and login |
// In src/context/AppStateContext.jsx
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001/api';
// Example API call
const response = await fetch(`${API_URL}/incidents`);
const data = await response.json();- Agency - Command center, analytics, admin controls
- Volunteer - Resources, map, response tasks
- Civilian - Report incidents, view status
- Toggle in header (sun/moon icon)
- Persisted in localStorage
- Full dark mode support across all pages
- English, Hindi, Gujarati, Marathi
- Language switcher in header
- All UI text translated
- Leaflet-based tactical map
- Incident markers with severity colors
- Resource & volunteer locations
- Active incident counts
- Critical event alerts
- Live operations feed
- 24/7 emergency assistance
- Quick access to helplines
- Navigate to specific pages
- Push code to GitHub
- Go to vercel.com
- Import your repository
- Add environment variables:
VITE_API_URL= your Render backend URL (e.g.,https://resqlink-backend.onrender.com/api)
- Deploy!
- Go to render.com
- Create new "Web Service"
- Connect your GitHub repo (select the
serverfolder) - Configure:
- Build Command:
npm install - Start Command:
npm start
- Build Command:
- Add environment variables:
DATABASE_URL= Neon connection stringTWILIO_ACCOUNT_SID= Your Twilio SIDTWILIO_AUTH_TOKEN= Your Twilio tokenTWILIO_PHONE_NUMBER= Your Twilio phoneADMIN_PHONE= Admin notification number
- Deploy!
- Go to neon.tech
- Create free project
- Copy connection string
- Use in both Vercel and Render
VITE_API_URL=https://your-render-url.onrender.com/api# Database (PostgreSQL on Neon)
DATABASE_URL=postgresql://user:pass@host.neon.tech/dbname?sslmode=require
# Twilio (SMS/WhatsApp)
TWILIO_ACCOUNT_SID=your_sid
TWILIO_AUTH_TOKEN=your_token
TWILIO_PHONE_NUMBER=+1234567890
# Admin notifications
ADMIN_PHONE=+919999999999
ADMIN_WHATSAPP=whatsapp:+919999999999
# Server port
PORT=3001npm install
npm run devcd server
npm install
npm run devServer runs on http://localhost:3001
- Create Neon database
- Add DATABASE_URL to server/.env
- Run both frontend and backend
- ✅ Real-time incident reporting
- ✅ Interactive crisis map
- ✅ Resource & volunteer tracking
- ✅ Role-based dashboards
- ✅ Analytics & insights
- ✅ Dark/Light theme
- ✅ Multi-language (EN, HI, GU, MR)
- ✅ Emergency chatbot
- ✅ SMS/WhatsApp notifications
- ✅ OTP-based authentication
MIT License - Feel free to use and modify!
ResQLink: Engineering order out of chaos.