# officialarghya29/geoshield architecture

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

- Interactive diagram: https://gitdiagram.com/officialarghya29/geoshield
- Repository: https://github.com/officialarghya29/geoshield

## Overview

GeoShield is a landslide-risk monitoring and early-warning platform for Northeast India. Users view station and risk information, inspect alerts and reports, and use mapping, satellite, and simulation features through the web/mobile interface; the frontend API client communicates with a FastAPI backend. Backend routes provide sensor, prediction, alert, reporting, weather, flood, satellite, and dashboard capabilities, with prediction models and persistent data supporting risk assessment. README capabilities are included even where implementation excerpts were unavailable; those branches are linked only where documentation or the source index supports the relationship.

Main entry points: [`backend/app/main.py`](https://github.com/officialarghya29/geoshield/blob/main/backend/app/main.py) (FastAPI Server), [`frontend/src/App.tsx`](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/App.tsx) (GeoShield UI), [`backend/app/routers/simulator.py`](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/simulator.py) (Simulation Routes), [`frontend/src/pages/Dashboard.tsx`](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Dashboard.tsx) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Interfaces"]
  node_webapp["GeoShield UI<br/>[App.tsx]"]
  node_dashboard_ui["Dashboard<br/>[Dashboard.tsx]"]
  node_alerts_ui["Alerts View<br/>[Alerts.tsx]"]
  node_map_ui["Risk Map<br/>[RiskMap.tsx]"]
  node_stations_ui["Station Views<br/>[Stations.tsx]"]
  node_reports_ui["Citizen Reports<br/>[Reports.tsx]"]
  node_satellite_ui["Satellite View<br/>[SatelliteData.tsx]"]
  node_simulator_ui["Simulator View<br/>[Simulator.tsx]"]
  node_translations["Translations<br/>[translations.ts]"]
  node_api_client["API Client<br/>[api.ts]"]
end

subgraph group_api["Backend API"]
  node_api_server["FastAPI Server<br/>[main.py]"]
  node_sensor_routes["Sensor Routes<br/>[sensors.py]"]
  node_dashboard_routes["Dashboard Routes<br/>[dashboard.py]"]
  node_alert_routes["Alert Routes<br/>[alerts.py]"]
  node_report_routes["Report Routes<br/>[reports.py]"]
  node_predict_routes["Prediction Routes<br/>[predict.py]"]
  node_flood_routes["Flood Routes<br/>[flood.py]"]
  node_satellite_routes["Satellite Routes<br/>[satellite.py]"]
  node_simulator_routes["Simulation Routes<br/>[simulator.py]"]
  node_weather_routes["Weather Routes<br/>[weather.py]"]
  node_timeline_routes["Alert Timeline<br/>[alerts_timeline.py]"]
  node_ml_routes["Enhanced ML Routes<br/>[ml_enhanced.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_realtime["Alert WebSocket<br/>[main.py]"]
end

subgraph group_risk["Risk and Data"]
  node_models["Domain Models<br/>[models.py]"]
  node_database[("Database<br/>[database.py]")]
  node_risk_model["Risk Predictor<br/>[risk_predictor.py]"]
  node_enhanced_model["Enhanced Predictor"]
  node_terrain["Terrain Lookup<br/>[terrain_lookup.py]"]
  node_risk_history["Risk History Seed"]
end

subgraph group_delivery["Platform Integrations"]
  node_desktop["Electron Desktop<br/>[main.js]"]
end

node_user(("Operator"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"shows"| node_dashboard_ui
node_dashboard_ui -->|"requests data"| node_api_client
node_dashboard_ui -->|"uses labels"| node_translations
node_api_client -->|"reads language"| node_translations
node_webapp -.->|"offers alerts"| node_alerts_ui
node_webapp -.->|"offers mapping"| node_map_ui
node_webapp -.->|"offers monitoring"| node_stations_ui
node_webapp -.->|"offers reporting"| node_reports_ui
node_webapp -.->|"offers imagery"| node_satellite_ui
node_webapp -.->|"offers simulation"| node_simulator_ui
node_api_client -.->|"calls REST"| node_api_server
node_api_server -->|"registers routes"| node_sensor_routes
node_api_server -->|"registers routes"| node_dashboard_routes
node_api_server -->|"registers routes"| node_alert_routes
node_api_server -->|"registers routes"| node_report_routes
node_api_server -->|"registers routes"| node_predict_routes
node_api_server -->|"registers routes"| node_flood_routes
node_api_server -->|"registers routes"| node_satellite_routes
node_api_server -->|"registers routes"| node_simulator_routes
node_api_server -->|"registers routes"| node_weather_routes
node_api_server -->|"registers routes"| node_timeline_routes
node_api_server -->|"registers routes"| node_ml_routes
node_api_server -->|"initializes"| node_database
node_api_server -->|"uses authentication"| node_auth
node_simulator_routes -->|"queries and commits"| node_database
node_simulator_routes -->|"creates records"| node_models
node_simulator_routes -->|"gets predictor"| node_risk_model
node_simulator_routes -->|"may use predictor"| node_enhanced_model
node_simulator_routes -->|"checks roles"| node_auth
node_enhanced_model -->|"uses terrain data"| node_terrain
node_risk_history -.->|"seeds history"| node_database
node_api_server -->|"serves sockets"| node_realtime
node_desktop -->|"starts backend"| node_api_server
node_desktop -->|"loads interface"| node_webapp

click node_webapp "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/App.tsx"
click node_dashboard_ui "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Dashboard.tsx"
click node_alerts_ui "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Alerts.tsx"
click node_map_ui "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/RiskMap.tsx"
click node_stations_ui "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Stations.tsx"
click node_reports_ui "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Reports.tsx"
click node_satellite_ui "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/SatelliteData.tsx"
click node_simulator_ui "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Simulator.tsx"
click node_translations "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/i18n/translations.ts"
click node_api_client "https://github.com/officialarghya29/geoshield/blob/main/frontend/src/services/api.ts"
click node_api_server "https://github.com/officialarghya29/geoshield/blob/main/backend/app/main.py"
click node_sensor_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/sensors.py"
click node_dashboard_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/dashboard.py"
click node_alert_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/alerts.py"
click node_report_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/reports.py"
click node_predict_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/predict.py"
click node_flood_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/flood.py"
click node_satellite_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/satellite.py"
click node_simulator_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/simulator.py"
click node_weather_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/weather.py"
click node_timeline_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/alerts_timeline.py"
click node_ml_routes "https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/ml_enhanced.py"
click node_auth "https://github.com/officialarghya29/geoshield/blob/main/backend/app/auth.py"
click node_models "https://github.com/officialarghya29/geoshield/blob/main/backend/app/models.py"
click node_database "https://github.com/officialarghya29/geoshield/blob/main/backend/app/database.py"
click node_risk_model "https://github.com/officialarghya29/geoshield/blob/main/backend/app/ai_engine/risk_predictor.py"
click node_enhanced_model "https://github.com/officialarghya29/geoshield/blob/main/backend/app/ai_engine/enhanced_predictor.py"
click node_terrain "https://github.com/officialarghya29/geoshield/blob/main/backend/app/ai_engine/terrain_lookup.py"
click node_risk_history "https://github.com/officialarghya29/geoshield/blob/main/backend/app/seed_risk_history.py"
click node_desktop "https://github.com/officialarghya29/geoshield/blob/main/electron/main.js"
click node_realtime "https://github.com/officialarghya29/geoshield/blob/main/backend/app/main.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_webapp,node_dashboard_ui,node_alerts_ui,node_map_ui,node_stations_ui,node_reports_ui,node_satellite_ui,node_simulator_ui,node_translations,node_api_client toneBlue
class node_api_server,node_sensor_routes,node_dashboard_routes,node_alert_routes,node_report_routes,node_predict_routes,node_flood_routes,node_satellite_routes,node_simulator_routes,node_weather_routes,node_timeline_routes,node_ml_routes,node_auth,node_realtime toneAmber
class node_models,node_database,node_risk_model,node_enhanced_model,node_terrain,node_risk_history toneMint
class node_desktop toneRose
class node_user toneIndigo
```

## Components

### User Interfaces

- [GeoShield UI](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Alerts View](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Alerts.tsx): `frontend/src/pages/Alerts.tsx`
- [Risk Map](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/RiskMap.tsx): `frontend/src/pages/RiskMap.tsx`
- [Station Views](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Stations.tsx): `frontend/src/pages/Stations.tsx`
- [Citizen Reports](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Reports.tsx): `frontend/src/pages/Reports.tsx`
- [Satellite View](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/SatelliteData.tsx): `frontend/src/pages/SatelliteData.tsx`
- [Simulator View](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/pages/Simulator.tsx): `frontend/src/pages/Simulator.tsx`
- [Translations](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/i18n/translations.ts): `frontend/src/i18n/translations.ts`
- [API Client](https://github.com/officialarghya29/geoshield/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Backend API

- [FastAPI Server](https://github.com/officialarghya29/geoshield/blob/main/backend/app/main.py): `backend/app/main.py`
- [Sensor Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/sensors.py): `backend/app/routers/sensors.py`
- [Dashboard Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/dashboard.py): `backend/app/routers/dashboard.py`
- [Alert Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/alerts.py): `backend/app/routers/alerts.py`
- [Report Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/reports.py): `backend/app/routers/reports.py`
- [Prediction Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/predict.py): `backend/app/routers/predict.py`
- [Flood Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/flood.py): `backend/app/routers/flood.py`
- [Satellite Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/satellite.py): `backend/app/routers/satellite.py`
- [Simulation Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/simulator.py): `backend/app/routers/simulator.py`
- [Weather Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/weather.py): `backend/app/routers/weather.py`
- [Alert Timeline](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/alerts_timeline.py): `backend/app/routers/alerts_timeline.py`
- [Enhanced ML Routes](https://github.com/officialarghya29/geoshield/blob/main/backend/app/routers/ml_enhanced.py): `backend/app/routers/ml_enhanced.py`
- [Authentication](https://github.com/officialarghya29/geoshield/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Alert WebSocket](https://github.com/officialarghya29/geoshield/blob/main/backend/app/main.py): `backend/app/main.py`

### Risk and Data

- [Domain Models](https://github.com/officialarghya29/geoshield/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database](https://github.com/officialarghya29/geoshield/blob/main/backend/app/database.py): `backend/app/database.py`
- [Risk Predictor](https://github.com/officialarghya29/geoshield/blob/main/backend/app/ai_engine/risk_predictor.py): `backend/app/ai_engine/risk_predictor.py`
- [Enhanced Predictor](https://github.com/officialarghya29/geoshield/blob/main/backend/app/ai_engine/enhanced_predictor.py): `backend/app/ai_engine/enhanced_predictor.py`
- [Terrain Lookup](https://github.com/officialarghya29/geoshield/blob/main/backend/app/ai_engine/terrain_lookup.py): `backend/app/ai_engine/terrain_lookup.py`
- [Risk History Seed](https://github.com/officialarghya29/geoshield/blob/main/backend/app/seed_risk_history.py): `backend/app/seed_risk_history.py`

### Platform Integrations

- [Electron Desktop](https://github.com/officialarghya29/geoshield/blob/main/electron/main.js): `electron/main.js`

### Other components

- **Operator**

## Connections

- Operator → GeoShield UI: uses
- GeoShield UI → Dashboard: shows (evidence: `frontend/src/pages/Dashboard.tsx`)
- Dashboard → API Client: requests data (evidence: `frontend/src/pages/Dashboard.tsx`)
- Dashboard → Translations: uses labels (evidence: `frontend/src/pages/Dashboard.tsx`)
- API Client → Translations: reads language (evidence: `frontend/src/services/api.ts`)
- GeoShield UI → Alerts View: offers alerts
- GeoShield UI → Risk Map: offers mapping
- GeoShield UI → Station Views: offers monitoring
- GeoShield UI → Citizen Reports: offers reporting
- GeoShield UI → Satellite View: offers imagery
- GeoShield UI → Simulator View: offers simulation
- API Client → FastAPI Server: calls REST
- FastAPI Server → Sensor Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Dashboard Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Alert Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Report Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Prediction Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Flood Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Satellite Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Simulation Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Weather Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Alert Timeline: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Enhanced ML Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Server → Database: initializes (evidence: `backend/app/main.py`)
- FastAPI Server → Authentication: uses authentication (evidence: `backend/app/main.py`)
- Simulation Routes → Database: queries and commits (evidence: `backend/app/routers/simulator.py`)
- Simulation Routes → Domain Models: creates records (evidence: `backend/app/routers/simulator.py`)
- Simulation Routes → Risk Predictor: gets predictor (evidence: `backend/app/routers/simulator.py`)
- Simulation Routes → Enhanced Predictor: may use predictor (evidence: `backend/app/routers/simulator.py`)
- Simulation Routes → Authentication: checks roles (evidence: `backend/app/routers/simulator.py`)
- Enhanced Predictor → Terrain Lookup: uses terrain data (evidence: `backend/app/ai_engine/enhanced_predictor.py`)
- Risk History Seed → Database: seeds history
- FastAPI Server → Alert WebSocket: serves sockets (evidence: `backend/app/main.py`)
- Electron Desktop → FastAPI Server: starts backend (evidence: `electron/main.js`)
- Electron Desktop → GeoShield UI: loads interface (evidence: `electron/main.js`)
