# adrash2006/weatherintel architecture

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

- Interactive diagram: https://gitdiagram.com/adrash2006/weatherintel
- Repository: https://github.com/adrash2006/weatherintel

## Overview

WeatherIntel turns citizen weather reports and IMD telemetry into clustered, confidence-scored incidents for an operational radar and human review. The primary flow is report intake, multilingual classification, image deduplication, spatial-temporal clustering, station corroboration, and auditable confidence scoring; operators then inspect and verify events. The graph includes documented map, simulation, and persistence capabilities. Source excerpts show the API and component wiring, but not every backend call or frontend request, so those links are omitted where not evidenced.

Main entry points: [`backend/main.py`](https://github.com/adrash2006/weatherintel/blob/master/backend/main.py) (Weather API), [`frontend/src/App.jsx`](https://github.com/adrash2006/weatherintel/blob/master/frontend/src/App.jsx) (Platform shell), [`backend/models/schemas.py`](https://github.com/adrash2006/weatherintel/blob/master/backend/models/schemas.py) (Domain records), [`backend/services/clustering_service.py`](https://github.com/adrash2006/weatherintel/blob/master/backend/services/clustering_service.py) (Event clustering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Report intake"]
  node_report["Citizen reporting"]
end

subgraph group_analysis["Incident analysis"]
  node_classifier["Multilingual classifier<br/>[ai_classifier.py]"]
  node_dedup["Image deduplication"]
  node_clustering["Event clustering"]
  node_imd[("IMD telemetry<br/>[imd_service.py]")]
  node_confidence["Confidence engine"]
end

subgraph group_operations["Operations and data"]
  node_api["Weather API<br/>[main.py]"]
  node_schemas["Domain records<br/>[schemas.py]"]
  node_simulation["Scenario simulation"]
  node_firebase[("Firebase storage")]
end

subgraph group_interface["Radar interface"]
  node_app["Platform shell<br/>[App.jsx]"]
  node_map["Situation radar<br/>[CommandMap.jsx]"]
  node_dossier["Event dossier<br/>[EventDossier.jsx]"]
  node_triage["Admin triage"]
  node_simulation_ui["Simulation bench"]
end

node_citizen(("Citizen"))
node_officer(("Emergency officer"))
node_bhuvan["ISRO Bhuvan WMS"]

node_citizen -->|"submits report"| node_report
node_officer -->|"reviews events"| node_triage
node_app -->|"renders"| node_report
node_app -->|"renders"| node_map
node_app -->|"renders"| node_dossier
node_app -->|"renders"| node_triage
node_app -->|"renders"| node_simulation_ui
node_app -->|"fetches events"| node_api
node_app -->|"fetches stations"| node_api
node_report -.->|"submits report"| node_api
node_triage -.->|"requests verification"| node_api
node_simulation_ui -.->|"runs scenarios"| node_api
node_api -->|"classifies text"| node_classifier
node_api -->|"checks duplicates"| node_dedup
node_api -->|"clusters reports"| node_clustering
node_api -->|"runs scenarios"| node_simulation
node_api -->|"lists stations"| node_imd
node_clustering -->|"gets observations"| node_imd
node_clustering -->|"scores events"| node_confidence
node_classifier -->|"uses event types"| node_schemas
node_clustering -->|"builds events"| node_schemas
node_confidence -->|"uses evidence records"| node_schemas
node_imd -->|"returns observations"| node_schemas
node_api -->|"serves records"| node_schemas
node_map -->|"displays map layers"| node_bhuvan
node_api -.->|"persists data"| node_firebase

click node_app "https://github.com/adrash2006/weatherintel/blob/master/frontend/src/App.jsx"
click node_report "https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/CitizenReportModal.jsx"
click node_map "https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/CommandMap.jsx"
click node_dossier "https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/EventDossier.jsx"
click node_triage "https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/AdminVerificationPanel.jsx"
click node_simulation_ui "https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/AnalyticsSimulation.jsx"
click node_api "https://github.com/adrash2006/weatherintel/blob/master/backend/main.py"
click node_schemas "https://github.com/adrash2006/weatherintel/blob/master/backend/models/schemas.py"
click node_classifier "https://github.com/adrash2006/weatherintel/blob/master/backend/services/ai_classifier.py"
click node_dedup "https://github.com/adrash2006/weatherintel/blob/master/backend/services/deduplication_service.py"
click node_clustering "https://github.com/adrash2006/weatherintel/blob/master/backend/services/clustering_service.py"
click node_imd "https://github.com/adrash2006/weatherintel/blob/master/backend/services/imd_service.py"
click node_confidence "https://github.com/adrash2006/weatherintel/blob/master/backend/services/confidence_engine.py"
click node_simulation "https://github.com/adrash2006/weatherintel/blob/master/backend/services/simulation_service.py"
click node_firebase "https://github.com/adrash2006/weatherintel/blob/master/backend/services/firebase_service.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_report toneBlue
class node_classifier,node_dedup,node_clustering,node_imd,node_confidence toneAmber
class node_api,node_schemas,node_simulation,node_firebase toneMint
class node_app,node_map,node_dossier,node_triage,node_simulation_ui toneRose
class node_citizen,node_officer,node_bhuvan toneIndigo
```

## Components

### Report intake

- [Citizen reporting](https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/CitizenReportModal.jsx): `frontend/src/components/CitizenReportModal.jsx`

### Incident analysis

- [Multilingual classifier](https://github.com/adrash2006/weatherintel/blob/master/backend/services/ai_classifier.py): `backend/services/ai_classifier.py`
- [Image deduplication](https://github.com/adrash2006/weatherintel/blob/master/backend/services/deduplication_service.py): `backend/services/deduplication_service.py`
- [Event clustering](https://github.com/adrash2006/weatherintel/blob/master/backend/services/clustering_service.py): `backend/services/clustering_service.py`
- [IMD telemetry](https://github.com/adrash2006/weatherintel/blob/master/backend/services/imd_service.py): `backend/services/imd_service.py`
- [Confidence engine](https://github.com/adrash2006/weatherintel/blob/master/backend/services/confidence_engine.py): `backend/services/confidence_engine.py`

### Operations and data

- [Weather API](https://github.com/adrash2006/weatherintel/blob/master/backend/main.py): `backend/main.py`
- [Domain records](https://github.com/adrash2006/weatherintel/blob/master/backend/models/schemas.py): `backend/models/schemas.py`
- [Scenario simulation](https://github.com/adrash2006/weatherintel/blob/master/backend/services/simulation_service.py): `backend/services/simulation_service.py`
- [Firebase storage](https://github.com/adrash2006/weatherintel/blob/master/backend/services/firebase_service.py): `backend/services/firebase_service.py`

### Radar interface

- [Platform shell](https://github.com/adrash2006/weatherintel/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Situation radar](https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/CommandMap.jsx): `frontend/src/components/CommandMap.jsx`
- [Event dossier](https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/EventDossier.jsx): `frontend/src/components/EventDossier.jsx`
- [Admin triage](https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/AdminVerificationPanel.jsx): `frontend/src/components/AdminVerificationPanel.jsx`
- [Simulation bench](https://github.com/adrash2006/weatherintel/blob/master/frontend/src/components/AnalyticsSimulation.jsx): `frontend/src/components/AnalyticsSimulation.jsx`

### Other components

- **Citizen**
- **Emergency officer**
- **ISRO Bhuvan WMS**

## Connections

- Citizen → Citizen reporting: submits report (evidence: `README.md`)
- Emergency officer → Admin triage: reviews events (evidence: `README.md`)
- Platform shell → Citizen reporting: renders (evidence: `frontend/src/App.jsx`)
- Platform shell → Situation radar: renders (evidence: `frontend/src/App.jsx`)
- Platform shell → Event dossier: renders (evidence: `frontend/src/App.jsx`)
- Platform shell → Admin triage: renders (evidence: `frontend/src/App.jsx`)
- Platform shell → Simulation bench: renders (evidence: `frontend/src/App.jsx`)
- Platform shell → Weather API: fetches events (evidence: `frontend/src/App.jsx`)
- Platform shell → Weather API: fetches stations (evidence: `frontend/src/App.jsx`)
- Citizen reporting → Weather API: submits report
- Admin triage → Weather API: requests verification
- Simulation bench → Weather API: runs scenarios
- Weather API → Multilingual classifier: classifies text (evidence: `backend/main.py`)
- Weather API → Image deduplication: checks duplicates (evidence: `backend/main.py`)
- Weather API → Event clustering: clusters reports (evidence: `backend/main.py`)
- Weather API → Scenario simulation: runs scenarios (evidence: `backend/main.py`)
- Weather API → IMD telemetry: lists stations (evidence: `backend/main.py`)
- Event clustering → IMD telemetry: gets observations (evidence: `backend/services/clustering_service.py`)
- Event clustering → Confidence engine: scores events (evidence: `backend/services/clustering_service.py`)
- Multilingual classifier → Domain records: uses event types (evidence: `backend/services/ai_classifier.py`)
- Event clustering → Domain records: builds events (evidence: `backend/services/clustering_service.py`)
- Confidence engine → Domain records: uses evidence records (evidence: `backend/services/confidence_engine.py`)
- IMD telemetry → Domain records: returns observations (evidence: `backend/services/imd_service.py`)
- Weather API → Domain records: serves records (evidence: `backend/main.py`)
- Situation radar → ISRO Bhuvan WMS: displays map layers (evidence: `README.md`)
- Weather API → Firebase storage: persists data (evidence: `backend/main.py`)
