# aruchith08/geoalert-sih-2026 architecture

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

- Interactive diagram: https://gitdiagram.com/aruchith08/geoalert-sih-2026
- Repository: https://github.com/aruchith08/geoalert-sih-2026

## Overview

GEOALERT is a landslide-risk intelligence platform for exploring spatial susceptibility, current rainfall and weather-driven forecasts. The user workflow runs from choosing a location or map cell, through API-backed terrain and weather evaluation, to coupled risk tiers and map/timeline inspection. Backend routes are the documented API entry points; startup also loads the frozen models and starts weather synchronization. The README documents major map layers and the 12-station mesh. Some links are omitted where sampled code does not show the call path; unsampled subsystems are represented only at supported directory paths.

Main entry points: [`backend/app/main.py`](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/weather_service.py`](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_service.py) (Weather intelligence), [`frontend/lib/api.ts`](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/lib/api.ts) (API client), [`backend/app/routes/risk.py`](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/risk.py) (Risk endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web GIS"]
  node_home["Dashboard<br/>[page.tsx]"]
  node_riskmap["Risk map<br/>[page.tsx]"]
  node_map["Map canvas<br/>[LeafletMap.tsx]"]
  node_inspector["Location inspector<br/>[InspectorPanel.tsx]"]
  node_timeline["Forecast timeline"]
  node_rainpanel["Rainfall panel"]
  node_api_client["API client<br/>[api.ts]"]
  node_sync_hook["Sync status hook<br/>[useWeatherSync.ts]"]
end

subgraph group_api["API and routes"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_risk_routes["Risk endpoints<br/>[risk.py]"]
  node_weather_routes["Weather endpoints<br/>[weather.py]"]
  node_rain_routes["Rainfall endpoints<br/>[rainfall.py]"]
  node_spatial_routes["Spatial endpoints<br/>[spatial.py]"]
end

subgraph group_risk["Risk intelligence"]
  node_model["Dual model inference<br/>[model_service.py]"]
  node_coupling["Risk coupling and tiers<br/>[risk_engine.py]"]
  node_terrain_layers[("Terrain and risk layers")]
end

subgraph group_weather["Weather intelligence"]
  node_weather_service["Weather intelligence<br/>[weather_service.py]"]
  node_feature_engine["Rain feature engine"]
  node_provider["NWP provider"]
  node_cache["Weather cache<br/>[weather_cache.py]"]
  node_mesh["Station mesh<br/>[weather_mesh.py]"]
  node_sync["Weather synchronization"]
end

node_user(("Analyst"))
node_external_weather["Open-Meteo"]
node_external_user(("Map user"))

node_user -->|"opens"| node_home
node_user -->|"opens"| node_riskmap
node_riskmap -->|"renders"| node_map
node_map -.->|"selects location"| node_inspector
node_inspector -.->|"requests risk data"| node_api_client
node_timeline -.->|"requests forecast"| node_api_client
node_rainpanel -.->|"requests rainfall"| node_api_client
node_sync_hook -->|"polls status"| node_api_client
node_api_client -.->|"HTTP requests"| node_backend
node_backend -->|"registers"| node_risk_routes
node_backend -->|"registers"| node_weather_routes
node_backend -->|"registers"| node_rain_routes
node_backend -->|"registers"| node_spatial_routes
node_backend -->|"loads models"| node_model
node_backend -->|"starts service"| node_sync
node_risk_routes -->|"invokes inference"| node_model
node_risk_routes -->|"calculates risk"| node_coupling
node_risk_routes -->|"requests weather risk"| node_weather_service
node_weather_routes -->|"serves weather"| node_weather_service
node_weather_routes -->|"updates stations"| node_mesh
node_weather_service -->|"fetches forecasts"| node_provider
node_weather_service -->|"reads and writes"| node_cache
node_weather_service -->|"derives features"| node_feature_engine
node_weather_service -->|"predicts trigger"| node_model
node_sync -->|"refreshes data"| node_weather_service
node_sync -->|"checks freshness"| node_cache
node_provider -.->|"retrieves telemetry"| node_external_weather
node_rain_routes -.->|"serves rainfall data"| node_terrain_layers
node_spatial_routes -.->|"serves grid data"| node_terrain_layers

click node_home "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/app/page.tsx"
click node_riskmap "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/app/risk-map/page.tsx"
click node_map "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/map/LeafletMap.tsx"
click node_inspector "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/dashboard/InspectorPanel.tsx"
click node_timeline "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/dashboard/ForecastRiskTimeline.tsx"
click node_rainpanel "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/dashboard/RainfallIntelligencePanel.tsx"
click node_api_client "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/lib/api.ts"
click node_sync_hook "https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/lib/useWeatherSync.ts"
click node_backend "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/main.py"
click node_risk_routes "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/risk.py"
click node_weather_routes "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/weather.py"
click node_rain_routes "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/rainfall.py"
click node_spatial_routes "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/spatial.py"
click node_model "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/model_service.py"
click node_coupling "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/risk_engine.py"
click node_weather_service "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_service.py"
click node_feature_engine "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_feature_engine.py"
click node_provider "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_provider.py"
click node_cache "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_cache.py"
click node_mesh "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_mesh.py"
click node_sync "https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_sync_service.py"
click node_terrain_layers "https://github.com/aruchith08/geoalert-sih-2026/tree/main/backend/app"

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_home,node_riskmap,node_map,node_inspector,node_timeline,node_rainpanel,node_api_client,node_sync_hook,node_external_user toneBlue
class node_backend,node_risk_routes,node_weather_routes,node_rain_routes,node_spatial_routes toneAmber
class node_model,node_coupling,node_terrain_layers toneMint
class node_weather_service,node_feature_engine,node_provider,node_cache,node_mesh,node_sync toneRose
class node_user,node_external_weather toneIndigo
```

## Components

### Web GIS

- [Dashboard](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Risk map](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/app/risk-map/page.tsx): `frontend/app/risk-map/page.tsx`
- [Map canvas](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/map/LeafletMap.tsx): `frontend/components/map/LeafletMap.tsx`
- [Location inspector](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/dashboard/InspectorPanel.tsx): `frontend/components/dashboard/InspectorPanel.tsx`
- [Forecast timeline](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/dashboard/ForecastRiskTimeline.tsx): `frontend/components/dashboard/ForecastRiskTimeline.tsx`
- [Rainfall panel](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/components/dashboard/RainfallIntelligencePanel.tsx): `frontend/components/dashboard/RainfallIntelligencePanel.tsx`
- [API client](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Sync status hook](https://github.com/aruchith08/geoalert-sih-2026/blob/main/frontend/lib/useWeatherSync.ts): `frontend/lib/useWeatherSync.ts`

### API and routes

- [FastAPI application](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/main.py): `backend/app/main.py`
- [Risk endpoints](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/risk.py): `backend/app/routes/risk.py`
- [Weather endpoints](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/weather.py): `backend/app/routes/weather.py`
- [Rainfall endpoints](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/rainfall.py): `backend/app/routes/rainfall.py`
- [Spatial endpoints](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/routes/spatial.py): `backend/app/routes/spatial.py`

### Risk intelligence

- [Dual model inference](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/model_service.py): `backend/app/model_service.py`
- [Risk coupling and tiers](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/risk_engine.py): `backend/app/risk_engine.py`
- [Terrain and risk layers](https://github.com/aruchith08/geoalert-sih-2026/tree/main/backend/app): `backend/app`

### Weather intelligence

- [Weather intelligence](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_service.py): `backend/app/weather_service.py`
- [Rain feature engine](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_feature_engine.py): `backend/app/weather_feature_engine.py`
- [NWP provider](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_provider.py): `backend/app/weather_provider.py`
- [Weather cache](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_cache.py): `backend/app/weather_cache.py`
- [Station mesh](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_mesh.py): `backend/app/weather_mesh.py`
- [Weather synchronization](https://github.com/aruchith08/geoalert-sih-2026/blob/main/backend/app/weather_sync_service.py): `backend/app/weather_sync_service.py`

### Other components

- **Analyst**
- **Open-Meteo**
- **Map user**

## Connections

- Analyst → Dashboard: opens (evidence: `frontend/app/page.tsx`)
- Analyst → Risk map: opens (evidence: `frontend/app/risk-map/page.tsx`)
- Risk map → Map canvas: renders
- Map canvas → Location inspector: selects location
- Location inspector → API client: requests risk data
- Forecast timeline → API client: requests forecast
- Rainfall panel → API client: requests rainfall
- Sync status hook → API client: polls status (evidence: `frontend/lib/useWeatherSync.ts`)
- API client → FastAPI application: HTTP requests
- FastAPI application → Risk endpoints: registers (evidence: `backend/app/main.py`)
- FastAPI application → Weather endpoints: registers (evidence: `backend/app/main.py`)
- FastAPI application → Rainfall endpoints: registers (evidence: `backend/app/main.py`)
- FastAPI application → Spatial endpoints: registers (evidence: `backend/app/main.py`)
- FastAPI application → Dual model inference: loads models (evidence: `backend/app/main.py`)
- FastAPI application → Weather synchronization: starts service (evidence: `backend/app/main.py`)
- Risk endpoints → Dual model inference: invokes inference (evidence: `backend/app/routes/risk.py`)
- Risk endpoints → Risk coupling and tiers: calculates risk (evidence: `backend/app/routes/risk.py`)
- Risk endpoints → Weather intelligence: requests weather risk (evidence: `backend/app/routes/risk.py`)
- Weather endpoints → Weather intelligence: serves weather (evidence: `backend/app/routes/weather.py`)
- Weather endpoints → Station mesh: updates stations (evidence: `backend/app/routes/weather.py`)
- Weather intelligence → NWP provider: fetches forecasts (evidence: `backend/app/weather_service.py`)
- Weather intelligence → Weather cache: reads and writes (evidence: `backend/app/weather_service.py`)
- Weather intelligence → Rain feature engine: derives features (evidence: `backend/app/weather_service.py`)
- Weather intelligence → Dual model inference: predicts trigger (evidence: `backend/app/weather_service.py`)
- Weather synchronization → Weather intelligence: refreshes data (evidence: `backend/app/weather_sync_service.py`)
- Weather synchronization → Weather cache: checks freshness (evidence: `backend/app/weather_sync_service.py`)
- NWP provider → Open-Meteo: retrieves telemetry
- Rainfall endpoints → Terrain and risk layers: serves rainfall data (evidence: `backend/app/routes/rainfall.py`)
- Spatial endpoints → Terrain and risk layers: serves grid data (evidence: `backend/app/routes/spatial.py`)
