# codebyshubhamm/thermos-live2 architecture

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

- Interactive diagram: https://gitdiagram.com/codebyshubhamm/thermos-live2
- Repository: https://github.com/codebyshubhamm/thermos-live2

## Overview

THERMOS is a satellite thermal-anomaly intelligence and emergency-triage platform. Its main workflow ingests NASA FIRMS observations, enriches and classifies events, assigns risk, persists incidents, and presents them for mapping, prioritization, analysis, and investigation. The React dashboard hydrates through a shared store and API client; the FastAPI backend exposes event and operational services. README capabilities such as GIS layers, analytics, and AI investigation are represented where the tree supports them. Some backend service wiring is documented but not shown in sampled source, so uncertain calls are omitted.

Main entry points: [`backend-ml/Backend/app/services/event_service.py`](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/event_service.py) (Event processing), [`backend-ml/Backend/app/workers/firms_ingestion.py`](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/workers/firms_ingestion.py) (FIRMS ingestion), [`src/App.jsx`](https://github.com/codebyshubhamm/thermos-live2/blob/main/src/App.jsx) (Dashboard routes), [`src/pages`](https://github.com/codebyshubhamm/thermos-live2/tree/main/src/pages) (Operations pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Operator dashboard"]
  node_app["Dashboard routes<br/>[App.jsx]"]
  node_pages["Operations pages"]
  node_map["GIS and globe"]
  node_investigation_ui["Incident investigator<br/>[Investigator.jsx]"]
  node_store["Event state<br/>[useStore.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_ingest["Observation pipeline"]
  node_ingest_worker["FIRMS ingestion<br/>[firms_ingestion.py]"]
  node_firms_service["FIRMS retrieval<br/>[firms_service.py]"]
  node_event_service["Event processing<br/>[event_service.py]"]
end

subgraph group_intelligence["Event intelligence"]
  node_enrichment["Context enrichment"]
  node_geo["Geospatial context<br/>[geo_service.py]"]
  node_temporal["Temporal history"]
  node_predictor["ML classification<br/>[predictor.py]"]
  node_risk["Risk scoring<br/>[risk_service.py]"]
  node_ai["AI reasoning"]
end

subgraph group_operations["API and operations"]
  node_api["FastAPI application<br/>[main.py]"]
  node_routes["Product API routes"]
  node_db_models["Event data models<br/>[models.py]"]
  node_database[("PostGIS database<br/>[database.py]")]
  node_analytics["Analytics service"]
  node_investigator["Investigation service"]
end

node_operator(("Operator"))
node_firms["NASA FIRMS"]

node_operator -->|"uses"| node_app
node_app -->|"routes to"| node_pages
node_app -->|"hydrates"| node_store
node_pages -->|"renders"| node_map
node_pages -->|"opens"| node_investigation_ui
node_store -->|"requests events"| node_api_client
node_api_client -->|"calls"| node_api
node_api -->|"dispatches"| node_routes
node_api -->|"initializes"| node_database
node_firms -->|"provides observations"| node_firms_service
node_ingest_worker -->|"fetches via"| node_firms_service
node_ingest_worker -->|"checks duplicates"| node_database
node_ingest_worker -->|"processes observations"| node_event_service
node_event_service -->|"enriches"| node_enrichment
node_event_service -->|"classifies"| node_predictor
node_event_service -->|"scores risk"| node_risk
node_enrichment -->|"uses context"| node_geo
node_enrichment -->|"uses history"| node_temporal
node_event_service -->|"creates event records"| node_db_models
node_db_models -->|"persisted in"| node_database
node_routes -->|"serves analytics"| node_analytics
node_routes -->|"serves investigations"| node_investigator
node_investigation_ui -->|"requests intelligence"| node_api_client
node_investigator -.->|"uses reasoning"| node_ai

click node_app "https://github.com/codebyshubhamm/thermos-live2/blob/main/src/App.jsx"
click node_pages "https://github.com/codebyshubhamm/thermos-live2/tree/main/src/pages"
click node_map "https://github.com/codebyshubhamm/thermos-live2/tree/main/src/components/map"
click node_investigation_ui "https://github.com/codebyshubhamm/thermos-live2/blob/main/src/pages/Investigator.jsx"
click node_store "https://github.com/codebyshubhamm/thermos-live2/blob/main/src/store/useStore.js"
click node_api_client "https://github.com/codebyshubhamm/thermos-live2/blob/main/src/services/api.js"
click node_ingest_worker "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/workers/firms_ingestion.py"
click node_firms_service "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/firms_service.py"
click node_event_service "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/event_service.py"
click node_enrichment "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/enrichment_service.py"
click node_geo "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/geo_service.py"
click node_temporal "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/temporal_service.py"
click node_predictor "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/ml/predictor.py"
click node_risk "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/risk_service.py"
click node_ai "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/ai_reasoning_service.py"
click node_api "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/main.py"
click node_routes "https://github.com/codebyshubhamm/thermos-live2/tree/main/backend-ml/Backend/app/api/routes"
click node_db_models "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/db/models.py"
click node_database "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/db/database.py"
click node_analytics "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/analytics_service.py"
click node_investigator "https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/investigator_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_app,node_pages,node_map,node_investigation_ui,node_store,node_api_client toneBlue
class node_ingest_worker,node_firms_service,node_event_service toneAmber
class node_enrichment,node_geo,node_temporal,node_predictor,node_risk,node_ai toneMint
class node_api,node_routes,node_db_models,node_database,node_analytics,node_investigator toneRose
class node_operator,node_firms toneIndigo
```

## Components

### Operator dashboard

- [Dashboard routes](https://github.com/codebyshubhamm/thermos-live2/blob/main/src/App.jsx): `src/App.jsx`
- [Operations pages](https://github.com/codebyshubhamm/thermos-live2/tree/main/src/pages): `src/pages`
- [GIS and globe](https://github.com/codebyshubhamm/thermos-live2/tree/main/src/components/map): `src/components/map`
- [Incident investigator](https://github.com/codebyshubhamm/thermos-live2/blob/main/src/pages/Investigator.jsx): `src/pages/Investigator.jsx`
- [Event state](https://github.com/codebyshubhamm/thermos-live2/blob/main/src/store/useStore.js): `src/store/useStore.js`
- [API client](https://github.com/codebyshubhamm/thermos-live2/blob/main/src/services/api.js): `src/services/api.js`

### Observation pipeline

- [FIRMS ingestion](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/workers/firms_ingestion.py): `backend-ml/Backend/app/workers/firms_ingestion.py`
- [FIRMS retrieval](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/firms_service.py): `backend-ml/Backend/app/services/firms_service.py`
- [Event processing](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/event_service.py): `backend-ml/Backend/app/services/event_service.py`

### Event intelligence

- [Context enrichment](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/enrichment_service.py): `backend-ml/Backend/app/services/enrichment_service.py`
- [Geospatial context](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/geo_service.py): `backend-ml/Backend/app/services/geo_service.py`
- [Temporal history](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/temporal_service.py): `backend-ml/Backend/app/services/temporal_service.py`
- [ML classification](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/ml/predictor.py): `backend-ml/Backend/app/ml/predictor.py`
- [Risk scoring](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/risk_service.py): `backend-ml/Backend/app/services/risk_service.py`
- [AI reasoning](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/ai_reasoning_service.py): `backend-ml/Backend/app/services/ai_reasoning_service.py`

### API and operations

- [FastAPI application](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/main.py): `backend-ml/Backend/app/main.py`
- [Product API routes](https://github.com/codebyshubhamm/thermos-live2/tree/main/backend-ml/Backend/app/api/routes): `backend-ml/Backend/app/api/routes`
- [Event data models](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/db/models.py): `backend-ml/Backend/app/db/models.py`
- [PostGIS database](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/db/database.py): `backend-ml/Backend/app/db/database.py`
- [Analytics service](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/analytics_service.py): `backend-ml/Backend/app/services/analytics_service.py`
- [Investigation service](https://github.com/codebyshubhamm/thermos-live2/blob/main/backend-ml/Backend/app/services/investigator_service.py): `backend-ml/Backend/app/services/investigator_service.py`

### Other components

- **Operator**
- **NASA FIRMS**

## Connections

- Operator → Dashboard routes: uses
- Dashboard routes → Operations pages: routes to
- Dashboard routes → Event state: hydrates
- Operations pages → GIS and globe: renders
- Operations pages → Incident investigator: opens
- Event state → API client: requests events
- API client → FastAPI application: calls
- FastAPI application → Product API routes: dispatches
- FastAPI application → PostGIS database: initializes
- NASA FIRMS → FIRMS retrieval: provides observations
- FIRMS ingestion → FIRMS retrieval: fetches via
- FIRMS ingestion → PostGIS database: checks duplicates
- FIRMS ingestion → Event processing: processes observations
- Event processing → Context enrichment: enriches
- Event processing → ML classification: classifies
- Event processing → Risk scoring: scores risk
- Context enrichment → Geospatial context: uses context
- Context enrichment → Temporal history: uses history
- Event processing → Event data models: creates event records
- Event data models → PostGIS database: persisted in
- Product API routes → Analytics service: serves analytics
- Product API routes → Investigation service: serves investigations
- Incident investigator → API client: requests intelligence
- Investigation service → AI reasoning: uses reasoning
