# sank-noobcoder/varun-ai architecture

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

- Interactive diagram: https://gitdiagram.com/sank-noobcoder/varun-ai
- Repository: https://github.com/sank-noobcoder/varun-ai

## Overview

The product is an Indian NWP rainfall post-processing and early-warning system. Its principal workflow takes district forecast and weather inputs through regime classification, rainfall correction, calibrated extreme-rain probabilities, and district warnings, then serves results through an API and multilingual dashboard. The README documents verification and urban-waterlogging capabilities as additional branches. Pipeline and API excerpts establish the main orchestration; unsampled subsystem links are limited to those supported by the README and repository tree.

Main entry points: [`core/pipeline.py`](https://github.com/sank-noobcoder/varun-ai/blob/main/core/pipeline.py) (Forecast pipeline), [`api/app.py`](https://github.com/sank-noobcoder/varun-ai/blob/main/api/app.py) (Forecast API), [`frontend/src/App.jsx`](https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/App.jsx) (Dashboard application), [`core/data_ingestion.py`](https://github.com/sank-noobcoder/varun-ai/blob/main/core/data_ingestion.py) (Dataset ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Weather Inputs"]
  node_weatherdata["Meteorological datasets"]
  node_ingestion["Dataset ingestion<br/>[data_ingestion.py]"]
  node_districts["District geography<br/>[districts_data.py]"]
end

subgraph group_models["Forecast Modeling"]
  node_pipeline["Forecast pipeline<br/>[pipeline.py]"]
  node_regimes["Regime classifier<br/>[classifier.py]"]
  node_correction["Bias correction<br/>[bias_correction.py]"]
  node_probability["Extreme probabilities<br/>[probability.py]"]
end

subgraph group_products["Operational Products"]
  node_aggregation["District warnings<br/>[aggregation.py]"]
  node_verification["Forecast verification<br/>[verification.py]"]
  node_waterlogging["Waterlogging risk<br/>[waterlogging.py]"]
  node_reports["Verification reports"]
end

subgraph group_service["API and Security"]
  node_api["Forecast API<br/>[app.py]"]
  node_security["Request protection<br/>[security.py]"]
end

subgraph group_interface["Dashboard"]
  node_app["Dashboard application<br/>[App.jsx]"]
  node_globe["Forecast globe<br/>[Globe3D.jsx]"]
  node_inspector["District inspector"]
  node_sandbox["Forecaster sandbox"]
  node_verificationview["Verification view"]
  node_waterloggingview["Waterlogging view"]
end

node_operator(("Forecaster or citizen"))
node_liveweather["Live weather service"]

node_weatherdata -->|"supplies datasets"| node_ingestion
node_ingestion -->|"prepares training data"| node_pipeline
node_districts -->|"provides geography"| node_ingestion
node_operator -->|"uses dashboard"| node_app
node_app -->|"requests forecasts"| node_api
node_app -->|"renders map"| node_globe
node_app -->|"shows district detail"| node_inspector
node_app -->|"opens simulations"| node_sandbox
node_app -->|"shows skill scores"| node_verificationview
node_app -->|"shows flood risk"| node_waterloggingview
node_api -->|"checks requests"| node_security
node_api -->|"runs forecasts"| node_pipeline
node_api -.->|"fetches live conditions"| node_liveweather
node_pipeline -->|"classifies regimes"| node_regimes
node_pipeline -->|"corrects rainfall"| node_correction
node_pipeline -->|"estimates exceedance"| node_probability
node_pipeline -->|"builds district products"| node_aggregation
node_pipeline -->|"evaluates forecasts"| node_verification
node_api -->|"serves verification"| node_verification
node_verification -->|"writes report"| node_reports
node_api -->|"serves risk layer"| node_waterlogging
node_api -->|"uses district registry"| node_districts
node_pipeline -->|"persists trained models"| node_weatherdata

click node_weatherdata "https://github.com/sank-noobcoder/varun-ai/tree/main/data"
click node_ingestion "https://github.com/sank-noobcoder/varun-ai/blob/main/core/data_ingestion.py"
click node_districts "https://github.com/sank-noobcoder/varun-ai/blob/main/core/districts_data.py"
click node_api "https://github.com/sank-noobcoder/varun-ai/blob/main/api/app.py"
click node_security "https://github.com/sank-noobcoder/varun-ai/blob/main/core/security.py"
click node_pipeline "https://github.com/sank-noobcoder/varun-ai/blob/main/core/pipeline.py"
click node_regimes "https://github.com/sank-noobcoder/varun-ai/blob/main/core/classifier.py"
click node_correction "https://github.com/sank-noobcoder/varun-ai/blob/main/core/bias_correction.py"
click node_probability "https://github.com/sank-noobcoder/varun-ai/blob/main/core/probability.py"
click node_aggregation "https://github.com/sank-noobcoder/varun-ai/blob/main/core/aggregation.py"
click node_verification "https://github.com/sank-noobcoder/varun-ai/blob/main/core/verification.py"
click node_waterlogging "https://github.com/sank-noobcoder/varun-ai/blob/main/core/waterlogging.py"
click node_reports "https://github.com/sank-noobcoder/varun-ai/blob/main/reports/verification_report.json"
click node_app "https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/App.jsx"
click node_globe "https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/Globe3D.jsx"
click node_inspector "https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/DistrictInspector.jsx"
click node_sandbox "https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/ForecasterSandbox.jsx"
click node_verificationview "https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/VerificationView.jsx"
click node_waterloggingview "https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/WaterloggingView.jsx"

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_weatherdata,node_ingestion,node_districts toneBlue
class node_pipeline,node_regimes,node_correction,node_probability toneAmber
class node_aggregation,node_verification,node_waterlogging,node_reports toneMint
class node_api,node_security toneRose
class node_app,node_globe,node_inspector,node_sandbox,node_verificationview,node_waterloggingview,node_operator,node_liveweather toneIndigo
```

## Components

### Weather Inputs

- [Meteorological datasets](https://github.com/sank-noobcoder/varun-ai/tree/main/data): `data`
- [Dataset ingestion](https://github.com/sank-noobcoder/varun-ai/blob/main/core/data_ingestion.py): `core/data_ingestion.py`
- [District geography](https://github.com/sank-noobcoder/varun-ai/blob/main/core/districts_data.py): `core/districts_data.py`

### Forecast Modeling

- [Forecast pipeline](https://github.com/sank-noobcoder/varun-ai/blob/main/core/pipeline.py): `core/pipeline.py`
- [Regime classifier](https://github.com/sank-noobcoder/varun-ai/blob/main/core/classifier.py): `core/classifier.py`
- [Bias correction](https://github.com/sank-noobcoder/varun-ai/blob/main/core/bias_correction.py): `core/bias_correction.py`
- [Extreme probabilities](https://github.com/sank-noobcoder/varun-ai/blob/main/core/probability.py): `core/probability.py`

### Operational Products

- [District warnings](https://github.com/sank-noobcoder/varun-ai/blob/main/core/aggregation.py): `core/aggregation.py`
- [Forecast verification](https://github.com/sank-noobcoder/varun-ai/blob/main/core/verification.py): `core/verification.py`
- [Waterlogging risk](https://github.com/sank-noobcoder/varun-ai/blob/main/core/waterlogging.py): `core/waterlogging.py`
- [Verification reports](https://github.com/sank-noobcoder/varun-ai/blob/main/reports/verification_report.json): `reports/verification_report.json`

### API and Security

- [Forecast API](https://github.com/sank-noobcoder/varun-ai/blob/main/api/app.py): `api/app.py`
- [Request protection](https://github.com/sank-noobcoder/varun-ai/blob/main/core/security.py): `core/security.py`

### Dashboard

- [Dashboard application](https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Forecast globe](https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/Globe3D.jsx): `frontend/src/components/Globe3D.jsx`
- [District inspector](https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/DistrictInspector.jsx): `frontend/src/components/DistrictInspector.jsx`
- [Forecaster sandbox](https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/ForecasterSandbox.jsx): `frontend/src/components/ForecasterSandbox.jsx`
- [Verification view](https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/VerificationView.jsx): `frontend/src/components/VerificationView.jsx`
- [Waterlogging view](https://github.com/sank-noobcoder/varun-ai/blob/main/frontend/src/components/WaterloggingView.jsx): `frontend/src/components/WaterloggingView.jsx`

### Other components

- **Forecaster or citizen**
- **Live weather service**

## Connections

- Meteorological datasets → Dataset ingestion: supplies datasets
- Dataset ingestion → Forecast pipeline: prepares training data
- District geography → Dataset ingestion: provides geography
- Forecaster or citizen → Dashboard application: uses dashboard
- Dashboard application → Forecast API: requests forecasts
- Dashboard application → Forecast globe: renders map
- Dashboard application → District inspector: shows district detail
- Dashboard application → Forecaster sandbox: opens simulations
- Dashboard application → Verification view: shows skill scores
- Dashboard application → Waterlogging view: shows flood risk
- Forecast API → Request protection: checks requests
- Forecast API → Forecast pipeline: runs forecasts
- Forecast API → Live weather service: fetches live conditions
- Forecast pipeline → Regime classifier: classifies regimes
- Forecast pipeline → Bias correction: corrects rainfall
- Forecast pipeline → Extreme probabilities: estimates exceedance
- Forecast pipeline → District warnings: builds district products
- Forecast pipeline → Forecast verification: evaluates forecasts
- Forecast API → Forecast verification: serves verification
- Forecast verification → Verification reports: writes report
- Forecast API → Waterlogging risk: serves risk layer
- Forecast API → District geography: uses district registry
- Forecast pipeline → Meteorological datasets: persists trained models
