# siddhant0812-sid/aquawatch-flood architecture

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

- Interactive diagram: https://gitdiagram.com/siddhant0812-sid/aquawatch-flood
- Repository: https://github.com/siddhant0812-sid/aquawatch-flood

## Overview

AquaWatch Flood is a local flood-monitoring application for the Assam/Brahmaputra basin. Its main user workflow loads station status and SAR flood mapping, selects a station for 24/48/72-hour forecasts, and can simulate an emergency alert; separate views expose station details and model evaluation. Internally, hydrological telemetry is cleaned and transformed into forecast features, while SAR scenes are segmented and vectorized for map display. The graph preserves the documented ARIMA/LSTM/TFT comparison and explainability capabilities. Some backend and evaluation links rely on README documentation because their implementation excerpts were not provided.

Main entry points: [`frontend/src/pages/DashboardPage.tsx`](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/pages/DashboardPage.tsx) (Dashboard View), [`frontend/src/App.tsx`](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/App.tsx) (App Router), [`models/model_lstm.py`](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/model_lstm.py) (Multi-horizon LSTM), [`models/explainability.py`](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/explainability.py) (Comparison & Explainability)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard UI"]
  node_app["App Router<br/>[App.tsx]"]
  node_dashboard["Dashboard View<br/>[DashboardPage.tsx]"]
  node_station_view["Station Detail"]
  node_evaluation_view["Evaluation View"]
  node_map_panel["Basin Map<br/>[BasinMapPanel.tsx]"]
  node_kpi_panel["KPI Metrics<br/>[KpiMetricsRow.tsx]"]
  node_sar_panel["SAR Showcase"]
  node_forecast_panel["Forecast Chart"]
  node_drivers_panel["Hydrological Drivers"]
  node_station_panel["Station Table"]
end

subgraph group_api["Application API"]
  node_api_client["Typed API Client<br/>[client.ts]"]
  node_backend_api["FastAPI Endpoints<br/>[main.py]"]
  node_model_service["Model Service<br/>[model_service.py]"]
end

subgraph group_sar["SAR Flood Mapping"]
  node_sar_inference["U-Net Inference<br/>[inference.py]"]
end

subgraph group_hydro["Hydrological Forecasting"]
  node_telemetry["Telemetry Pipeline<br/>[data_pipeline.py]"]
  node_feature_engineering["Feature Engineering"]
  node_lstm["Multi-horizon LSTM<br/>[model_lstm.py]"]
end

subgraph group_evaluation["Evaluation &amp; Explainability"]
  node_arima["ARIMA Baseline<br/>[baseline_arima.py]"]
  node_tft["TFT-Lite Model<br/>[model_tft.py]"]
  node_explainability["Comparison &amp; Explainability<br/>[explainability.py]"]
end

node_operator(("Flood Operator"))

node_operator -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_station_view
node_app -->|"routes to"| node_evaluation_view
node_dashboard -->|"requests data"| node_api_client
node_dashboard -->|"renders"| node_map_panel
node_dashboard -->|"renders"| node_kpi_panel
node_dashboard -->|"renders"| node_sar_panel
node_dashboard -->|"renders"| node_forecast_panel
node_dashboard -->|"renders"| node_drivers_panel
node_dashboard -->|"renders"| node_station_panel
node_api_client -->|"calls endpoints"| node_backend_api
node_backend_api -->|"delegates to"| node_model_service
node_model_service -->|"runs segmentation"| node_sar_inference
node_model_service -->|"runs forecasting"| node_lstm
node_telemetry -.->|"provides telemetry"| node_feature_engineering
node_feature_engineering -->|"builds model inputs"| node_lstm
node_arima -->|"uses pipeline"| node_telemetry
node_arima -->|"uses features"| node_feature_engineering
node_tft -->|"reuses model code"| node_lstm
node_explainability -.->|"compares"| node_arima
node_explainability -.->|"explains"| node_lstm
node_explainability -.->|"compares"| node_tft
node_evaluation_view -->|"loads evaluation"| node_api_client

