# vedantika-salunkhe11/hyperlocal-rainfall architecture

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

- Interactive diagram: https://gitdiagram.com/vedantika-salunkhe11/hyperlocal-rainfall
- Repository: https://github.com/vedantika-salunkhe11/hyperlocal-rainfall

## Overview

This is a hyperlocal waterlogging and environmental-risk mapping prototype. Citizens register or sign in, view locality weather, risk, reports and hotspots, then submit and track geolocated observations; administrators review area summaries and moderate reports. The frontend accesses an Express API, which uses JSON-file persistence and weather/elevation data to support risk calculations. The graph preserves the documented analytics and account-management capabilities. Some route internals and page wiring were not sampled, so those connections are omitted rather than inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/App.jsx) (Application views), [`backend/services/jsonStore.js`](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/jsonStore.js) (JSON persistence), [`backend/server.js`](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/server.js) (HTTP server), [`frontend/src/services/api.js`](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_app["Application views<br/>[App.jsx]"]
  node_riskmap["Risk map<br/>[RiskMap.jsx]"]
  node_reportform["Report submission<br/>[ReportForm.jsx]"]
  node_reportlist["Report lists<br/>[ReportList.jsx]"]
  node_hotspotsview["Hotspot view<br/>[Hotspots.jsx]"]
  node_adminview["Admin management<br/>[Admin.jsx]"]
  node_analyticsview["Analytics view<br/>[Analytics.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_weatherapi["Weather API client<br/>[weatherApi.js]"]
end

subgraph group_api["API workflows"]
  node_server["HTTP server<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_reportcontroller["Report management"]
  node_riskcontroller["Risk endpoint<br/>[riskController.js]"]
  node_arearoutes["Area summaries<br/>[areas.js]"]
  node_hotspotroutes["Hotspot endpoint<br/>[hotspots.js]"]
  node_analyticsroutes["Analytics endpoint<br/>[analytics.js]"]
end

subgraph group_domain["Risk and weather"]
  node_weather["Weather service<br/>[weatherService.js]"]
  node_riskcalc["Risk calculation<br/>[riskCalculator.js]"]
end

subgraph group_storage["Identity and data"]
  node_authguard["Access control<br/>[auth.js]"]
  node_authservice["Account security<br/>[authService.js]"]
  node_jsonstore[("JSON persistence<br/>[jsonStore.js]")]
end

node_citizen(("Citizen"))
node_admin(("Administrator"))
node_openmeteo["Open-Meteo"]
node_openelevation["Open-Elevation"]

node_citizen -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"requests data"| node_api_client
node_app -->|"renders"| node_riskmap
node_app -->|"renders"| node_reportform
node_app -->|"renders"| node_reportlist
node_hotspotsview -->|"loads hotspots"| node_api_client
node_adminview -->|"loads admin data"| node_api_client
node_app -.->|"requests analytics"| node_analyticsroutes
node_api_client -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_arearoutes
node_server -->|"mounts routes"| node_hotspotroutes
node_server -->|"mounts routes"| node_analyticsroutes
node_authroutes -->|"uses security"| node_authservice
node_authroutes -->|"reads and writes"| node_jsonstore
node_authguard -->|"verifies tokens"| node_authservice
node_authguard -->|"loads users"| node_jsonstore
node_reportcontroller -->|"reads and writes"| node_jsonstore
node_reportcontroller -->|"gets weather"| node_weather
node_riskcontroller -->|"reads reports"| node_jsonstore
node_riskcontroller -->|"gets weather"| node_weather
node_arearoutes -->|"reads locations"| node_jsonstore
node_arearoutes -->|"gets area weather"| node_weather
node_hotspotroutes -->|"reads reports"| node_jsonstore
node_weather -.->|"fetches forecasts"| node_openmeteo
node_weather -.->|"fetches elevation"| node_openelevation
node_api_client -.->|"uses weather client"| node_weatherapi

click node_app "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/App.jsx"
click node_riskmap "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/components/RiskMap.jsx"
click node_reportform "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/components/ReportForm.jsx"
click node_reportlist "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/components/ReportList.jsx"
click node_hotspotsview "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/pages/Hotspots.jsx"
click node_adminview "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/pages/Admin.jsx"
click node_analyticsview "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/pages/Analytics.jsx"
click node_api_client "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/server.js"
click node_authroutes "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/auth.js"
click node_reportcontroller "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/controllers/reportApiController.js"
click node_riskcontroller "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/controllers/riskController.js"
click node_arearoutes "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/areas.js"
click node_hotspotroutes "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/hotspots.js"
click node_analyticsroutes "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/analytics.js"
click node_authguard "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/middleware/auth.js"
click node_authservice "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/authService.js"
click node_jsonstore "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/jsonStore.js"
click node_weather "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/weatherService.js"
click node_riskcalc "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/riskCalculator.js"
click node_weatherapi "https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/services/weatherApi.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_riskmap,node_reportform,node_reportlist,node_hotspotsview,node_adminview,node_analyticsview,node_api_client,node_weatherapi toneBlue
class node_server,node_authroutes,node_reportcontroller,node_riskcontroller,node_arearoutes,node_hotspotroutes,node_analyticsroutes toneAmber
class node_weather,node_riskcalc toneMint
class node_authguard,node_authservice,node_jsonstore toneRose
class node_citizen,node_admin,node_openmeteo,node_openelevation toneIndigo
```

## Components

### Web experience

- [Application views](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Risk map](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/components/RiskMap.jsx): `frontend/src/components/RiskMap.jsx`
- [Report submission](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/components/ReportForm.jsx): `frontend/src/components/ReportForm.jsx`
- [Report lists](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/components/ReportList.jsx): `frontend/src/components/ReportList.jsx`
- [Hotspot view](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/pages/Hotspots.jsx): `frontend/src/pages/Hotspots.jsx`
- [Admin management](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/pages/Admin.jsx): `frontend/src/pages/Admin.jsx`
- [Analytics view](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/pages/Analytics.jsx): `frontend/src/pages/Analytics.jsx`
- [API client](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Weather API client](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/frontend/src/services/weatherApi.js): `frontend/src/services/weatherApi.js`

### API workflows

- [HTTP server](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Report management](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/controllers/reportApiController.js): `backend/controllers/reportApiController.js`
- [Risk endpoint](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/controllers/riskController.js): `backend/controllers/riskController.js`
- [Area summaries](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/areas.js): `backend/routes/areas.js`
- [Hotspot endpoint](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/hotspots.js): `backend/routes/hotspots.js`
- [Analytics endpoint](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/routes/analytics.js): `backend/routes/analytics.js`

### Risk and weather

- [Weather service](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/weatherService.js): `backend/services/weatherService.js`
- [Risk calculation](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/riskCalculator.js): `backend/services/riskCalculator.js`

### Identity and data

- [Access control](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [Account security](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/authService.js): `backend/services/authService.js`
- [JSON persistence](https://github.com/vedantika-salunkhe11/hyperlocal-rainfall/blob/main/backend/services/jsonStore.js): `backend/services/jsonStore.js`

### Other components

- **Citizen**
- **Administrator**
- **Open-Meteo**
- **Open-Elevation**

## Connections

- Citizen → Application views: uses (evidence: `README.md`)
- Administrator → Application views: uses (evidence: `README.md`)
- Application views → API client: requests data (evidence: `frontend/src/App.jsx`)
- Application views → Risk map: renders (evidence: `frontend/src/App.jsx`)
- Application views → Report submission: renders (evidence: `frontend/src/App.jsx`)
- Application views → Report lists: renders (evidence: `frontend/src/App.jsx`)
- Hotspot view → API client: loads hotspots (evidence: `frontend/src/pages/Hotspots.jsx`)
- Admin management → API client: loads admin data (evidence: `frontend/src/pages/Admin.jsx`)
- Application views → Analytics endpoint: requests analytics
- API client → HTTP server: sends requests (evidence: `README.md`)
- HTTP server → Authentication routes: mounts routes (evidence: `backend/server.js`)
- HTTP server → Area summaries: mounts routes (evidence: `backend/server.js`)
- HTTP server → Hotspot endpoint: mounts routes (evidence: `backend/server.js`)
- HTTP server → Analytics endpoint: mounts routes (evidence: `backend/server.js`)
- Authentication routes → Account security: uses security (evidence: `backend/routes/auth.js`)
- Authentication routes → JSON persistence: reads and writes (evidence: `backend/routes/auth.js`)
- Access control → Account security: verifies tokens (evidence: `backend/middleware/auth.js`)
- Access control → JSON persistence: loads users (evidence: `backend/middleware/auth.js`)
- Report management → JSON persistence: reads and writes (evidence: `backend/controllers/reportApiController.js`)
- Report management → Weather service: gets weather (evidence: `backend/controllers/reportApiController.js`)
- Risk endpoint → JSON persistence: reads reports (evidence: `backend/controllers/riskController.js`)
- Risk endpoint → Weather service: gets weather (evidence: `backend/controllers/riskController.js`)
- Area summaries → JSON persistence: reads locations (evidence: `backend/routes/areas.js`)
- Area summaries → Weather service: gets area weather (evidence: `backend/routes/areas.js`)
- Hotspot endpoint → JSON persistence: reads reports (evidence: `backend/routes/hotspots.js`)
- Weather service → Open-Meteo: fetches forecasts
- Weather service → Open-Elevation: fetches elevation
- API client → Weather API client: uses weather client
