# shreya-g-amin/niwe-wind-stations architecture

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

- Interactive diagram: https://gitdiagram.com/shreya-g-amin/niwe-wind-stations
- Repository: https://github.com/shreya-g-amin/niwe-wind-stations

## Overview

The product presents NIWE wind measurement stations on an interactive map, backed by a Python data-preparation workflow that extracts station records from a source PDF, cleans and validates them, then exports web-ready files. The UI loads the published GeoJSON and state boundaries, and provides map layers, station details, clustering, and controls. A browser export utility also supports CSV, Excel, and KML for supplied rows, though no caller is shown. The documented template README does not describe additional product capabilities; links between processing stages are supported by their file contracts, not direct calls.

Main entry points: [`data-processing/scripts/validate.py`](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/validate.py) (Quality validation), [`src/components/map/WindMap.jsx`](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/components/map/WindMap.jsx) (Station map), [`data-processing/scripts/export.py`](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/export.py) (Publication exports), [`data-processing/scripts/extract.py`](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/extract.py) (PDF extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_processing["Data processing"]
  node_extract["PDF extraction<br/>[extract.py]"]
  node_rawtables["Raw table rows"]
  node_clean["Station cleaning<br/>[clean.py]"]
  node_cleandata["Cleaned records"]
  node_validate["Quality validation<br/>[validate.py]"]
  node_review["Review issues"]
  node_quality["Quality summary<br/>[data_quality.json]"]
  node_exportpipe["Publication exports<br/>[export.py]"]
  node_processed["Processed station files"]
end

subgraph group_frontend["Map application"]
  node_publicdata["Web station data"]
  node_entry["Application entry<br/>[main.tsx]"]
  node_app["Page shell<br/>[App.tsx]"]
  node_windmap["Station map<br/>[WindMap.jsx]"]
  node_stateboundaries["State boundaries<br/>[india-states.json]"]
end

subgraph group_exports["Exports"]
  node_exportsutil["Browser exports<br/>[exportUtils.js]"]
end

node_pdf["NIWE source PDF"]
node_user(("Map viewer"))
node_tiles["Map tile services"]
node_exportuser(("Export caller"))

node_pdf -->|"reads PDF"| node_extract
node_extract -->|"writes rows"| node_rawtables
node_rawtables -->|"reads rows"| node_clean
node_clean -->|"writes records"| node_cleandata
node_cleandata -->|"reads records"| node_validate
node_validate -->|"writes issues"| node_review
node_validate -->|"writes summary"| node_quality
node_validate -.->|"provides validated data"| node_exportpipe
node_exportpipe -->|"writes exports"| node_processed
node_exportpipe -->|"copies web files"| node_publicdata
node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_windmap
node_windmap -->|"fetches GeoJSON"| node_publicdata
node_windmap -->|"fetches boundaries"| node_stateboundaries
node_windmap -->|"loads map tiles"| node_tiles
node_exportuser -.->|"requests export"| node_exportsutil

click node_pdf "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/data/raw/LIST_OF_WMS_AS_ON_31072026.pdf"
click node_extract "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/extract.py"
click node_rawtables "https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/data-processing/data/processed"
click node_clean "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/clean.py"
click node_cleandata "https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/data-processing/data/processed"
click node_validate "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/validate.py"
click node_review "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/data/processed/review_required.csv"
click node_quality "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/data/processed/data_quality.json"
click node_exportpipe "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/export.py"
click node_processed "https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/data-processing/data/processed"
click node_publicdata "https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/public/data"
click node_entry "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/main.tsx"
click node_app "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/App.tsx"
click node_windmap "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/components/map/WindMap.jsx"
click node_stateboundaries "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/public/data/india-states.json"
click node_exportsutil "https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/utils/exportUtils.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_extract,node_rawtables,node_clean,node_cleandata,node_validate,node_review,node_quality,node_exportpipe,node_processed,node_user toneBlue
class node_publicdata,node_entry,node_app,node_windmap,node_stateboundaries toneAmber
class node_exportsutil toneMint
class node_pdf toneTeal
class node_tiles,node_exportuser toneIndigo
```

## Components

### Data processing

- [PDF extraction](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/extract.py): `data-processing/scripts/extract.py`
- [Raw table rows](https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/data-processing/data/processed): `data-processing/data/processed`
- [Station cleaning](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/clean.py): `data-processing/scripts/clean.py`
- [Cleaned records](https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/data-processing/data/processed): `data-processing/data/processed`
- [Quality validation](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/validate.py): `data-processing/scripts/validate.py`
- [Review issues](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/data/processed/review_required.csv): `data-processing/data/processed/review_required.csv`
- [Quality summary](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/data/processed/data_quality.json): `data-processing/data/processed/data_quality.json`
- [Publication exports](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/scripts/export.py): `data-processing/scripts/export.py`
- [Processed station files](https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/data-processing/data/processed): `data-processing/data/processed`

### Map application

- [Web station data](https://github.com/shreya-g-amin/niwe-wind-stations/tree/main/public/data): `public/data`
- [Application entry](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/main.tsx): `src/main.tsx`
- [Page shell](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/App.tsx): `src/App.tsx`
- [Station map](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/components/map/WindMap.jsx): `src/components/map/WindMap.jsx`
- [State boundaries](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/public/data/india-states.json): `public/data/india-states.json`

### Exports

- [Browser exports](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/src/utils/exportUtils.js): `src/utils/exportUtils.js`

### Other components

- [NIWE source PDF](https://github.com/shreya-g-amin/niwe-wind-stations/blob/main/data-processing/data/raw/LIST_OF_WMS_AS_ON_31072026.pdf): `data-processing/data/raw/LIST_OF_WMS_AS_ON_31072026.pdf`
- **Map viewer**
- **Map tile services**
- **Export caller**

## Connections

- NIWE source PDF → PDF extraction: reads PDF (evidence: `data-processing/scripts/extract.py`)
- PDF extraction → Raw table rows: writes rows (evidence: `data-processing/scripts/extract.py`)
- Raw table rows → Station cleaning: reads rows (evidence: `data-processing/scripts/clean.py`)
- Station cleaning → Cleaned records: writes records (evidence: `data-processing/scripts/clean.py`)
- Cleaned records → Quality validation: reads records (evidence: `data-processing/scripts/validate.py`)
- Quality validation → Review issues: writes issues (evidence: `data-processing/scripts/validate.py`)
- Quality validation → Quality summary: writes summary (evidence: `data-processing/scripts/validate.py`)
- Quality validation → Publication exports: provides validated data
- Publication exports → Processed station files: writes exports (evidence: `data-processing/scripts/export.py`)
- Publication exports → Web station data: copies web files (evidence: `data-processing/scripts/export.py`)
- Map viewer → Application entry: opens app (evidence: `src/main.tsx`)
- Application entry → Page shell: renders (evidence: `src/main.tsx`)
- Page shell → Station map: renders (evidence: `src/App.tsx`)
- Station map → Web station data: fetches GeoJSON (evidence: `src/components/map/WindMap.jsx`)
- Station map → State boundaries: fetches boundaries (evidence: `src/components/map/WindMap.jsx`)
- Station map → Map tile services: loads map tiles (evidence: `src/components/map/WindMap.jsx`)
- Export caller → Browser exports: requests export
