# gayatridushing2345/mausammesh architecture

> Architecture diagram of the GitHub repository gayatridushing2345/mausammesh, 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/gayatridushing2345/mausammesh
- Repository: https://github.com/gayatridushing2345/mausammesh

## Overview

MausamMesh is a Panchayat-scale weather intelligence and officer decision-support platform. Its principal workflow refines block forecasts into local forecasts, ranks agricultural risk, and presents results for officer review and action. The backend also exposes map, comparison, reliability, and bulletin-report capabilities; the frontend provides multilingual dashboards and a rule-based assistant. The graph follows documented relationships and source-index references; unsampled subsystems are included where the README documents them, but uncertain internal call paths are not inferred.

Main entry points: [`backend/app/api/endpoints.py`](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/api/endpoints.py) (HTTP API), [`backend/app/services/data_service.py`](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/data_service.py) (Forecast data engine), [`frontend/src/components/KeyInsight.tsx`](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/KeyInsight.tsx) (Insight display), [`frontend/src/components/DashboardScreen.tsx`](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/DashboardScreen.tsx) (Forecast dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Forecast and data"]
  node_imd["IMD forecasts"]
  node_winds["WINDS telemetry"]
  node_model["Residual downscaler<br/>[ml_service.py]"]
  node_data["Forecast data engine<br/>[data_service.py]"]
  node_priority["Risk scoring<br/>[priority_engine.py]"]
  node_categories["IMD categories<br/>[imd_categories.py]"]
end

subgraph group_backend["Backend services"]
  node_api["HTTP API<br/>[endpoints.py]"]
  node_schemas["API data models<br/>[schemas.py]"]
  node_config["Runtime settings<br/>[config.py]"]
  node_app["API application<br/>[main.py]"]
end

subgraph group_workflow["Officer workflow"]
  node_advisory["Advisory drafting and approval"]
  node_winds_service["WINDS status connector<br/>[winds_service.py]"]
end

subgraph group_frontend["Dashboard"]
  node_client_api["Frontend API client<br/>[api.ts]"]
  node_dashboard["Forecast dashboard"]
  node_map["Map exploration<br/>[MapScreen.tsx]"]
  node_map_view["Interactive map"]
  node_location["Location explorer"]
  node_analysis["Forecast analysis<br/>[AnalysisScreen.tsx]"]
  node_reliability["Model reliability"]
  node_advisory_ui["Advisory screen<br/>[AdvisoryScreen.tsx]"]
  node_chatbot["Rule-based assistant<br/>[ChatbotWidget.tsx]"]
  node_i18n["Localization<br/>[i18n.ts]"]
  node_insight["Insight display<br/>[KeyInsight.tsx]"]
end

node_officer(("IMD / DAMU officer"))
node_browser(("Dashboard user"))

node_app -->|"loads settings"| node_config
node_app -->|"registers routes"| node_api
node_api -->|"requests forecasts and data"| node_data
node_api -->|"routes advisory approval"| node_advisory
node_api -->|"requests network status"| node_winds_service
node_api -->|"validates API data"| node_schemas
node_data -->|"predicts local forecasts"| node_model
node_data -->|"uses telemetry connector"| node_winds_service
node_data -->|"uses risk scoring"| node_priority
node_data -->|"uses weather categories"| node_categories
node_imd -.->|"provides block baseline"| node_data
node_winds -.->|"supplies station telemetry"| node_winds_service
node_officer -->|"requests ranked queue"| node_api
node_api -->|"requests priority queue"| node_data
node_officer -->|"reviews draft"| node_advisory
node_api -->|"serves dashboard data"| node_dashboard
node_browser -.->|"views forecasts"| node_dashboard
node_dashboard -.->|"requests backend data"| node_client_api
node_location -->|"requests location data"| node_client_api
node_map -->|"renders map"| node_map_view
node_dashboard -->|"renders map"| node_map_view
node_dashboard -->|"renders insights"| node_insight
node_map -->|"renders insights"| node_insight
node_analysis -->|"renders insights"| node_insight
node_reliability -->|"renders insights"| node_insight
node_advisory_ui -->|"renders insights"| node_insight
node_insight -->|"translates messages"| node_i18n
node_browser -.->|"asks questions"| node_chatbot

click node_model "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/ml_service.py"
click node_data "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/data_service.py"
click node_priority "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/priority_engine.py"
click node_categories "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/imd_categories.py"
click node_api "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/api/endpoints.py"
click node_schemas "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/schemas.py"
click node_config "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/config.py"
click node_app "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/main.py"
click node_advisory "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/advisory_service.py"
click node_winds_service "https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/winds_service.py"
click node_client_api "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/lib/api.ts"
click node_dashboard "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/DashboardScreen.tsx"
click node_map "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/MapScreen.tsx"
click node_map_view "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/LeafletMapInner.tsx"
click node_location "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/LocationExplorerModal.tsx"
click node_analysis "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/AnalysisScreen.tsx"
click node_reliability "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/ReliabilityScreen.tsx"
click node_advisory_ui "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/AdvisoryScreen.tsx"
click node_chatbot "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/ChatbotWidget.tsx"
click node_i18n "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/lib/i18n.ts"
click node_insight "https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/KeyInsight.tsx"

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_winds,node_model,node_data,node_priority,node_categories,node_browser toneBlue
class node_api,node_schemas,node_config,node_app toneAmber
class node_advisory,node_winds_service toneMint
class node_client_api,node_dashboard,node_map,node_map_view,node_location,node_analysis,node_reliability,node_advisory_ui,node_chatbot,node_i18n,node_insight toneRose
class node_officer toneIndigo
```

## Components

### Forecast and data

- **IMD forecasts**
- **WINDS telemetry**
- [Residual downscaler](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/ml_service.py): `backend/app/services/ml_service.py`
- [Forecast data engine](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/data_service.py): `backend/app/services/data_service.py`
- [Risk scoring](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/priority_engine.py): `backend/app/services/priority_engine.py`
- [IMD categories](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/imd_categories.py): `backend/app/services/imd_categories.py`

### Backend services

- [HTTP API](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/api/endpoints.py): `backend/app/api/endpoints.py`
- [API data models](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Runtime settings](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/config.py): `backend/app/config.py`
- [API application](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/main.py): `backend/app/main.py`

### Officer workflow

- [Advisory drafting and approval](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/advisory_service.py): `backend/app/services/advisory_service.py`
- [WINDS status connector](https://github.com/gayatridushing2345/mausammesh/blob/main/backend/app/services/winds_service.py): `backend/app/services/winds_service.py`

### Dashboard

- [Frontend API client](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Forecast dashboard](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/DashboardScreen.tsx): `frontend/src/components/DashboardScreen.tsx`
- [Map exploration](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/MapScreen.tsx): `frontend/src/components/MapScreen.tsx`
- [Interactive map](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/LeafletMapInner.tsx): `frontend/src/components/LeafletMapInner.tsx`
- [Location explorer](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/LocationExplorerModal.tsx): `frontend/src/components/LocationExplorerModal.tsx`
- [Forecast analysis](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/AnalysisScreen.tsx): `frontend/src/components/AnalysisScreen.tsx`
- [Model reliability](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/ReliabilityScreen.tsx): `frontend/src/components/ReliabilityScreen.tsx`
- [Advisory screen](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/AdvisoryScreen.tsx): `frontend/src/components/AdvisoryScreen.tsx`
- [Rule-based assistant](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/ChatbotWidget.tsx): `frontend/src/components/ChatbotWidget.tsx`
- [Localization](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/lib/i18n.ts): `frontend/src/lib/i18n.ts`
- [Insight display](https://github.com/gayatridushing2345/mausammesh/blob/main/frontend/src/components/KeyInsight.tsx): `frontend/src/components/KeyInsight.tsx`

### Other components

- **IMD / DAMU officer**
- **Dashboard user**

## Connections

- API application → Runtime settings: loads settings (evidence: `backend/app/main.py`)
- API application → HTTP API: registers routes (evidence: `backend/app/main.py`)
- HTTP API → Forecast data engine: requests forecasts and data (evidence: `backend/app/api/endpoints.py`)
- HTTP API → Advisory drafting and approval: routes advisory approval (evidence: `backend/app/api/endpoints.py`)
- HTTP API → WINDS status connector: requests network status (evidence: `backend/app/api/endpoints.py`)
- HTTP API → API data models: validates API data (evidence: `backend/app/api/endpoints.py`)
- Forecast data engine → Residual downscaler: predicts local forecasts (evidence: `backend/app/services/data_service.py`)
- Forecast data engine → WINDS status connector: uses telemetry connector (evidence: `backend/app/services/data_service.py`)
- Forecast data engine → Risk scoring: uses risk scoring (evidence: `backend/app/services/data_service.py`)
- Forecast data engine → IMD categories: uses weather categories (evidence: `backend/app/services/data_service.py`)
- IMD forecasts → Forecast data engine: provides block baseline (evidence: `README.md`)
- WINDS telemetry → WINDS status connector: supplies station telemetry (evidence: `README.md`)
- IMD / DAMU officer → HTTP API: requests ranked queue (evidence: `README.md`)
- HTTP API → Forecast data engine: requests priority queue (evidence: `backend/app/api/endpoints.py`)
- IMD / DAMU officer → Advisory drafting and approval: reviews draft (evidence: `README.md`)
- HTTP API → Forecast dashboard: serves dashboard data (evidence: `README.md`)
- Dashboard user → Forecast dashboard: views forecasts
- Forecast dashboard → Frontend API client: requests backend data
- Location explorer → Frontend API client: requests location data (evidence: `frontend/src/components/LocationExplorerModal.tsx`)
- Map exploration → Interactive map: renders map (evidence: `frontend/src/components/MapScreen.tsx`)
- Forecast dashboard → Interactive map: renders map (evidence: `frontend/src/components/DashboardScreen.tsx`)
- Forecast dashboard → Insight display: renders insights (evidence: `frontend/src/components/DashboardScreen.tsx`)
- Map exploration → Insight display: renders insights (evidence: `frontend/src/components/MapScreen.tsx`)
- Forecast analysis → Insight display: renders insights (evidence: `frontend/src/components/AnalysisScreen.tsx`)
- Model reliability → Insight display: renders insights (evidence: `frontend/src/components/ReliabilityScreen.tsx`)
- Advisory screen → Insight display: renders insights (evidence: `frontend/src/components/AdvisoryScreen.tsx`)
- Insight display → Localization: translates messages (evidence: `frontend/src/components/KeyInsight.tsx`)
- Dashboard user → Rule-based assistant: asks questions (evidence: `README.md`)
