# floch-16/cloud-emergency-response-bhopal architecture

> Architecture diagram of the GitHub repository floch-16/cloud-emergency-response-bhopal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/floch-16/cloud-emergency-response-bhopal
- Repository: https://github.com/floch-16/cloud-emergency-response-bhopal

## Overview

PULSE is a municipal emergency CAD console for EMS and Fire dispatch. Operators report or triage an incident, the console classifies severity and selects an available matching unit, then tracks response, hospital assignment for medical calls, and resolution. Its React app coordinates live or offline data, mapping, simulated movement, and traffic-signal preemption. The README documents these capabilities; sampled source confirms key dispatch, routing, map, intake, and persistence behavior, but not every component’s wiring, so uncertain links are omitted.

Main entry points: [`src/App.jsx`](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/App.jsx) (CAD coordinator), [`src/components/IncidentIntakeModal.jsx`](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/IncidentIntakeModal.jsx) (Incident intake), [`src/services/firebase.js`](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/services/firebase.js) (Reactive data service), [`src/logic/dispatchEngine.js`](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/dispatchEngine.js) (Unit dispatch scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Dispatch operations"]
  node_app["CAD coordinator<br/>[App.jsx]"]
end

subgraph group_console["Operator console"]
  node_intake["Incident intake"]
  node_queue["Incident queue<br/>[IncidentQueue.jsx]"]
  node_map["Live map console<br/>[MapConsole.jsx]"]
  node_unitroster["Unit roster<br/>[UnitRoster.jsx]"]
  node_hospitalroster["Hospital roster<br/>[HospitalRoster.jsx]"]
  node_topbar["Operations header<br/>[TopBar.jsx]"]
  node_futurework["Future-work overview"]
end

subgraph group_logic["Dispatch logic"]
  node_severity["Severity triage"]
  node_dispatch["Unit dispatch scoring<br/>[dispatchEngine.js]"]
  node_distance["Distance and ETA<br/>[haversine.js]"]
  node_hospitalmatch["Hospital matching<br/>[hospitalMatcher.js]"]
  node_movement["Movement simulation"]
  node_routing["Road routing<br/>[osrmRouting.js]"]
  node_preemption["Signal preemption"]
end

subgraph group_data["Data and integrations"]
  node_store["Reactive data service<br/>[firebase.js]"]
  node_seed["Seed operational data<br/>[seedData.js]"]
  node_firestore[("Firestore")]
  node_osrm["OSRM routing service"]
end

subgraph group_classification["Photo classification"]
  node_classifierui["Photo identification UI"]
  node_classifierapi["Photo classifier API<br/>[main.py]"]
  node_clip["CLIP model"]
end

node_dispatcher(("Dispatcher"))

node_dispatcher -->|"reports incident"| node_intake
node_dispatcher -->|"reviews queue"| node_queue
node_intake -->|"classifies narrative"| node_severity
node_intake -->|"submits incident"| node_app
node_app -->|"subscribes and writes"| node_store
node_store -->|"reads and writes"| node_firestore
node_store -->|"loads seed data"| node_seed
node_app -->|"selects unit"| node_dispatch
node_dispatch -->|"calculates distance and ETA"| node_distance
node_app -->|"matches medical calls"| node_hospitalmatch
node_app -->|"requests route"| node_routing
node_routing -.->|"fetches road geometry"| node_osrm
node_app -->|"advances units"| node_movement
node_app -->|"evaluates signal override"| node_preemption
node_app -->|"supplies incidents"| node_queue
node_app -->|"supplies map state"| node_map
node_app -->|"supplies units"| node_unitroster
node_app -->|"supplies hospitals"| node_hospitalroster
node_app -->|"supplies operations state"| node_topbar
node_dispatcher -.->|"uploads incident photo"| node_classifierui
node_classifierui -.->|"requests classification"| node_classifierapi
node_classifierapi -->|"runs inference"| node_clip

click node_app "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/App.jsx"
click node_intake "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/IncidentIntakeModal.jsx"
click node_queue "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/IncidentQueue.jsx"
click node_map "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/MapConsole.jsx"
click node_unitroster "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/UnitRoster.jsx"
click node_hospitalroster "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/HospitalRoster.jsx"
click node_topbar "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/TopBar.jsx"
click node_futurework "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/FutureWorkModal.jsx"
click node_severity "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/severityClassifier.js"
click node_dispatch "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/dispatchEngine.js"
click node_distance "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/haversine.js"
click node_hospitalmatch "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/hospitalMatcher.js"
click node_movement "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/movementSimulator.js"
click node_routing "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/osrmRouting.js"
click node_preemption "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/trafficSignalPreemption.js"
click node_store "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/services/firebase.js"
click node_seed "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/services/seedData.js"
click node_classifierui "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/IncidentIntakeModal.jsx"
click node_classifierapi "https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/classifier/main.py"

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 toneBlue
class node_intake,node_queue,node_map,node_unitroster,node_hospitalroster,node_topbar,node_futurework toneAmber
class node_severity,node_dispatch,node_distance,node_hospitalmatch,node_movement,node_routing,node_preemption toneMint
class node_store,node_seed,node_firestore,node_osrm toneRose
class node_classifierui,node_classifierapi,node_clip,node_dispatcher toneIndigo
```

## Components

### Dispatch operations

- [CAD coordinator](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/App.jsx): `src/App.jsx`

### Operator console

- [Incident intake](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/IncidentIntakeModal.jsx): `src/components/IncidentIntakeModal.jsx`
- [Incident queue](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/IncidentQueue.jsx): `src/components/IncidentQueue.jsx`
- [Live map console](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/MapConsole.jsx): `src/components/MapConsole.jsx`
- [Unit roster](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/UnitRoster.jsx): `src/components/UnitRoster.jsx`
- [Hospital roster](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/HospitalRoster.jsx): `src/components/HospitalRoster.jsx`
- [Operations header](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/TopBar.jsx): `src/components/TopBar.jsx`
- [Future-work overview](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/FutureWorkModal.jsx): `src/components/FutureWorkModal.jsx`

### Dispatch logic

- [Severity triage](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/severityClassifier.js): `src/logic/severityClassifier.js`
- [Unit dispatch scoring](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/dispatchEngine.js): `src/logic/dispatchEngine.js`
- [Distance and ETA](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/haversine.js): `src/logic/haversine.js`
- [Hospital matching](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/hospitalMatcher.js): `src/logic/hospitalMatcher.js`
- [Movement simulation](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/movementSimulator.js): `src/logic/movementSimulator.js`
- [Road routing](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/osrmRouting.js): `src/logic/osrmRouting.js`
- [Signal preemption](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/logic/trafficSignalPreemption.js): `src/logic/trafficSignalPreemption.js`

### Data and integrations

- [Reactive data service](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/services/firebase.js): `src/services/firebase.js`
- [Seed operational data](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/services/seedData.js): `src/services/seedData.js`
- **Firestore**
- **OSRM routing service**

### Photo classification

- [Photo identification UI](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/src/components/IncidentIntakeModal.jsx): `src/components/IncidentIntakeModal.jsx`
- [Photo classifier API](https://github.com/floch-16/cloud-emergency-response-bhopal/blob/main/classifier/main.py): `classifier/main.py`
- **CLIP model**

### Other components

- **Dispatcher**

## Connections

- Dispatcher → Incident intake: reports incident
- Dispatcher → Incident queue: reviews queue
- Incident intake → Severity triage: classifies narrative
- Incident intake → CAD coordinator: submits incident
- CAD coordinator → Reactive data service: subscribes and writes
- Reactive data service → Firestore: reads and writes
- Reactive data service → Seed operational data: loads seed data
- CAD coordinator → Unit dispatch scoring: selects unit
- Unit dispatch scoring → Distance and ETA: calculates distance and ETA
- CAD coordinator → Hospital matching: matches medical calls
- CAD coordinator → Road routing: requests route
- Road routing → OSRM routing service: fetches road geometry
- CAD coordinator → Movement simulation: advances units
- CAD coordinator → Signal preemption: evaluates signal override
- CAD coordinator → Incident queue: supplies incidents
- CAD coordinator → Live map console: supplies map state
- CAD coordinator → Unit roster: supplies units
- CAD coordinator → Hospital roster: supplies hospitals
- CAD coordinator → Operations header: supplies operations state
- Dispatcher → Photo identification UI: uploads incident photo
- Photo identification UI → Photo classifier API: requests classification
- Photo classifier API → CLIP model: runs inference
