# dinesh-vishwakarma/vajra architecture

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

- Interactive diagram: https://gitdiagram.com/dinesh-vishwakarma/vajra
- Repository: https://github.com/dinesh-vishwakarma/vajra

## Overview

VAJRA is a severe-weather nowcasting and civil-defense platform. Its intended data workflow collects radar, satellite and atmospheric observations, preprocesses/grids them into training-ready data, and supports multiple forecast-model approaches with evaluation and tracking. The FastAPI service exposes radar and operational products to a multi-dashboard Next.js interface, including disaster operations, aviation, thermodynamics, replay, analytics and model explainability. The README documents broad capabilities not all backed by sampled implementation; edges below are limited to explicit imports, calls, or documented relationships.

Main entry points: [`src/api/main.py`](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/api/main.py) (FastAPI gateway), [`ui/src/lib/api.ts`](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/lib/api.ts) (API client), [`src/features/build_zarr_store.py`](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/build_zarr_store.py) (Zarr training store), [`src/models/evaluation_framework.py`](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/evaluation_framework.py) (Forecast evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Weather data"]
  node_imd["IMD radar ingest<br/>[download_imd.py]"]
  node_era5["ERA5 ingest<br/>[download_era5.py]"]
  node_quality["Data quality checks<br/>[quality_check.py]"]
  node_radarprep["Radar preprocessing"]
  node_satnwp["Satellite and NWP"]
  node_grid["Master weather grid"]
  node_targets["Forecast targets"]
  node_zarr[("Zarr training store")]
end

subgraph group_models["Forecast modeling"]
  node_baselines["Forecast baselines<br/>[baselines.py]"]
  node_classical["Classical ML<br/>[classical_ml.py]"]
  node_spatial["Spatial U-Net<br/>[spatial_dl.py]"]
  node_temporal["Spatiotemporal model"]
  node_fusion["Multimodal fusion"]
  node_physics["Physics-informed model"]
  node_evaluation["Forecast evaluation"]
  node_tracking["Training and tracking<br/>[mlops_tracking.py]"]
  node_export["ONNX export<br/>[onnx_exporter.py]"]
end

subgraph group_service["API service"]
  node_api["FastAPI gateway<br/>[main.py]"]
end

subgraph group_ui["User dashboards"]
  node_dashboard["Radar command center<br/>[page.tsx]"]
  node_disaster["Disaster operations<br/>[page.tsx]"]
  node_aviation["Aviation safety<br/>[page.tsx]"]
  node_thermo["Thermodynamics<br/>[page.tsx]"]
  node_replay["Storm replay<br/>[page.tsx]"]
  node_analytics["Forecast analytics<br/>[page.tsx]"]
  node_modelui["Model explainability<br/>[page.tsx]"]
  node_alerts["Alert dashboard<br/>[page.tsx]"]
  node_settings["Dashboard settings<br/>[page.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

node_operator(("Weather operators"))

node_operator -->|"requests products"| node_api
node_api -->|"serves radar"| node_dashboard
node_api -->|"serves operations"| node_disaster
node_api -->|"serves airport data"| node_aviation
node_api -->|"serves soundings"| node_thermo
node_api -->|"serves cases"| node_replay
node_api -->|"serves validation"| node_analytics
node_api -->|"serves model info"| node_modelui
node_api -.->|"serves alert products"| node_alerts
node_api -.->|"serves settings"| node_settings
node_api -.->|"provides API"| node_api_client
node_api_client -.->|"fetches data"| node_dashboard
node_api_client -.->|"fetches data"| node_disaster
node_api_client -.->|"fetches data"| node_aviation
node_api_client -.->|"fetches data"| node_thermo
node_api_client -.->|"fetches data"| node_replay
node_api_client -.->|"fetches data"| node_analytics
node_api_client -.->|"fetches data"| node_modelui
node_imd -.->|"checks observations"| node_quality
node_era5 -.->|"checks observations"| node_quality
node_radarprep -.->|"grids radar"| node_grid
node_satnwp -.->|"adds fields"| node_grid
node_grid -.->|"defines targets"| node_targets
node_targets -.->|"stores training data"| node_zarr
node_zarr -->|"loads training data"| node_baselines
node_zarr -->|"loads training data"| node_spatial
node_zarr -->|"loads training data"| node_temporal
node_zarr -.->|"loads training data"| node_fusion
node_zarr -->|"loads training data"| node_physics
node_zarr -->|"loads training data"| node_tracking
node_spatial -.->|"evaluates forecasts"| node_evaluation
node_temporal -->|"evaluates forecasts"| node_evaluation
node_fusion -->|"imports metrics"| node_evaluation
node_physics -->|"imports metrics"| node_evaluation
node_baselines -->|"evaluates forecasts"| node_evaluation
node_tracking -->|"reuses model classes"| node_temporal
node_tracking -->|"logs metrics"| node_evaluation
node_export -->|"exports U-Net"| node_spatial
node_api -->|"returns products"| node_operator

click node_imd "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/ingestion/download_imd.py"
click node_era5 "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/ingestion/download_era5.py"
click node_quality "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/ingestion/quality_check.py"
click node_radarprep "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/radar_preprocessing.py"
click node_satnwp "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/satellite_nwp_pipeline.py"
click node_grid "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/build_master_grid.py"
click node_targets "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/target_definition.py"
click node_zarr "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/build_zarr_store.py"
click node_baselines "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/baselines.py"
click node_classical "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/classical_ml.py"
click node_spatial "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/spatial_dl.py"
click node_temporal "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/spatiotemporal_dl.py"
click node_fusion "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/multimodal_fusion.py"
click node_physics "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/physics_informed.py"
click node_evaluation "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/evaluation_framework.py"
click node_tracking "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/mlops_tracking.py"
click node_export "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/api/onnx_exporter.py"
click node_api "https://github.com/dinesh-vishwakarma/vajra/blob/main/src/api/main.py"
click node_dashboard "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/page.tsx"
click node_disaster "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/disaster-ops/page.tsx"
click node_aviation "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/aviation/page.tsx"
click node_thermo "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/thermodynamics/page.tsx"
click node_replay "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/replay/page.tsx"
click node_analytics "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/analytics/page.tsx"
click node_modelui "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/models/page.tsx"
click node_alerts "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/alerts/page.tsx"
click node_settings "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/settings/page.tsx"
click node_api_client "https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/lib/api.ts"

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_imd,node_era5,node_quality,node_radarprep,node_satnwp,node_grid,node_targets,node_zarr toneBlue
class node_baselines,node_classical,node_spatial,node_temporal,node_fusion,node_physics,node_evaluation,node_tracking,node_export toneAmber
class node_api toneMint
class node_dashboard,node_disaster,node_aviation,node_thermo,node_replay,node_analytics,node_modelui,node_alerts,node_settings,node_api_client toneRose
class node_operator toneIndigo
```

## Components

### Weather data

- [IMD radar ingest](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/ingestion/download_imd.py): `src/ingestion/download_imd.py`
- [ERA5 ingest](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/ingestion/download_era5.py): `src/ingestion/download_era5.py`
- [Data quality checks](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/ingestion/quality_check.py): `src/ingestion/quality_check.py`
- [Radar preprocessing](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/radar_preprocessing.py): `src/features/radar_preprocessing.py`
- [Satellite and NWP](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/satellite_nwp_pipeline.py): `src/features/satellite_nwp_pipeline.py`
- [Master weather grid](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/build_master_grid.py): `src/features/build_master_grid.py`
- [Forecast targets](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/target_definition.py): `src/features/target_definition.py`
- [Zarr training store](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/features/build_zarr_store.py): `src/features/build_zarr_store.py`

### Forecast modeling

- [Forecast baselines](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/baselines.py): `src/models/baselines.py`
- [Classical ML](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/classical_ml.py): `src/models/classical_ml.py`
- [Spatial U-Net](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/spatial_dl.py): `src/models/spatial_dl.py`
- [Spatiotemporal model](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/spatiotemporal_dl.py): `src/models/spatiotemporal_dl.py`
- [Multimodal fusion](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/multimodal_fusion.py): `src/models/multimodal_fusion.py`
- [Physics-informed model](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/physics_informed.py): `src/models/physics_informed.py`
- [Forecast evaluation](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/evaluation_framework.py): `src/models/evaluation_framework.py`
- [Training and tracking](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/models/mlops_tracking.py): `src/models/mlops_tracking.py`
- [ONNX export](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/api/onnx_exporter.py): `src/api/onnx_exporter.py`

### API service

- [FastAPI gateway](https://github.com/dinesh-vishwakarma/vajra/blob/main/src/api/main.py): `src/api/main.py`

### User dashboards

- [Radar command center](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/page.tsx): `ui/src/app/page.tsx`
- [Disaster operations](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/disaster-ops/page.tsx): `ui/src/app/disaster-ops/page.tsx`
- [Aviation safety](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/aviation/page.tsx): `ui/src/app/aviation/page.tsx`
- [Thermodynamics](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/thermodynamics/page.tsx): `ui/src/app/thermodynamics/page.tsx`
- [Storm replay](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/replay/page.tsx): `ui/src/app/replay/page.tsx`
- [Forecast analytics](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/analytics/page.tsx): `ui/src/app/analytics/page.tsx`
- [Model explainability](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/models/page.tsx): `ui/src/app/models/page.tsx`
- [Alert dashboard](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/alerts/page.tsx): `ui/src/app/alerts/page.tsx`
- [Dashboard settings](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/app/settings/page.tsx): `ui/src/app/settings/page.tsx`
- [API client](https://github.com/dinesh-vishwakarma/vajra/blob/main/ui/src/lib/api.ts): `ui/src/lib/api.ts`

### Other components

- **Weather operators**

## Connections

- Weather operators → FastAPI gateway: requests products (evidence: `README.md`)
- FastAPI gateway → Radar command center: serves radar (evidence: `README.md`)
- FastAPI gateway → Disaster operations: serves operations (evidence: `README.md`)
- FastAPI gateway → Aviation safety: serves airport data (evidence: `README.md`)
- FastAPI gateway → Thermodynamics: serves soundings (evidence: `README.md`)
- FastAPI gateway → Storm replay: serves cases (evidence: `README.md`)
- FastAPI gateway → Forecast analytics: serves validation (evidence: `README.md`)
- FastAPI gateway → Model explainability: serves model info (evidence: `README.md`)
- FastAPI gateway → Alert dashboard: serves alert products (evidence: `README.md`)
- FastAPI gateway → Dashboard settings: serves settings
- FastAPI gateway → API client: provides API
- API client → Radar command center: fetches data
- API client → Disaster operations: fetches data
- API client → Aviation safety: fetches data
- API client → Thermodynamics: fetches data
- API client → Storm replay: fetches data
- API client → Forecast analytics: fetches data
- API client → Model explainability: fetches data
- IMD radar ingest → Data quality checks: checks observations
- ERA5 ingest → Data quality checks: checks observations
- Radar preprocessing → Master weather grid: grids radar
- Satellite and NWP → Master weather grid: adds fields
- Master weather grid → Forecast targets: defines targets
- Forecast targets → Zarr training store: stores training data
- Zarr training store → Forecast baselines: loads training data (evidence: `src/models/baselines.py`)
- Zarr training store → Spatial U-Net: loads training data (evidence: `src/models/spatial_dl.py`)
- Zarr training store → Spatiotemporal model: loads training data (evidence: `src/models/spatiotemporal_dl.py`)
- Zarr training store → Multimodal fusion: loads training data
- Zarr training store → Physics-informed model: loads training data (evidence: `src/models/physics_informed.py`)
- Zarr training store → Training and tracking: loads training data (evidence: `src/models/mlops_tracking.py`)
- Spatial U-Net → Forecast evaluation: evaluates forecasts (evidence: `src/models/spatial_dl.py`)
- Spatiotemporal model → Forecast evaluation: evaluates forecasts (evidence: `src/models/spatiotemporal_dl.py`)
- Multimodal fusion → Forecast evaluation: imports metrics (evidence: `src/models/multimodal_fusion.py`)
- Physics-informed model → Forecast evaluation: imports metrics (evidence: `src/models/physics_informed.py`)
- Forecast baselines → Forecast evaluation: evaluates forecasts (evidence: `src/models/baselines.py`)
- Training and tracking → Spatiotemporal model: reuses model classes (evidence: `src/models/mlops_tracking.py`)
- Training and tracking → Forecast evaluation: logs metrics (evidence: `src/models/mlops_tracking.py`)
- ONNX export → Spatial U-Net: exports U-Net (evidence: `src/api/onnx_exporter.py`)
- FastAPI gateway → Weather operators: returns products (evidence: `src/api/main.py`)
