# omsudhamsh/disaster-grid architecture

> Architecture diagram of the GitHub repository omsudhamsh/disaster-grid, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omsudhamsh/disaster-grid
- Repository: https://github.com/omsudhamsh/disaster-grid

## Overview

Disaster Grid turns responder-facing reports and live crisis signals into a geographically constrained operational picture and response actions. Responders enter through authenticated web pages, inspect incidents, crisis intelligence, sensor risk, imagery analyses, and fused priorities, then coordinate resources or dispatches. Backend routes own requests to domain services; ingestion, analysis, prioritization, and operational coordination are distinct stages. The graph also includes the shared India-boundary logic and the frontend API client. Some feature links rely on README documentation because their page or service implementations were not sampled.

Main entry points: [`frontend/src/App.jsx`](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/App.jsx) (Auth and routes), [`backend/main.py`](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/main.py) (FastAPI app), [`frontend/src/services/api.js`](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/services/api.js) (REST client), [`backend/services/live_incidents.py`](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/live_incidents.py) (Live incidents)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Responder application"]
  node_app["Auth and routes<br/>[App.jsx]"]
  node_dashboard["Command center<br/>[Dashboard.jsx]"]
  node_incidentspage["Incident workspace<br/>[Incidents.jsx]"]
  node_crisispage["Crisis intelligence"]
  node_imagerypage["Imagery analysis<br/>[Imagery.jsx]"]
  node_sensorspage["Sensor network<br/>[Sensors.jsx]"]
  node_fusionpage["Priority grid<br/>[Fusion.jsx]"]
  node_resourcespage["Resource allocation<br/>[Resources.jsx]"]
  node_map["Operational map<br/>[DisasterMap.jsx]"]
  node_api_client["REST client<br/>[api.js]"]
end

subgraph group_api["API request layer"]
  node_backend["FastAPI app<br/>[main.py]"]
  node_incident_route["Incident routes<br/>[incidents.py]"]
  node_crisis_route["Crisis routes<br/>[crisis.py]"]
  node_fusion_route["Fusion routes<br/>[fusion.py]"]
  node_imagery_route["Imagery routes<br/>[imagery.py]"]
  node_sensor_route["Sensor routes<br/>[sensors.py]"]
  node_resources_route["Resource routes<br/>[resources.py]"]
  node_dispatch_route["Dispatch routes<br/>[dispatch.py]"]
end

subgraph group_signals["Signal intelligence"]
  node_nlp["Report NLP<br/>[nlp.py]"]
  node_social["Social feed<br/>[social.py]"]
  node_live_incidents["Live incidents<br/>[live_incidents.py]"]
  node_sensors["Live sensor feeds<br/>[sensors.py]"]
  node_vision["Image vision<br/>[vision.py]"]
  node_nasa["NASA imagery<br/>[nasa.py]"]
  node_fusion["Priority fusion<br/>[fusion.py]"]
  node_explanation["Priority explanations<br/>[explanation.py]"]
end

subgraph group_operations["Response operations"]
  node_dispatch["Dispatch coordination<br/>[dispatch.py]"]
  node_safety["Location safety<br/>[safety.py]"]
end

subgraph group_shared["Geospatial foundation"]
  node_geo_service["India geospatial checks<br/>[geo.py]"]
  node_geo_frontend["Map boundaries<br/>[geo.js]"]
  node_hexbin["Hexbin geometry<br/>[hexbin.js]"]
end

node_responder(("Responder"))
node_external_feeds["External crisis feeds"]
node_gemini["Gemini Vision"]

node_responder -->|"opens"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_incidentspage
node_app -->|"routes to"| node_crisispage
node_app -->|"routes to"| node_imagerypage
node_app -->|"routes to"| node_sensorspage
node_app -->|"routes to"| node_fusionpage
node_app -->|"routes to"| node_resourcespage
node_incidentspage -->|"uses"| node_api_client
node_incidentspage -->|"uses"| node_api_client
node_imagerypage -->|"uses"| node_api_client
node_fusionpage -->|"uses"| node_api_client
node_api_client -->|"REST requests"| node_backend
node_backend -->|"registers"| node_incident_route
node_backend -->|"registers"| node_crisis_route
node_backend -->|"registers"| node_fusion_route
node_backend -->|"registers"| node_imagery_route
node_backend -->|"registers"| node_sensor_route
node_backend -->|"registers"| node_resources_route
node_backend -->|"registers"| node_dispatch_route
node_crisis_route -->|"analyzes reports"| node_nlp
node_crisis_route -->|"loads feed"| node_social
node_social -->|"checks locations"| node_nlp
node_fusion_route -->|"uses analysis"| node_nlp
node_fusion_route -->|"loads incidents"| node_live_incidents
node_fusion_route -->|"scores signals"| node_fusion
node_fusion -.->|"generates explanations"| node_explanation
node_incident_route -->|"analyzes reports"| node_nlp
node_incident_route -->|"reads and reports"| node_live_incidents
node_sensor_route -->|"loads feeds"| node_sensors
node_resources_route -->|"reads incidents"| node_live_incidents
node_dispatch_route -->|"delegates"| node_dispatch
node_imagery_route -->|"fetches imagery"| node_nasa
node_imagery_route -.->|"analyzes images"| node_vision
node_imagerypage -.->|"analysis capability"| node_gemini
node_external_feeds -.->|"supplies posts"| node_social
node_external_feeds -.->|"supplies events"| node_live_incidents
node_external_feeds -.->|"supplies telemetry"| node_sensors
node_live_incidents -.->|"filters locations"| node_geo_service
node_nasa -->|"checks locations"| node_geo_service
node_geo_frontend -->|"constrains map"| node_map
node_hexbin -->|"bins hotspots"| node_map
node_geo_service -.->|"supports checks"| node_safety
node_map -.->|"shows operational picture"| node_dashboard
node_resourcespage -.->|"coordinates deployments"| node_dispatch_route

