# srishanksd/sih architecture

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

- Interactive diagram: https://gitdiagram.com/srishanksd/sih
- Repository: https://github.com/srishanksd/sih

## Overview

VAJRA-CSDD is a convective-scale nowcasting prototype with two distinct paths: a radar-only ConvLSTM training workflow and a broader, modular nowcasting architecture. The dashboard currently serves no-data responses; although the API route imports the nowcasting pipeline, the sampled route does not invoke it. The README documents additional VAJRA capabilities whose implementation wiring was not sampled, so these are shown as architecture modules without speculative connections.

Main entry points: [`backend/core/pipeline.py`](https://github.com/srishanksd/sih/blob/main/backend/core/pipeline.py) (Nowcasting pipeline), [`backend/models/system.py`](https://github.com/srishanksd/sih/blob/main/backend/models/system.py) (VAJRA composition), [`training/train.py`](https://github.com/srishanksd/sih/blob/main/training/train.py) (Training loop), [`backend/app.py`](https://github.com/srishanksd/sih/blob/main/backend/app.py) (Flask application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard and API"]
  node_main["Application entry<br/>[main.py]"]
  node_app["Flask application<br/>[app.py]"]
  node_routes["Run API route<br/>[routes.py]"]
  node_frontend["Dashboard UI<br/>[app.js]"]
end

subgraph group_nowcast["Operational Nowcasting"]
  node_pipeline["Nowcasting pipeline<br/>[pipeline.py]"]
  node_detection["Storm detection<br/>[storm_detection.py]"]
  node_tracking["Storm tracking<br/>[storm_tracking.py]"]
  node_state_estimation["State estimation"]
  node_object_dynamics["Object dynamics<br/>[lagrangian.py]"]
  node_field_dynamics["Field dynamics<br/>[eulerian.py]"]
  node_consistency["Object-field consistency<br/>[object_field.py]"]
  node_lifecycle["Lifecycle events<br/>[events.py]"]
  node_quality["Data quality<br/>[quality.py]"]
  node_hazard_probability["Hazard probabilities<br/>[probability.py]"]
end

subgraph group_vajra["VAJRA Architecture"]
  node_system["VAJRA composition<br/>[system.py]"]
  node_fusion["Reliability-aware fusion<br/>[fusion.py]"]
  node_convective_state["Convective state"]
  node_storm_graph["Storm-cell graph<br/>[storm_graph.py]"]
  node_ensemble["Stochastic ensemble<br/>[ensemble.py]"]
  node_hazard_heads["Multi-hazard heads<br/>[multihazard.py]"]
  node_other_modules["Additional model modules"]
end

subgraph group_training["Radar Training"]
  node_converter["Radar conversion<br/>[dwr_netcdf.py]"]
  node_prepare["Dataset preparation<br/>[prepare.py]"]
  node_sequences["Radar sequences<br/>[sequence.py]"]
  node_trainer["Training loop<br/>[train.py]"]
  node_convlstm["ConvLSTM nowcaster<br/>[convlstm.py]"]
  node_loss["Forecast loss<br/>[forecast.py]"]
  node_dataset_splits["Dataset splitting<br/>[data_split.py]"]
end

node_user(("Dashboard user"))
node_radar_files["DWR NetCDF scans"]

node_user -->|"uses"| node_frontend
node_frontend -->|"requests state"| node_app
node_main -->|"starts"| node_app
node_app -->|"registers"| node_routes
node_app -->|"serves"| node_frontend
node_routes -.->|"imports only"| node_pipeline
node_pipeline -->|"detects cells"| node_detection
node_pipeline -->|"tracks cells"| node_tracking
node_pipeline -->|"estimates state"| node_state_estimation
node_pipeline -->|"forecasts objects"| node_object_dynamics
node_pipeline -->|"advects field"| node_field_dynamics
node_pipeline -->|"scores consistency"| node_consistency
node_pipeline -->|"classifies events"| node_lifecycle
node_pipeline -->|"scores quality"| node_quality
node_pipeline -->|"computes hazards"| node_hazard_probability
node_pipeline -->|"creates architecture"| node_system
node_system -->|"instantiates"| node_fusion
node_system -->|"instantiates"| node_convective_state
node_system -->|"instantiates"| node_ensemble
node_system -->|"instantiates"| node_hazard_heads
node_system -->|"builds graph"| node_storm_graph
node_system -.->|"architecture includes"| node_other_modules
node_radar_files -->|"converts scans"| node_converter
node_converter -->|"prepares frames"| node_prepare
node_prepare -->|"forms sequences"| node_sequences
node_trainer -->|"splits files"| node_dataset_splits
node_trainer -->|"loads windows"| node_sequences
node_trainer -->|"trains model"| node_convlstm
node_trainer -->|"scores forecasts"| node_loss

click node_main "https://github.com/srishanksd/sih/blob/main/main.py"
click node_app "https://github.com/srishanksd/sih/blob/main/backend/app.py"
click node_routes "https://github.com/srishanksd/sih/blob/main/backend/api/routes.py"
click node_frontend "https://github.com/srishanksd/sih/blob/main/frontend/app.js"
click node_pipeline "https://github.com/srishanksd/sih/blob/main/backend/core/pipeline.py"
click node_detection "https://github.com/srishanksd/sih/blob/main/backend/models/storm_detection.py"
click node_tracking "https://github.com/srishanksd/sih/blob/main/backend/models/storm_tracking.py"
click node_state_estimation "https://github.com/srishanksd/sih/blob/main/backend/models/state_estimation.py"
click node_object_dynamics "https://github.com/srishanksd/sih/blob/main/backend/models/object_dynamics/lagrangian.py"
click node_field_dynamics "https://github.com/srishanksd/sih/blob/main/backend/models/field_dynamics/eulerian.py"
click node_consistency "https://github.com/srishanksd/sih/blob/main/backend/models/consistency/object_field.py"
click node_lifecycle "https://github.com/srishanksd/sih/blob/main/backend/models/storm_lifecycle/events.py"
click node_quality "https://github.com/srishanksd/sih/blob/main/backend/models/data_quality/quality.py"
click node_hazard_probability "https://github.com/srishanksd/sih/blob/main/backend/models/hazard_heads/probability.py"
click node_system "https://github.com/srishanksd/sih/blob/main/backend/models/system.py"
click node_fusion "https://github.com/srishanksd/sih/blob/main/backend/models/encoders/fusion.py"
click node_convective_state "https://github.com/srishanksd/sih/blob/main/backend/models/state/convective_state.py"
click node_storm_graph "https://github.com/srishanksd/sih/blob/main/backend/models/storm_graph.py"
click node_ensemble "https://github.com/srishanksd/sih/blob/main/backend/models/probabilistic/ensemble.py"
click node_hazard_heads "https://github.com/srishanksd/sih/blob/main/backend/models/hazard_heads/multihazard.py"
click node_other_modules "https://github.com/srishanksd/sih/tree/main/backend/models"
click node_converter "https://github.com/srishanksd/sih/blob/main/training/datasets/dwr_netcdf.py"
click node_prepare "https://github.com/srishanksd/sih/blob/main/training/datasets/prepare.py"
click node_sequences "https://github.com/srishanksd/sih/blob/main/training/datasets/sequence.py"
click node_trainer "https://github.com/srishanksd/sih/blob/main/training/train.py"
click node_convlstm "https://github.com/srishanksd/sih/blob/main/training/models/convlstm.py"
click node_loss "https://github.com/srishanksd/sih/blob/main/training/losses/forecast.py"
click node_dataset_splits "https://github.com/srishanksd/sih/blob/main/training/utils/data_split.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_main,node_app,node_routes,node_frontend,node_user toneBlue
class node_pipeline,node_detection,node_tracking,node_state_estimation,node_object_dynamics,node_field_dynamics,node_consistency,node_lifecycle,node_quality,node_hazard_probability toneAmber
class node_system,node_fusion,node_convective_state,node_storm_graph,node_ensemble,node_hazard_heads,node_other_modules toneMint
class node_converter,node_prepare,node_sequences,node_trainer,node_convlstm,node_loss,node_dataset_splits toneRose
class node_radar_files toneIndigo
```

## Components

### Dashboard and API

- [Application entry](https://github.com/srishanksd/sih/blob/main/main.py): `main.py`
- [Flask application](https://github.com/srishanksd/sih/blob/main/backend/app.py): `backend/app.py`
- [Run API route](https://github.com/srishanksd/sih/blob/main/backend/api/routes.py): `backend/api/routes.py`
- [Dashboard UI](https://github.com/srishanksd/sih/blob/main/frontend/app.js): `frontend/app.js`

### Operational Nowcasting

- [Nowcasting pipeline](https://github.com/srishanksd/sih/blob/main/backend/core/pipeline.py): `backend/core/pipeline.py`
- [Storm detection](https://github.com/srishanksd/sih/blob/main/backend/models/storm_detection.py): `backend/models/storm_detection.py`
- [Storm tracking](https://github.com/srishanksd/sih/blob/main/backend/models/storm_tracking.py): `backend/models/storm_tracking.py`
- [State estimation](https://github.com/srishanksd/sih/blob/main/backend/models/state_estimation.py): `backend/models/state_estimation.py`
- [Object dynamics](https://github.com/srishanksd/sih/blob/main/backend/models/object_dynamics/lagrangian.py): `backend/models/object_dynamics/lagrangian.py`
- [Field dynamics](https://github.com/srishanksd/sih/blob/main/backend/models/field_dynamics/eulerian.py): `backend/models/field_dynamics/eulerian.py`
- [Object-field consistency](https://github.com/srishanksd/sih/blob/main/backend/models/consistency/object_field.py): `backend/models/consistency/object_field.py`
- [Lifecycle events](https://github.com/srishanksd/sih/blob/main/backend/models/storm_lifecycle/events.py): `backend/models/storm_lifecycle/events.py`
- [Data quality](https://github.com/srishanksd/sih/blob/main/backend/models/data_quality/quality.py): `backend/models/data_quality/quality.py`
- [Hazard probabilities](https://github.com/srishanksd/sih/blob/main/backend/models/hazard_heads/probability.py): `backend/models/hazard_heads/probability.py`

### VAJRA Architecture

- [VAJRA composition](https://github.com/srishanksd/sih/blob/main/backend/models/system.py): `backend/models/system.py`
- [Reliability-aware fusion](https://github.com/srishanksd/sih/blob/main/backend/models/encoders/fusion.py): `backend/models/encoders/fusion.py`
- [Convective state](https://github.com/srishanksd/sih/blob/main/backend/models/state/convective_state.py): `backend/models/state/convective_state.py`
- [Storm-cell graph](https://github.com/srishanksd/sih/blob/main/backend/models/storm_graph.py): `backend/models/storm_graph.py`
- [Stochastic ensemble](https://github.com/srishanksd/sih/blob/main/backend/models/probabilistic/ensemble.py): `backend/models/probabilistic/ensemble.py`
- [Multi-hazard heads](https://github.com/srishanksd/sih/blob/main/backend/models/hazard_heads/multihazard.py): `backend/models/hazard_heads/multihazard.py`
- [Additional model modules](https://github.com/srishanksd/sih/tree/main/backend/models): `backend/models`

### Radar Training

- [Radar conversion](https://github.com/srishanksd/sih/blob/main/training/datasets/dwr_netcdf.py): `training/datasets/dwr_netcdf.py`
- [Dataset preparation](https://github.com/srishanksd/sih/blob/main/training/datasets/prepare.py): `training/datasets/prepare.py`
- [Radar sequences](https://github.com/srishanksd/sih/blob/main/training/datasets/sequence.py): `training/datasets/sequence.py`
- [Training loop](https://github.com/srishanksd/sih/blob/main/training/train.py): `training/train.py`
- [ConvLSTM nowcaster](https://github.com/srishanksd/sih/blob/main/training/models/convlstm.py): `training/models/convlstm.py`
- [Forecast loss](https://github.com/srishanksd/sih/blob/main/training/losses/forecast.py): `training/losses/forecast.py`
- [Dataset splitting](https://github.com/srishanksd/sih/blob/main/training/utils/data_split.py): `training/utils/data_split.py`

### Other components

- **Dashboard user**
- **DWR NetCDF scans**

## Connections

- Dashboard user → Dashboard UI: uses
- Dashboard UI → Flask application: requests state
- Application entry → Flask application: starts
- Flask application → Run API route: registers
- Flask application → Dashboard UI: serves
- Run API route → Nowcasting pipeline: imports only
- Nowcasting pipeline → Storm detection: detects cells
- Nowcasting pipeline → Storm tracking: tracks cells
- Nowcasting pipeline → State estimation: estimates state
- Nowcasting pipeline → Object dynamics: forecasts objects
- Nowcasting pipeline → Field dynamics: advects field
- Nowcasting pipeline → Object-field consistency: scores consistency
- Nowcasting pipeline → Lifecycle events: classifies events
- Nowcasting pipeline → Data quality: scores quality
- Nowcasting pipeline → Hazard probabilities: computes hazards
- Nowcasting pipeline → VAJRA composition: creates architecture
- VAJRA composition → Reliability-aware fusion: instantiates
- VAJRA composition → Convective state: instantiates
- VAJRA composition → Stochastic ensemble: instantiates
- VAJRA composition → Multi-hazard heads: instantiates
- VAJRA composition → Storm-cell graph: builds graph
- VAJRA composition → Additional model modules: architecture includes
- DWR NetCDF scans → Radar conversion: converts scans
- Radar conversion → Dataset preparation: prepares frames
- Dataset preparation → Radar sequences: forms sequences
- Training loop → Dataset splitting: splits files
- Training loop → Radar sequences: loads windows
- Training loop → ConvLSTM nowcaster: trains model
- Training loop → Forecast loss: scores forecasts
