# cartickkk/aeroroute-iq architecture

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

- Interactive diagram: https://gitdiagram.com/cartickkk/aeroroute-iq
- Repository: https://github.com/cartickkk/aeroroute-iq

## Overview

AeroRoute IQ is a Bhopal air-quality navigation and incident-awareness dashboard. Operators sign in, inspect the city map and forecast, request a clean-corridor comparison, and see route exposure estimates; they can also report an incident for automated dispatch. The backend route calculation and hotspot registry are sampled directly. The README documents the Make.com-to-Telegram dispatch and Supabase authentication; source excerpts show frontend calls and rendering, but not every page-script wiring or external service implementation.

Main entry points: [`frontend/js/app.js`](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/app.js) (Dashboard controls), [`frontend/js/map.js`](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/map.js) (Map and routes), [`frontend/js/api.js`](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/api.js) (API client), [`backend/app.py`](https://github.com/cartickkk/aeroroute-iq/blob/main/backend/app.py) (Flask API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Operator dashboard"]
  node_dashboard["Dashboard controls<br/>[app.js]"]
  node_mapview["Map and routes<br/>[map.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_routing["Routing and exposure"]
  node_backend_api["Flask API<br/>[app.py]"]
  node_route_engine["Corridor and AQI engine<br/>[aqi_engine.py]"]
  node_health_impact["Inhalation estimates<br/>[app.js]"]
end

subgraph group_spatial["Spatial intelligence"]
  node_city_registry[("Nodes and hotspots<br/>[data_loader.py]")]
  node_map_config["Map and forecast data<br/>[config.js]"]
  node_green_buffers["Green buffer overlays<br/>[map.js]"]
  node_forecast["Dispersion forecast<br/>[map.js]"]
end

subgraph group_identity["Access and dispatch"]
  node_login["Operator login<br/>[auth.js]"]
  node_auth_client["Supabase client<br/>[supabase-client.js]"]
  node_incident_report["Incident reporting<br/>[app.js]"]
end

node_operator(("Operator"))
node_supabase{{"Supabase Auth"}}
node_make{{"Make.com webhook"}}
node_telegram{{"Telegram channel"}}

node_operator -->|"uses"| node_dashboard
node_dashboard -->|"requests routes"| node_api_client
node_api_client -->|"calls API"| node_backend_api
node_backend_api -->|"computes corridors"| node_route_engine
node_route_engine -->|"reads nodes and hotspots"| node_city_registry
node_backend_api -->|"reads hotspots"| node_city_registry
node_api_client -->|"returns route data"| node_dashboard
node_dashboard -->|"renders routes"| node_mapview
node_dashboard -->|"calculates dose"| node_health_impact
node_dashboard -->|"initializes map"| node_mapview
node_dashboard -->|"updates forecast"| node_mapview
node_mapview -->|"reads map data"| node_map_config
node_mapview -->|"renders buffers"| node_green_buffers
node_mapview -->|"renders dispersion"| node_forecast
node_operator -->|"signs in"| node_login
node_login -->|"uses client"| node_auth_client
node_auth_client -->|"authenticates"| node_supabase
node_dashboard -->|"checks session"| node_supabase
node_operator -->|"reports hazard"| node_incident_report
node_incident_report -->|"posts incident"| node_make
node_make -->|"dispatches alert"| node_telegram

click node_dashboard "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/app.js"
click node_mapview "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/map.js"
click node_api_client "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/api.js"
click node_backend_api "https://github.com/cartickkk/aeroroute-iq/blob/main/backend/app.py"
click node_route_engine "https://github.com/cartickkk/aeroroute-iq/blob/main/backend/aqi_engine.py"
click node_health_impact "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/app.js"
click node_city_registry "https://github.com/cartickkk/aeroroute-iq/blob/main/backend/data_loader.py"
click node_map_config "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/config.js"
click node_green_buffers "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/map.js"
click node_forecast "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/map.js"
click node_login "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/auth.js"
click node_auth_client "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/supabase-client.js"
click node_incident_report "https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/app.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_dashboard,node_mapview,node_api_client toneBlue
class node_backend_api,node_route_engine,node_health_impact toneAmber
class node_city_registry,node_map_config,node_green_buffers,node_forecast,node_make toneMint
class node_login,node_auth_client,node_incident_report toneRose
class node_operator,node_supabase,node_telegram toneIndigo
```

## Components

### Operator dashboard

- [Dashboard controls](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/app.js): `frontend/js/app.js`
- [Map and routes](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/map.js): `frontend/js/map.js`
- [API client](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/api.js): `frontend/js/api.js`

### Routing and exposure

- [Flask API](https://github.com/cartickkk/aeroroute-iq/blob/main/backend/app.py): `backend/app.py`
- [Corridor and AQI engine](https://github.com/cartickkk/aeroroute-iq/blob/main/backend/aqi_engine.py): `backend/aqi_engine.py`
- [Inhalation estimates](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/app.js): `frontend/js/app.js`

### Spatial intelligence

- [Nodes and hotspots](https://github.com/cartickkk/aeroroute-iq/blob/main/backend/data_loader.py): `backend/data_loader.py`
- [Map and forecast data](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/config.js): `frontend/js/config.js`
- [Green buffer overlays](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/map.js): `frontend/js/map.js`
- [Dispersion forecast](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/map.js): `frontend/js/map.js`

### Access and dispatch

- [Operator login](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [Supabase client](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/supabase-client.js): `frontend/js/supabase-client.js`
- [Incident reporting](https://github.com/cartickkk/aeroroute-iq/blob/main/frontend/js/app.js): `frontend/js/app.js`

### Other components

- **Operator**
- **Supabase Auth**
- **Make.com webhook**
- **Telegram channel**

## Connections

- Operator → Dashboard controls: uses (evidence: `README.md`)
- Dashboard controls → API client: requests routes (evidence: `frontend/js/app.js`)
- API client → Flask API: calls API (evidence: `README.md`)
- Flask API → Corridor and AQI engine: computes corridors (evidence: `backend/app.py`)
- Corridor and AQI engine → Nodes and hotspots: reads nodes and hotspots (evidence: `backend/aqi_engine.py`)
- Flask API → Nodes and hotspots: reads hotspots (evidence: `backend/app.py`)
- API client → Dashboard controls: returns route data (evidence: `frontend/js/app.js`)
- Dashboard controls → Map and routes: renders routes (evidence: `frontend/js/app.js`)
- Dashboard controls → Inhalation estimates: calculates dose (evidence: `frontend/js/app.js`)
- Dashboard controls → Map and routes: initializes map (evidence: `frontend/js/app.js`)
- Dashboard controls → Map and routes: updates forecast (evidence: `frontend/js/app.js`)
- Map and routes → Map and forecast data: reads map data (evidence: `frontend/js/map.js`)
- Map and routes → Green buffer overlays: renders buffers (evidence: `frontend/js/map.js`)
- Map and routes → Dispersion forecast: renders dispersion (evidence: `frontend/js/map.js`)
- Operator → Operator login: signs in (evidence: `README.md`)
- Operator login → Supabase client: uses client (evidence: `frontend/js/auth.js`)
- Supabase client → Supabase Auth: authenticates (evidence: `frontend/js/supabase-client.js`)
- Dashboard controls → Supabase Auth: checks session (evidence: `frontend/js/app.js`)
- Operator → Incident reporting: reports hazard (evidence: `README.md`)
- Incident reporting → Make.com webhook: posts incident (evidence: `frontend/js/app.js`)
- Make.com webhook → Telegram channel: dispatches alert (evidence: `README.md`)