click node_app "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Dashboard.jsx"
click node_incidentspage "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Incidents.jsx"
click node_crisispage "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/CrisisIntelligence.jsx"
click node_imagerypage "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Imagery.jsx"
click node_sensorspage "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Sensors.jsx"
click node_fusionpage "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Fusion.jsx"
click node_resourcespage "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Resources.jsx"
click node_map "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/components/DisasterMap.jsx"
click node_api_client "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/services/api.js"
click node_backend "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/main.py"
click node_incident_route "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/incidents.py"
click node_crisis_route "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/crisis.py"
click node_fusion_route "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/fusion.py"
click node_imagery_route "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/imagery.py"
click node_sensor_route "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/sensors.py"
click node_resources_route "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/resources.py"
click node_dispatch_route "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/dispatch.py"
click node_nlp "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/nlp.py"
click node_social "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/social.py"
click node_live_incidents "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/live_incidents.py"
click node_sensors "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/sensors.py"
click node_vision "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/vision.py"
click node_nasa "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/nasa.py"
click node_fusion "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/fusion.py"
click node_explanation "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/explanation.py"
click node_dispatch "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/dispatch.py"
click node_safety "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/safety.py"
click node_geo_service "https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/geo.py"
click node_geo_frontend "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/utils/geo.js"
click node_hexbin "https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/utils/hexbin.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_dashboard,node_incidentspage,node_crisispage,node_imagerypage,node_sensorspage,node_fusionpage,node_resourcespage,node_map,node_api_client toneBlue
class node_backend,node_incident_route,node_crisis_route,node_fusion_route,node_imagery_route,node_sensor_route,node_resources_route,node_dispatch_route toneAmber
class node_nlp,node_social,node_live_incidents,node_sensors,node_vision,node_nasa,node_fusion,node_explanation toneMint
class node_dispatch,node_safety toneRose
class node_geo_service,node_geo_frontend,node_hexbin,node_responder,node_external_feeds,node_gemini toneIndigo
```

## Components

### Responder application

- [Auth and routes](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Command center](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Incident workspace](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Incidents.jsx): `frontend/src/pages/Incidents.jsx`
- [Crisis intelligence](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/CrisisIntelligence.jsx): `frontend/src/pages/CrisisIntelligence.jsx`
- [Imagery analysis](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Imagery.jsx): `frontend/src/pages/Imagery.jsx`
- [Sensor network](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Sensors.jsx): `frontend/src/pages/Sensors.jsx`
- [Priority grid](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Fusion.jsx): `frontend/src/pages/Fusion.jsx`
- [Resource allocation](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/pages/Resources.jsx): `frontend/src/pages/Resources.jsx`
- [Operational map](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/components/DisasterMap.jsx): `frontend/src/components/DisasterMap.jsx`
- [REST client](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API request layer

- [FastAPI app](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/main.py): `backend/main.py`
- [Incident routes](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/incidents.py): `backend/routes/incidents.py`
- [Crisis routes](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/crisis.py): `backend/routes/crisis.py`
- [Fusion routes](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/fusion.py): `backend/routes/fusion.py`
- [Imagery routes](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/imagery.py): `backend/routes/imagery.py`
- [Sensor routes](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/sensors.py): `backend/routes/sensors.py`
- [Resource routes](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/resources.py): `backend/routes/resources.py`
- [Dispatch routes](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/routes/dispatch.py): `backend/routes/dispatch.py`

### Signal intelligence

- [Report NLP](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/nlp.py): `backend/services/nlp.py`
- [Social feed](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/social.py): `backend/services/social.py`
- [Live incidents](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/live_incidents.py): `backend/services/live_incidents.py`
- [Live sensor feeds](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/sensors.py): `backend/services/sensors.py`
- [Image vision](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/vision.py): `backend/services/vision.py`
- [NASA imagery](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/nasa.py): `backend/services/nasa.py`
- [Priority fusion](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/fusion.py): `backend/services/fusion.py`
- [Priority explanations](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/explanation.py): `backend/services/explanation.py`

### Response operations

- [Dispatch coordination](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/dispatch.py): `backend/services/dispatch.py`
- [Location safety](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/safety.py): `backend/services/safety.py`

### Geospatial foundation

- [India geospatial checks](https://github.com/omsudhamsh/disaster-grid/blob/main/backend/services/geo.py): `backend/services/geo.py`
- [Map boundaries](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/utils/geo.js): `frontend/src/utils/geo.js`
- [Hexbin geometry](https://github.com/omsudhamsh/disaster-grid/blob/main/frontend/src/utils/hexbin.js): `frontend/src/utils/hexbin.js`

### Other components

- **Responder**
- **External crisis feeds**
- **Gemini Vision**

## Connections

- Responder → Auth and routes: opens
- Auth and routes → Command center: routes to (evidence: `frontend/src/App.jsx`)
- Auth and routes → Incident workspace: routes to (evidence: `frontend/src/App.jsx`)
- Auth and routes → Crisis intelligence: routes to (evidence: `frontend/src/App.jsx`)
- Auth and routes → Imagery analysis: routes to (evidence: `frontend/src/App.jsx`)
- Auth and routes → Sensor network: routes to (evidence: `frontend/src/App.jsx`)
- Auth and routes → Priority grid: routes to (evidence: `frontend/src/App.jsx`)
- Auth and routes → Resource allocation: routes to (evidence: `frontend/src/App.jsx`)
- Incident workspace → REST client: uses (evidence: `frontend/src/pages/Incidents.jsx`)
- Incident workspace → REST client: uses (evidence: `frontend/src/pages/Incidents.jsx`)
- Imagery analysis → REST client: uses (evidence: `frontend/src/pages/Imagery.jsx`)
- Priority grid → REST client: uses (evidence: `frontend/src/pages/Fusion.jsx`)
- REST client → FastAPI app: REST requests
- FastAPI app → Incident routes: registers (evidence: `backend/main.py`)
- FastAPI app → Crisis routes: registers (evidence: `backend/main.py`)
- FastAPI app → Fusion routes: registers (evidence: `backend/main.py`)
- FastAPI app → Imagery routes: registers (evidence: `backend/main.py`)
- FastAPI app → Sensor routes: registers (evidence: `backend/main.py`)
- FastAPI app → Resource routes: registers (evidence: `backend/main.py`)
- FastAPI app → Dispatch routes: registers (evidence: `backend/main.py`)
- Crisis routes → Report NLP: analyzes reports (evidence: `backend/routes/crisis.py`)
- Crisis routes → Social feed: loads feed (evidence: `backend/routes/crisis.py`)
- Social feed → Report NLP: checks locations (evidence: `backend/services/social.py`)
- Fusion routes → Report NLP: uses analysis (evidence: `backend/routes/fusion.py`)
- Fusion routes → Live incidents: loads incidents (evidence: `backend/routes/fusion.py`)
- Fusion routes → Priority fusion: scores signals (evidence: `backend/routes/fusion.py`)
- Priority fusion → Priority explanations: generates explanations
- Incident routes → Report NLP: analyzes reports (evidence: `backend/routes/incidents.py`)
- Incident routes → Live incidents: reads and reports (evidence: `backend/routes/incidents.py`)
- Sensor routes → Live sensor feeds: loads feeds (evidence: `backend/routes/sensors.py`)
- Resource routes → Live incidents: reads incidents (evidence: `backend/routes/resources.py`)
- Dispatch routes → Dispatch coordination: delegates (evidence: `backend/routes/dispatch.py`)
- Imagery routes → NASA imagery: fetches imagery (evidence: `backend/routes/imagery.py`)
- Imagery routes → Image vision: analyzes images (evidence: `backend/routes/imagery.py`)
- Imagery analysis → Gemini Vision: analysis capability
- External crisis feeds → Social feed: supplies posts
- External crisis feeds → Live incidents: supplies events
- External crisis feeds → Live sensor feeds: supplies telemetry
- Live incidents → India geospatial checks: filters locations (evidence: `backend/services/live_incidents.py`)
- NASA imagery → India geospatial checks: checks locations (evidence: `backend/services/nasa.py`)
- Map boundaries → Operational map: constrains map (evidence: `frontend/src/components/DisasterMap.jsx`)
- Hexbin geometry → Operational map: bins hotspots (evidence: `frontend/src/components/DisasterMap.jsx`)
- India geospatial checks → Location safety: supports checks
- Operational map → Command center: shows operational picture
- Resource allocation → Dispatch routes: coordinates deployments
