# pariwankhede26/vayu architecture

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

- Interactive diagram: https://gitdiagram.com/pariwankhede26/vayu
- Repository: https://github.com/pariwankhede26/vayu

## Overview

VAYU is a prototype that turns citizen-submitted images and optional location into environmental decision-support information. The main flow is Report UI → Express API → Gemini image analysis (or labeled fallback) → risk scoring, with optional weather context and spread prediction; separate map and dashboard views present simulated hotspot data. Production uses AI-BACKEND/server.js as the API and serves the frontend. The README documents these API workflows; unsampled route details are represented only where that documentation supports them. No database or official environmental-data integration is present.

Main entry points: [`AI-BACKEND/server.js`](https://github.com/pariwankhede26/vayu/blob/main/AI-BACKEND/server.js) (Express API), [`FRONTEND/src/pages/Report.jsx`](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/Report.jsx) (Report submission), [`FRONTEND/src/App.jsx`](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/App.jsx) (React routes), [`FRONTEND/src/pages/MapView.jsx`](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/MapView.jsx) (Hotspot map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["React routes<br/>[App.jsx]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_report["Report submission<br/>[Report.jsx]"]
  node_map["Hotspot map<br/>[MapView.jsx]"]
  node_dashboard["Command dashboard<br/>[Dashboard.jsx]"]
end

subgraph group_api["Production API"]
  node_server["Express API<br/>[server.js]"]
  node_weather["Prototype weather<br/>[server.js]"]
  node_prediction["Wind spread prediction<br/>[server.js]"]
end

subgraph group_intelligence["Environmental intelligence"]
  node_risk["VAYU risk engine<br/>[riskEngine.js]"]
  node_events["Prototype hotspot records"]
  node_country["Country categories<br/>[countryConfig.js]"]
end

node_citizen(("Citizen"))
node_gemini["Gemini Vision"]

node_citizen -->|"submits evidence"| node_report
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_report
node_app -->|"routes to"| node_map
node_app -->|"routes to"| node_dashboard
node_report -->|"posts analysis"| node_server
node_server -->|"analyzes image"| node_gemini
node_server -->|"calculates risk"| node_risk
node_report -->|"requests risk score"| node_server
node_report -->|"requests prediction"| node_server
node_report -->|"requests weather"| node_server
node_map -->|"loads hotspots"| node_server
node_map -->|"loads weather"| node_server
node_map -->|"requests prediction"| node_server
node_dashboard -->|"loads hotspots"| node_server
node_dashboard -->|"loads weather"| node_server
node_landing -->|"loads hotspots"| node_server
node_landing -->|"loads country settings"| node_server
node_server -->|"reads records"| node_events
node_server -->|"serves context"| node_weather
node_server -->|"estimates spread"| node_prediction
node_server -->|"serves categories"| node_country
node_server -->|"scores hotspots"| node_risk

click node_app "https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/App.jsx"
click node_landing "https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/Landing.jsx"
click node_report "https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/Report.jsx"
click node_map "https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/MapView.jsx"
click node_dashboard "https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/Dashboard.jsx"
click node_server "https://github.com/pariwankhede26/vayu/blob/main/AI-BACKEND/server.js"
click node_risk "https://github.com/pariwankhede26/vayu/blob/main/INTELLIGENCE-BACKEND/helpers/riskEngine.js"
click node_events "https://github.com/pariwankhede26/vayu/blob/main/INTELLIGENCE-BACKEND/data/pollution_events.json"
click node_weather "https://github.com/pariwankhede26/vayu/blob/main/AI-BACKEND/server.js"
click node_prediction "https://github.com/pariwankhede26/vayu/blob/main/AI-BACKEND/server.js"
click node_country "https://github.com/pariwankhede26/vayu/blob/main/INTELLIGENCE-BACKEND/config/countryConfig.js"

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_app,node_landing,node_report,node_map,node_dashboard toneBlue
class node_server,node_weather,node_prediction toneAmber
class node_risk,node_events,node_country toneMint
class node_citizen,node_gemini toneIndigo
```

## Components

### Frontend experience

- [React routes](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/App.jsx): `FRONTEND/src/App.jsx`
- [Landing page](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/Landing.jsx): `FRONTEND/src/pages/Landing.jsx`
- [Report submission](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/Report.jsx): `FRONTEND/src/pages/Report.jsx`
- [Hotspot map](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/MapView.jsx): `FRONTEND/src/pages/MapView.jsx`
- [Command dashboard](https://github.com/pariwankhede26/vayu/blob/main/FRONTEND/src/pages/Dashboard.jsx): `FRONTEND/src/pages/Dashboard.jsx`

### Production API

- [Express API](https://github.com/pariwankhede26/vayu/blob/main/AI-BACKEND/server.js): `AI-BACKEND/server.js`
- [Prototype weather](https://github.com/pariwankhede26/vayu/blob/main/AI-BACKEND/server.js): `AI-BACKEND/server.js`
- [Wind spread prediction](https://github.com/pariwankhede26/vayu/blob/main/AI-BACKEND/server.js): `AI-BACKEND/server.js`

### Environmental intelligence

- [VAYU risk engine](https://github.com/pariwankhede26/vayu/blob/main/INTELLIGENCE-BACKEND/helpers/riskEngine.js): `INTELLIGENCE-BACKEND/helpers/riskEngine.js`
- [Prototype hotspot records](https://github.com/pariwankhede26/vayu/blob/main/INTELLIGENCE-BACKEND/data/pollution_events.json): `INTELLIGENCE-BACKEND/data/pollution_events.json`
- [Country categories](https://github.com/pariwankhede26/vayu/blob/main/INTELLIGENCE-BACKEND/config/countryConfig.js): `INTELLIGENCE-BACKEND/config/countryConfig.js`

### Other components

- **Citizen**
- **Gemini Vision**

## Connections

- Citizen → Report submission: submits evidence (evidence: `README.md`)
- React routes → Landing page: routes to (evidence: `FRONTEND/src/App.jsx`)
- React routes → Report submission: routes to (evidence: `FRONTEND/src/App.jsx`)
- React routes → Hotspot map: routes to (evidence: `FRONTEND/src/App.jsx`)
- React routes → Command dashboard: routes to (evidence: `FRONTEND/src/App.jsx`)
- Report submission → Express API: posts analysis (evidence: `README.md`)
- Express API → Gemini Vision: analyzes image (evidence: `AI-BACKEND/server.js`)
- Express API → VAYU risk engine: calculates risk (evidence: `AI-BACKEND/server.js`)
- Report submission → Express API: requests risk score (evidence: `README.md`)
- Report submission → Express API: requests prediction (evidence: `README.md`)
- Report submission → Express API: requests weather (evidence: `README.md`)
- Hotspot map → Express API: loads hotspots (evidence: `README.md`)
- Hotspot map → Express API: loads weather (evidence: `README.md`)
- Hotspot map → Express API: requests prediction (evidence: `README.md`)
- Command dashboard → Express API: loads hotspots (evidence: `README.md`)
- Command dashboard → Express API: loads weather (evidence: `README.md`)
- Landing page → Express API: loads hotspots (evidence: `FRONTEND/src/pages/Landing.jsx`)
- Landing page → Express API: loads country settings (evidence: `README.md`)
- Express API → Prototype hotspot records: reads records (evidence: `AI-BACKEND/server.js`)
- Express API → Prototype weather: serves context (evidence: `README.md`)
- Express API → Wind spread prediction: estimates spread (evidence: `README.md`)
- Express API → Country categories: serves categories (evidence: `AI-BACKEND/server.js`)
- Express API → VAYU risk engine: scores hotspots (evidence: `AI-BACKEND/server.js`)
