# rishiofficial432-432/rakshasetu architecture

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

## Overview

RakshaSetu is a disaster-monitoring and emergency-response platform: sensor-derived anomaly analysis, live weather/news, and operational data are exposed through role-specific dashboards. The runtime API is the main user-to-result path; a separate research pipeline prepares sensor data, trains and evaluates EDAD against a statistical baseline. The README documents dashboard capabilities and external integrations; source excerpts establish selected backend and research calls. Some API routing and frontend wiring are not excerpted, so those links are documented at the product level rather than inferred from imports.

Main entry points: [`Rakshasetu-main/rakshasetu-research/run_all.py`](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/run_all.py) (Research pipeline runner), [`Rakshasetu-main/index.html`](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/index.html) (Panel hub), [`Rakshasetu-main/rakshasetu-research/src/evaluate.py`](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/evaluate.py) (Model evaluation), [`frontend/integration.js`](https://github.com/rishiofficial432-432/rakshasetu/blob/main/frontend/integration.js) (Dashboard integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Role Dashboards"]
  node_hub["Panel hub<br/>[index.html]"]
  node_government["Government dashboard<br/>[government.html]"]
  node_citizen["Citizen portal<br/>[citizen.html]"]
  node_responder["Responder operations<br/>[responder.html]"]
  node_admin["Admin dashboard<br/>[admin.html]"]
  node_integration["Dashboard integration<br/>[integration.js]"]
  node_client["API client<br/>[api-client.js]"]
end

subgraph group_api["API and Live Data"]
  node_apiapp["FastAPI routes<br/>[app.py]"]
  node_weather["Weather and news"]
  node_aurora["Aurora forecasts<br/>[aurora_service.py]"]
end

subgraph group_ml["Anomaly Research"]
  node_edad["EDAD model<br/>[edad_model.py]"]
  node_baseline["Z-score baseline<br/>[zscore_baseline.py]"]
  node_training["EDAD training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
  node_report["Comparison report<br/>[generate_report.py]"]
  node_runner["Research pipeline runner<br/>[run_all.py]"]
end

subgraph group_data["Research Data"]
  node_loader["Dataset inspection<br/>[data_loader.py]"]
  node_preprocess["Preprocessing and splits<br/>[preprocessing.py]"]
  node_windows["Window engineering"]
  node_sensorfiles[("Sensor datasets")]
end

node_users(("Government, citizens, responders"))
node_externalweather(("OpenWeatherMap"))
node_externalnews(("NewsAPI"))

node_users -->|"selects panel"| node_hub
node_hub -->|"opens"| node_government
node_hub -->|"opens"| node_citizen
node_hub -->|"opens"| node_responder
node_hub -->|"opens"| node_admin
node_government -->|"uses live data"| node_integration
node_citizen -->|"uses live data"| node_integration
node_responder -->|"uses live data"| node_integration
node_admin -->|"uses live data"| node_integration
node_integration -->|"requests data"| node_client
node_client -->|"calls endpoints"| node_apiapp
node_apiapp -->|"fetches live data"| node_weather
node_apiapp -->|"uses forecasts"| node_aurora
node_weather -->|"queries"| node_externalweather
node_weather -->|"queries"| node_externalnews
node_apiapp -->|"runs anomaly analysis"| node_edad
node_sensorfiles -.->|"supplies raw data"| node_loader
node_runner -->|"inspects"| node_loader
node_runner -->|"preprocesses"| node_preprocess
node_runner -->|"fits baseline"| node_baseline
node_runner -->|"trains model"| node_training
node_runner -->|"evaluates"| node_evaluation
node_runner -->|"generates report"| node_report
node_preprocess -.->|"writes splits"| node_sensorfiles
node_training -->|"creates windows"| node_windows
node_training -->|"trains"| node_edad
node_evaluation -->|"scores windows"| node_windows
node_evaluation -->|"compares scores"| node_baseline
node_evaluation -->|"scores windows"| node_edad
node_report -.->|"summarizes results"| node_evaluation

click node_hub "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/index.html"
click node_government "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/government.html"
click node_citizen "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/citizen.html"
click node_responder "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/responder.html"
click node_admin "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/admin.html"
click node_integration "https://github.com/rishiofficial432-432/rakshasetu/blob/main/frontend/integration.js"
click node_client "https://github.com/rishiofficial432-432/rakshasetu/blob/main/frontend/api-client.js"
click node_apiapp "https://github.com/rishiofficial432-432/rakshasetu/blob/main/backend/app.py"
click node_weather "https://github.com/rishiofficial432-432/rakshasetu/blob/main/backend/live_data_service.py"
click node_aurora "https://github.com/rishiofficial432-432/rakshasetu/blob/main/backend/aurora_service.py"
click node_edad "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/edad_model.py"
click node_baseline "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/zscore_baseline.py"
click node_training "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/train.py"
click node_evaluation "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/evaluate.py"
click node_report "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/generate_report.py"
click node_runner "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/run_all.py"
click node_loader "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/data_loader.py"
click node_preprocess "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/preprocessing.py"
click node_windows "https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/feature_engineering.py"
click node_sensorfiles "https://github.com/rishiofficial432-432/rakshasetu/tree/main/Rakshasetu-main/rakshasetu-research/data"

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_hub,node_government,node_citizen,node_responder,node_admin,node_integration,node_client toneBlue
class node_apiapp,node_weather,node_aurora toneAmber
class node_edad,node_baseline,node_training,node_evaluation,node_report,node_runner,node_externalnews toneMint
class node_loader,node_preprocess,node_windows,node_sensorfiles toneRose
class node_users,node_externalweather toneIndigo
```

## Components

### Role Dashboards

- [Panel hub](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/index.html): `Rakshasetu-main/index.html`
- [Government dashboard](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/government.html): `Rakshasetu-main/government.html`
- [Citizen portal](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/citizen.html): `Rakshasetu-main/citizen.html`
- [Responder operations](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/responder.html): `Rakshasetu-main/responder.html`
- [Admin dashboard](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/admin.html): `Rakshasetu-main/admin.html`
- [Dashboard integration](https://github.com/rishiofficial432-432/rakshasetu/blob/main/frontend/integration.js): `frontend/integration.js`
- [API client](https://github.com/rishiofficial432-432/rakshasetu/blob/main/frontend/api-client.js): `frontend/api-client.js`

### API and Live Data

- [FastAPI routes](https://github.com/rishiofficial432-432/rakshasetu/blob/main/backend/app.py): `backend/app.py`
- [Weather and news](https://github.com/rishiofficial432-432/rakshasetu/blob/main/backend/live_data_service.py): `backend/live_data_service.py`
- [Aurora forecasts](https://github.com/rishiofficial432-432/rakshasetu/blob/main/backend/aurora_service.py): `backend/aurora_service.py`

### Anomaly Research

- [EDAD model](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/edad_model.py): `Rakshasetu-main/rakshasetu-research/src/edad_model.py`
- [Z-score baseline](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/zscore_baseline.py): `Rakshasetu-main/rakshasetu-research/src/zscore_baseline.py`
- [EDAD training](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/train.py): `Rakshasetu-main/rakshasetu-research/src/train.py`
- [Model evaluation](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/evaluate.py): `Rakshasetu-main/rakshasetu-research/src/evaluate.py`
- [Comparison report](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/generate_report.py): `Rakshasetu-main/rakshasetu-research/src/generate_report.py`
- [Research pipeline runner](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/run_all.py): `Rakshasetu-main/rakshasetu-research/run_all.py`

### Research Data

- [Dataset inspection](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/data_loader.py): `Rakshasetu-main/rakshasetu-research/src/data_loader.py`
- [Preprocessing and splits](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/preprocessing.py): `Rakshasetu-main/rakshasetu-research/src/preprocessing.py`
- [Window engineering](https://github.com/rishiofficial432-432/rakshasetu/blob/main/Rakshasetu-main/rakshasetu-research/src/feature_engineering.py): `Rakshasetu-main/rakshasetu-research/src/feature_engineering.py`
- [Sensor datasets](https://github.com/rishiofficial432-432/rakshasetu/tree/main/Rakshasetu-main/rakshasetu-research/data): `Rakshasetu-main/rakshasetu-research/data`

### Other components

- **Government, citizens, responders**
- **OpenWeatherMap**
- **NewsAPI**

## Connections

- Government, citizens, responders → Panel hub: selects panel (evidence: `README.md`)
- Panel hub → Government dashboard: opens (evidence: `README.md`)
- Panel hub → Citizen portal: opens (evidence: `README.md`)
- Panel hub → Responder operations: opens (evidence: `README.md`)
- Panel hub → Admin dashboard: opens (evidence: `README.md`)
- Government dashboard → Dashboard integration: uses live data (evidence: `README.md`)
- Citizen portal → Dashboard integration: uses live data (evidence: `README.md`)
- Responder operations → Dashboard integration: uses live data (evidence: `README.md`)
- Admin dashboard → Dashboard integration: uses live data (evidence: `README.md`)
- Dashboard integration → API client: requests data (evidence: `README.md`)
- API client → FastAPI routes: calls endpoints (evidence: `README.md`)
- FastAPI routes → Weather and news: fetches live data (evidence: `backend/app.py`)
- FastAPI routes → Aurora forecasts: uses forecasts (evidence: `backend/app.py`)
- Weather and news → OpenWeatherMap: queries (evidence: `README.md`)
- Weather and news → NewsAPI: queries (evidence: `README.md`)
- FastAPI routes → EDAD model: runs anomaly analysis (evidence: `backend/app.py`)
- Sensor datasets → Dataset inspection: supplies raw data
- Research pipeline runner → Dataset inspection: inspects (evidence: `Rakshasetu-main/rakshasetu-research/run_all.py`)
- Research pipeline runner → Preprocessing and splits: preprocesses (evidence: `Rakshasetu-main/rakshasetu-research/run_all.py`)
- Research pipeline runner → Z-score baseline: fits baseline (evidence: `Rakshasetu-main/rakshasetu-research/run_all.py`)
- Research pipeline runner → EDAD training: trains model (evidence: `Rakshasetu-main/rakshasetu-research/run_all.py`)
- Research pipeline runner → Model evaluation: evaluates (evidence: `Rakshasetu-main/rakshasetu-research/run_all.py`)
- Research pipeline runner → Comparison report: generates report (evidence: `Rakshasetu-main/rakshasetu-research/run_all.py`)
- Preprocessing and splits → Sensor datasets: writes splits
- EDAD training → Window engineering: creates windows (evidence: `Rakshasetu-main/rakshasetu-research/src/train.py`)
- EDAD training → EDAD model: trains (evidence: `Rakshasetu-main/rakshasetu-research/src/train.py`)
- Model evaluation → Window engineering: scores windows (evidence: `Rakshasetu-main/rakshasetu-research/src/evaluate.py`)
- Model evaluation → Z-score baseline: compares scores (evidence: `Rakshasetu-main/rakshasetu-research/src/evaluate.py`)
- Model evaluation → EDAD model: scores windows (evidence: `Rakshasetu-main/rakshasetu-research/src/evaluate.py`)
- Comparison report → Model evaluation: summarizes results