click node_app "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/App.tsx"
click node_dashboard "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_station_view "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/pages/StationDetailPage.tsx"
click node_evaluation_view "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/pages/ModelEvaluationPage.tsx"
click node_map_panel "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/BasinMapPanel.tsx"
click node_kpi_panel "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/KpiMetricsRow.tsx"
click node_sar_panel "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/SarShowcasePanel.tsx"
click node_forecast_panel "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/ForecastChartPanel.tsx"
click node_drivers_panel "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/HydrologicalDriversPanel.tsx"
click node_station_panel "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/StationTablePanel.tsx"
click node_api_client "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/api/client.ts"
click node_backend_api "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/backend/main.py"
click node_model_service "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/backend/model_service.py"
click node_sar_inference "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/inference.py"
click node_telemetry "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/data_pipeline.py"
click node_feature_engineering "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/feature_engineering.py"
click node_lstm "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/model_lstm.py"
click node_arima "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/baseline_arima.py"
click node_tft "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/model_tft.py"
click node_explainability "https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/explainability.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_dashboard,node_station_view,node_evaluation_view,node_map_panel,node_kpi_panel,node_sar_panel,node_forecast_panel,node_drivers_panel,node_station_panel toneBlue
class node_api_client,node_backend_api,node_model_service toneAmber
class node_sar_inference toneMint
class node_telemetry,node_feature_engineering,node_lstm toneRose
class node_arima,node_tft,node_explainability,node_operator toneIndigo
```

## Components

### Dashboard UI

- [App Router](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard View](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Station Detail](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/pages/StationDetailPage.tsx): `frontend/src/pages/StationDetailPage.tsx`
- [Evaluation View](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/pages/ModelEvaluationPage.tsx): `frontend/src/pages/ModelEvaluationPage.tsx`
- [Basin Map](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/BasinMapPanel.tsx): `frontend/src/components/dashboard/BasinMapPanel.tsx`
- [KPI Metrics](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/KpiMetricsRow.tsx): `frontend/src/components/dashboard/KpiMetricsRow.tsx`
- [SAR Showcase](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/SarShowcasePanel.tsx): `frontend/src/components/dashboard/SarShowcasePanel.tsx`
- [Forecast Chart](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/ForecastChartPanel.tsx): `frontend/src/components/dashboard/ForecastChartPanel.tsx`
- [Hydrological Drivers](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/HydrologicalDriversPanel.tsx): `frontend/src/components/dashboard/HydrologicalDriversPanel.tsx`
- [Station Table](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/components/dashboard/StationTablePanel.tsx): `frontend/src/components/dashboard/StationTablePanel.tsx`

### Application API

- [Typed API Client](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [FastAPI Endpoints](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/backend/main.py): `backend/main.py`
- [Model Service](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/backend/model_service.py): `backend/model_service.py`

### SAR Flood Mapping

- [U-Net Inference](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/inference.py): `models/inference.py`

### Hydrological Forecasting

- [Telemetry Pipeline](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/data_pipeline.py): `models/data_pipeline.py`
- [Feature Engineering](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/feature_engineering.py): `models/feature_engineering.py`
- [Multi-horizon LSTM](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/model_lstm.py): `models/model_lstm.py`

### Evaluation & Explainability

- [ARIMA Baseline](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/baseline_arima.py): `models/baseline_arima.py`
- [TFT-Lite Model](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/model_tft.py): `models/model_tft.py`
- [Comparison & Explainability](https://github.com/siddhant0812-sid/aquawatch-flood/blob/main/models/explainability.py): `models/explainability.py`

### Other components

- **Flood Operator**

## Connections

- Flood Operator → App Router: uses (evidence: `README.md`)
- App Router → Dashboard View: routes to (evidence: `frontend/src/App.tsx`)
- App Router → Station Detail: routes to (evidence: `frontend/src/App.tsx`)
- App Router → Evaluation View: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard View → Typed API Client: requests data (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Dashboard View → Basin Map: renders (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Dashboard View → KPI Metrics: renders (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Dashboard View → SAR Showcase: renders (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Dashboard View → Forecast Chart: renders (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Dashboard View → Hydrological Drivers: renders (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Dashboard View → Station Table: renders (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Typed API Client → FastAPI Endpoints: calls endpoints (evidence: `README.md`)
- FastAPI Endpoints → Model Service: delegates to (evidence: `backend/main.py`)
- Model Service → U-Net Inference: runs segmentation (evidence: `backend/model_service.py`)
- Model Service → Multi-horizon LSTM: runs forecasting (evidence: `backend/model_service.py`)
- Telemetry Pipeline → Feature Engineering: provides telemetry (evidence: `models/feature_engineering.py`)
- Feature Engineering → Multi-horizon LSTM: builds model inputs (evidence: `models/model_lstm.py`)
- ARIMA Baseline → Telemetry Pipeline: uses pipeline (evidence: `models/baseline_arima.py`)
- ARIMA Baseline → Feature Engineering: uses features (evidence: `models/baseline_arima.py`)
- TFT-Lite Model → Multi-horizon LSTM: reuses model code (evidence: `models/model_tft.py`)
- Comparison & Explainability → ARIMA Baseline: compares (evidence: `README.md`)
- Comparison & Explainability → Multi-horizon LSTM: explains (evidence: `README.md`)
- Comparison & Explainability → TFT-Lite Model: compares (evidence: `README.md`)
- Evaluation View → Typed API Client: loads evaluation (evidence: `README.md`)
