An end-to-end disaster-response decision-support platform designed for Rourkela, Odisha, India. The platform converts unstructured citizen incident reports into structured AI intelligence, computes a transparent 0β100 priority score, evaluates Haversine distance matrix, executes SciPy Hungarian bipartite resource matching, streams real-time updates via WebSockets, and provides interactive GIS command dashboards.
| Resource | Live Link | Security & Details |
|---|---|---|
| π Official HTTPS Web App | https://disasterresponse.click | π’ SECURE (100% Trusted Let's Encrypt SSL Padlock) |
| π WWW Subdomain (HTTPS) | https://www.disasterresponse.click | π’ SECURE (Trusted TLS 1.3 Encryption) |
| π Interactive Swagger API Docs | https://disasterresponse.click/docs | π’ Live OpenAPI REST API Explorer |
| π Cloudflare Edge Mirror | https://therefore-pointing-downtown-save.trycloudflare.com | π’ SECURE (Cloudflare CDN Edge) |
| π Direct Cloud IP | http://13.204.160.135 | π’ Amazon EC2 (Mumbai ap-south-1) |
flowchart TD
subgraph Clients["User Interfaces"]
CitizenUI["Citizen React Frontend<br/>(Neo-Brutalist DRISHTi UI)"]
DashboardUI["Authority Command Dashboard<br/>(Tactical Map & Queue)"]
end
subgraph Nginx["Nginx Reverse Proxy (Port 80 / 443)"]
Proxy["SSL Termination (Let's Encrypt)<br/>& WebSocket Upgrades"]
end
subgraph Backend["FastAPI Backend Engine (Port 8000)"]
API["FastAPI REST & WebSocket Controllers<br/>(/api/v1)"]
GeminiService["Gemini AI & Fallback NLP Extractor"]
ScoringEngine["Transparent Priority Engine (0-100)"]
SciPyOptimizer["SciPy Allocation Engine<br/>(linear_sum_assignment)"]
HaversineMath["Haversine Distance Calculator"]
WSManager["WebSocket Event Broadcaster"]
end
subgraph Database["Relational Store (Port 5432)"]
DB[(PostgreSQL 15 / Persistent Volume)]
end
CitizenUI -->|HTTPS / WSS| Proxy
DashboardUI -->|HTTPS / WSS| Proxy
Proxy --> API
API --> GeminiService
API --> ScoringEngine
API --> SciPyOptimizer
SciPyOptimizer --> HaversineMath
ScoringEngine --> HaversineMath
API --> DB
API --> WSManager
WSManager -.->|Real-time WS Events| Proxy
To start all services locally with Docker Compose:
docker compose up --build- Citizen React Portal:
http://localhost:5173 - FastAPI Backend & Interactive Swagger Docs:
http://localhost:8000/docs - Streamlit Authority Command Dashboard:
http://localhost:8501
The platform is deployed on AWS EC2 (Mumbai ap-south-1) with persistent PostgreSQL 15, FastAPI, React 18, and Nginx.
# Provision Infrastructure
cd terraform
terraform init
terraform apply -auto-approve| Variable | Default Value | Description |
|---|---|---|
GEMINI_API_KEY |
(Optional) | Google Gemini API key. If omitted or API fails, heuristic fallback parser is active. |
GEMINI_MODEL |
gemini-2.5-flash |
Gemini model version for structured JSON extraction. |
DATABASE_URL |
postgresql://... |
Database connection URI (PostgreSQL 15 in production, SQLite in dev). |
API_BASE_URL |
http://localhost:8000/api/v1 |
Backend API URL for dashboard & frontend communication. |
VITE_API_BASE_URL |
/api/v1 |
React frontend Vite backend endpoint. |
The priority score
-
Severity (
$C_{\text{severity}}$ ): LOW = 25, MEDIUM = 50, HIGH = 80, CRITICAL = 100.- Vulnerability Promotion Rule: If vulnerable individuals (children/elderly/disabled) are present and severity < HIGH, severity is promoted by one enum step.
-
People Affected (
$C_{\text{people}}$ ): 0$\rightarrow$ 0; 1$\rightarrow$ 20; 2β5$\rightarrow$ 40; 6β10$\rightarrow$ 65; 11β25$\rightarrow$ 85; 26+$\rightarrow$ 100 (+10 pts if vulnerable people present, capped at 100). -
Facility Proximity (
$C_{\text{facility}}$ ):$\max(0, 100 - (\text{dist}_{\text{km}} / 20) \times 100)$ to nearest active critical facility. -
Resource Availability (
$C_{\text{resource}}$ ): 100 (<2 km), 85 (<5 km), 65 (<10 km), 40 (<20 km), 20 (>20 km), 0 (none compatible). -
Time Elapsed (
$C_{\text{time}}$ ):$\min(100, (\text{elapsed_minutes} / 180) \times 100)$ .
- 70β100: HIGH PRIORITY (Red)
- 40β69: MEDIUM PRIORITY (Yellow/Amber)
- 0β39: LOW PRIORITY (Green)
Global multi-incident resource allocation uses scipy.optimize.linear_sum_assignment over an incident-by-resource cost matrix:
-
Capability Penalty: 0 for exact match, 35 for valid fallback,
1_000_000for infeasible pairs. -
Scarcity Behavior: High-priority incidents (
$P_i \ge 70$ ) are strongly favored for nearby resources over slightly closer low-priority incidents. -
Transactional Confirmation: Optimization produces previews; dispatching calls
/api/v1/assignments/confirmto update resource statusAVAILABLE$\rightarrow$ BUSYand incident statusREPORTED$\rightarrow$ ASSIGNED.
- Trigger Alert: Click β‘ TRIGGER SYNTHETIC ALERT for Flood in Rourkela.
- Verify Alert: Observe live alert ticker in Citizen Portal.
- Submit Citizen Report: Click sample chip: "Water has entered several houses and 8 people are trapped. Two of them are elderly."
-
Inspect AI & Score: Observe structured extraction (8 people, vulnerable true, High severity) and HIGH priority classification score (
$\ge 70$ ). - Inspect 3D Map: View incident column on tactical map.
- Run SciPy Optimizer: Click βοΈ RUN SCIPY OPTIMIZE ALGORITHM, inspect match recommendations, distance, ETA, and cost.
-
Confirm Dispatch: Click CONFIRM DISPATCH. Observe resource change
AVAILABLE$\rightarrow$ BUSYand incident change toASSIGNED. -
Complete Lifecycle: Advance assignment to
COMPLETED. Verify resource returns toAVAILABLEand incident becomesRESOLVED.
Run backend unit & integration tests:
cd backend
PYTHONPATH=. pytest app/tests/ -vRun frontend build check:
cd frontend
npm run build