# eddulapreethi/disaster-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/eddulapreethi/disaster-management-system
- Repository: https://github.com/eddulapreethi/disaster-management-system

## Overview

DisasterGuard AI is a disaster-risk prediction and emergency decision-support platform. Users enter through the web application, which exposes prediction, map, simulation, recommendation, resource, and alert workflows backed by a FastAPI service. The documented domain flow runs from multi-source data collection and preprocessing through prediction and risk assessment, then branches into explanations, GIS visualization, and simulation before supporting recommendations, resource allocation, and alerts. The README documents the broad workflow; unsampled modules are represented at their exact tree paths, and their internal call relationships are not inferred.

Main entry points: [`ml/prediction/risk_assessment.py`](https://github.com/eddulapreethi/disaster-management-system/blob/main/ml/prediction/risk_assessment.py) (Risk assessment), [`backend/app/main.py`](https://github.com/eddulapreethi/disaster-management-system/blob/main/backend/app/main.py) (FastAPI application), [`ai-assistant/recommendation_engine.py`](https://github.com/eddulapreethi/disaster-management-system/blob/main/ai-assistant/recommendation_engine.py) (Recommendations), [`backend/app/services`](https://github.com/eddulapreethi/disaster-management-system/tree/main/backend/app/services) (Backend services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Web application<br/>[App.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_data["Data and prediction"]
  node_collection["Data collection"]
  node_preprocess["Preprocessing"]
  node_prediction["Risk prediction<br/>[predict.py]"]
  node_assessment["Risk assessment<br/>[risk_assessment.py]"]
end

subgraph group_analysis["Risk analysis"]
  node_explain["SHAP explanation<br/>[shap_analysis.py]"]
  node_gis["GIS visualization<br/>[gis_processing.py]"]
  node_simulation["Scenario simulation"]
end

subgraph group_response["Emergency response"]
  node_recommend["Recommendations"]
  node_resource["Resource optimization"]
  node_alerts["Alert generation<br/>[alert_generator.py]"]
  node_notifications["Notifications"]
end

subgraph group_platform["API and persistence"]
  node_server["FastAPI application<br/>[main.py]"]
  node_routers["API routers"]
  node_services["Backend services"]
  node_database[("Database<br/>[database.py]")]
end

node_users(("Users"))

node_users -->|"uses"| node_web
node_web -->|"checks backend"| node_api_client
node_server -->|"registers"| node_routers
node_server -->|"creates tables"| node_database
node_server -->|"starts collectors"| node_services
node_collection -->|"stores observations"| node_database
node_collection -.->|"provides source data"| node_preprocess
node_preprocess -->|"engineers features"| node_prediction
node_prediction -.->|"assesses risk"| node_assessment
node_assessment -.->|"explains estimate"| node_explain
node_assessment -.->|"visualizes risk"| node_gis
node_assessment -.->|"informs scenarios"| node_simulation
node_simulation -->|"informs guidance"| node_recommend
node_assessment -.->|"guides response"| node_recommend
node_recommend -.->|"supports allocation"| node_resource
node_assessment -.->|"triggers alerts"| node_alerts
node_alerts -->|"dispatches"| node_notifications
node_routers -.->|"routes requests"| node_services
node_services -.->|"reads and writes"| node_database

click node_web "https://github.com/eddulapreethi/disaster-management-system/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/eddulapreethi/disaster-management-system/blob/main/frontend/src/services/api.js"
click node_collection "https://github.com/eddulapreethi/disaster-management-system/tree/main/backend/app/services"
click node_preprocess "https://github.com/eddulapreethi/disaster-management-system/tree/main/ml/preprocessing"
click node_prediction "https://github.com/eddulapreethi/disaster-management-system/blob/main/ml/prediction/predict.py"
click node_assessment "https://github.com/eddulapreethi/disaster-management-system/blob/main/ml/prediction/risk_assessment.py"
click node_explain "https://github.com/eddulapreethi/disaster-management-system/blob/main/explainable-ai/shap_analysis.py"
click node_gis "https://github.com/eddulapreethi/disaster-management-system/blob/main/gis/gis_processing.py"
click node_simulation "https://github.com/eddulapreethi/disaster-management-system/blob/main/digital-twin/simulation/simulation_engine.py"
click node_recommend "https://github.com/eddulapreethi/disaster-management-system/blob/main/ai-assistant/recommendation_engine.py"
click node_resource "https://github.com/eddulapreethi/disaster-management-system/blob/main/resource-optimization/resource_allocation.py"
click node_alerts "https://github.com/eddulapreethi/disaster-management-system/blob/main/alerts/alert_generator.py"
click node_notifications "https://github.com/eddulapreethi/disaster-management-system/blob/main/alerts/notification_service.py"
click node_server "https://github.com/eddulapreethi/disaster-management-system/blob/main/backend/app/main.py"
click node_routers "https://github.com/eddulapreethi/disaster-management-system/tree/main/backend/app/api"
click node_services "https://github.com/eddulapreethi/disaster-management-system/tree/main/backend/app/services"
click node_database "https://github.com/eddulapreethi/disaster-management-system/blob/main/backend/app/database/database.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_web,node_api_client,node_users toneBlue
class node_collection,node_preprocess,node_prediction,node_assessment toneAmber
class node_explain,node_gis,node_simulation toneMint
class node_recommend,node_resource,node_alerts,node_notifications toneRose
class node_server,node_routers,node_services,node_database toneIndigo
```

## Components

### User experience

- [Web application](https://github.com/eddulapreethi/disaster-management-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/eddulapreethi/disaster-management-system/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Data and prediction

- [Data collection](https://github.com/eddulapreethi/disaster-management-system/tree/main/backend/app/services): `backend/app/services`
- [Preprocessing](https://github.com/eddulapreethi/disaster-management-system/tree/main/ml/preprocessing): `ml/preprocessing`
- [Risk prediction](https://github.com/eddulapreethi/disaster-management-system/blob/main/ml/prediction/predict.py): `ml/prediction/predict.py`
- [Risk assessment](https://github.com/eddulapreethi/disaster-management-system/blob/main/ml/prediction/risk_assessment.py): `ml/prediction/risk_assessment.py`

### Risk analysis

- [SHAP explanation](https://github.com/eddulapreethi/disaster-management-system/blob/main/explainable-ai/shap_analysis.py): `explainable-ai/shap_analysis.py`
- [GIS visualization](https://github.com/eddulapreethi/disaster-management-system/blob/main/gis/gis_processing.py): `gis/gis_processing.py`
- [Scenario simulation](https://github.com/eddulapreethi/disaster-management-system/blob/main/digital-twin/simulation/simulation_engine.py): `digital-twin/simulation/simulation_engine.py`

### Emergency response

- [Recommendations](https://github.com/eddulapreethi/disaster-management-system/blob/main/ai-assistant/recommendation_engine.py): `ai-assistant/recommendation_engine.py`
- [Resource optimization](https://github.com/eddulapreethi/disaster-management-system/blob/main/resource-optimization/resource_allocation.py): `resource-optimization/resource_allocation.py`
- [Alert generation](https://github.com/eddulapreethi/disaster-management-system/blob/main/alerts/alert_generator.py): `alerts/alert_generator.py`
- [Notifications](https://github.com/eddulapreethi/disaster-management-system/blob/main/alerts/notification_service.py): `alerts/notification_service.py`

### API and persistence

- [FastAPI application](https://github.com/eddulapreethi/disaster-management-system/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routers](https://github.com/eddulapreethi/disaster-management-system/tree/main/backend/app/api): `backend/app/api`
- [Backend services](https://github.com/eddulapreethi/disaster-management-system/tree/main/backend/app/services): `backend/app/services`
- [Database](https://github.com/eddulapreethi/disaster-management-system/blob/main/backend/app/database/database.py): `backend/app/database/database.py`

### Other components

- **Users**

## Connections

- Users → Web application: uses (evidence: `frontend/src/App.jsx`)
- Web application → API client: checks backend (evidence: `frontend/src/App.jsx`)
- FastAPI application → API routers: registers (evidence: `backend/app/main.py`)
- FastAPI application → Database: creates tables (evidence: `backend/app/main.py`)
- FastAPI application → Backend services: starts collectors (evidence: `backend/app/main.py`)
- Data collection → Database: stores observations (evidence: `backend/app/services/hydrology_service.py`)
- Data collection → Preprocessing: provides source data (evidence: `README.md`)
- Preprocessing → Risk prediction: engineers features (evidence: `ml/preprocessing/feature_engineering.py`)
- Risk prediction → Risk assessment: assesses risk (evidence: `README.md`)
- Risk assessment → SHAP explanation: explains estimate (evidence: `README.md`)
- Risk assessment → GIS visualization: visualizes risk (evidence: `README.md`)
- Risk assessment → Scenario simulation: informs scenarios (evidence: `README.md`)
- Scenario simulation → Recommendations: informs guidance (evidence: `ai-assistant/recommendation_engine.py`)
- Risk assessment → Recommendations: guides response (evidence: `README.md`)
- Recommendations → Resource optimization: supports allocation (evidence: `README.md`)
- Risk assessment → Alert generation: triggers alerts (evidence: `README.md`)
- Alert generation → Notifications: dispatches (evidence: `alerts/notification_service.py`)
- API routers → Backend services: routes requests
- Backend services → Database: reads and writes (evidence: `backend/app/services/hydrology_service.py`)
