# utkarshshukla1180/quiet-heron-4821 architecture

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

- Interactive diagram: https://gitdiagram.com/utkarshshukla1180/quiet-heron-4821
- Repository: https://github.com/utkarshshukla1180/quiet-heron-4821

## Overview

Wind Forecast Monitor is a trader-facing dashboard that compares GB wind forecasts with actual generation and summarizes forecast error. The main flow is browser selections → typed API requests → FastAPI data retrieval and forecast selection/analysis → chart, metrics, and forecast-vintage views. DataService uses day-based memory/disk caching, fetches missing data from Elexon, and falls back to bundled Parquet snapshots. The graph includes the documented dashboard and analysis capabilities; unsampled internals are linked only where the excerpts, source index, or README support the relationship.

Main entry points: [`frontend/src/App.tsx`](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/App.tsx) (Dashboard app), [`backend/app/data_service.py`](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/data_service.py) (Day data service), [`backend/app/main.py`](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/main.py) (API routes), [`frontend/src/format.ts`](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/format.ts) (Display formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Dashboard app<br/>[App.tsx]"]
  node_api_client["Typed API client<br/>[client.ts]"]
  node_controls["Query controls<br/>[Controls.tsx]"]
  node_chart["Forecast chart<br/>[ForecastChart.tsx]"]
  node_breakdown["Error breakdown<br/>[Breakdown.tsx]"]
  node_kpis["Accuracy KPIs<br/>[KpiTiles.tsx]"]
  node_vintages["Forecast vintages<br/>[VintagesPanel.tsx]"]
  node_hero["Windmill hero<br/>[Hero.tsx]"]
  node_motion["Motion effects<br/>[Motion.tsx]"]
  node_cards["Dashboard cards<br/>[Card.tsx]"]
  node_scroll_statement["Scroll statement"]
  node_source_badge["Source badge<br/>[SourceBadge.tsx]"]
  node_format["Display formatting<br/>[format.ts]"]
end

subgraph group_backend["API and analysis"]
  node_routes["API routes<br/>[main.py]"]
  node_analysis["Forecast analysis<br/>[analysis.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

subgraph group_data["Data sources"]
  node_data_service["Day data service<br/>[data_service.py]"]
  node_elexon_client["Elexon client<br/>[elexon_client.py]"]
  node_elexon{{"Elexon BMRS"}}
  node_cache[("Day cache<br/>[data_service.py]")]
  node_snapshot[("Parquet snapshots")]
end

node_trader(("Trader"))
node_browser(("Browser"))

node_trader -->|"uses"| node_browser
node_browser -->|"opens"| node_app
node_app -->|"requests data"| node_api_client
node_app -->|"renders"| node_controls
node_app -->|"renders"| node_chart
node_app -->|"renders"| node_breakdown
node_app -->|"renders"| node_kpis
node_app -->|"renders"| node_vintages
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_cards
node_app -->|"uses"| node_motion
node_app -->|"renders"| node_scroll_statement
node_app -->|"renders"| node_source_badge
node_chart -->|"formats values"| node_format
node_breakdown -->|"formats values"| node_format
node_kpis -->|"formats values"| node_format
node_vintages -->|"formats values"| node_format
node_hero -->|"uses"| node_motion
node_controls -->|"uses"| node_cards
node_app -->|"calls API"| node_routes
node_routes -->|"loads window"| node_data_service
node_routes -->|"selects forecasts"| node_analysis
node_data_service -->|"fetches missing days"| node_elexon_client
node_elexon_client -->|"requests datasets"| node_elexon
node_data_service -->|"reads and writes"| node_cache
node_data_service -->|"falls back to"| node_snapshot
node_data_service -->|"reads settings"| node_config
node_elexon_client -->|"reads settings"| node_config
node_routes -->|"reads defaults"| node_config
node_api_client -->|"calls endpoints"| node_routes

click node_app "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/api/client.ts"
click node_controls "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Controls.tsx"
click node_chart "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/ForecastChart.tsx"
click node_breakdown "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Breakdown.tsx"
click node_kpis "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/KpiTiles.tsx"
click node_vintages "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/VintagesPanel.tsx"
click node_hero "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Hero.tsx"
click node_motion "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Motion.tsx"
click node_cards "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Card.tsx"
click node_scroll_statement "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/ScrollStatement.tsx"
click node_source_badge "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/SourceBadge.tsx"
click node_format "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/format.ts"
click node_routes "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/main.py"
click node_analysis "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/analysis.py"
click node_config "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/config.py"
click node_data_service "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/data_service.py"
click node_elexon_client "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/elexon_client.py"
click node_cache "https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/data_service.py"
click node_snapshot "https://github.com/utkarshshukla1180/quiet-heron-4821/tree/main/backend/data/snapshot"

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_api_client,node_controls,node_chart,node_breakdown,node_kpis,node_vintages,node_hero,node_motion,node_cards,node_scroll_statement,node_source_badge,node_format,node_browser toneBlue
class node_routes,node_analysis,node_config toneAmber
class node_data_service,node_elexon_client,node_elexon,node_cache,node_snapshot toneMint
class node_trader toneIndigo
```

## Components

### Dashboard

- [Dashboard app](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Typed API client](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Query controls](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Controls.tsx): `frontend/src/components/Controls.tsx`
- [Forecast chart](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/ForecastChart.tsx): `frontend/src/components/ForecastChart.tsx`
- [Error breakdown](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Breakdown.tsx): `frontend/src/components/Breakdown.tsx`
- [Accuracy KPIs](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/KpiTiles.tsx): `frontend/src/components/KpiTiles.tsx`
- [Forecast vintages](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/VintagesPanel.tsx): `frontend/src/components/VintagesPanel.tsx`
- [Windmill hero](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Hero.tsx): `frontend/src/components/Hero.tsx`
- [Motion effects](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Motion.tsx): `frontend/src/components/Motion.tsx`
- [Dashboard cards](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/Card.tsx): `frontend/src/components/Card.tsx`
- [Scroll statement](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/ScrollStatement.tsx): `frontend/src/components/ScrollStatement.tsx`
- [Source badge](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/components/SourceBadge.tsx): `frontend/src/components/SourceBadge.tsx`
- [Display formatting](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/frontend/src/format.ts): `frontend/src/format.ts`

### API and analysis

- [API routes](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/main.py): `backend/app/main.py`
- [Forecast analysis](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/analysis.py): `backend/app/analysis.py`
- [Runtime settings](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/config.py): `backend/app/config.py`

### Data sources

- [Day data service](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/data_service.py): `backend/app/data_service.py`
- [Elexon client](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/elexon_client.py): `backend/app/elexon_client.py`
- **Elexon BMRS**
- [Day cache](https://github.com/utkarshshukla1180/quiet-heron-4821/blob/main/backend/app/data_service.py): `backend/app/data_service.py`
- [Parquet snapshots](https://github.com/utkarshshukla1180/quiet-heron-4821/tree/main/backend/data/snapshot): `backend/data/snapshot`

### Other components

- **Trader**
- **Browser**

## Connections

- Trader → Browser: uses (evidence: `README.md`)
- Browser → Dashboard app: opens (evidence: `README.md`)
- Dashboard app → Typed API client: requests data (evidence: `frontend/src/App.tsx`)
- Dashboard app → Query controls: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Forecast chart: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Error breakdown: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Accuracy KPIs: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Forecast vintages: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Windmill hero: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Dashboard cards: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Motion effects: uses (evidence: `frontend/src/App.tsx`)
- Dashboard app → Scroll statement: renders (evidence: `frontend/src/App.tsx`)
- Dashboard app → Source badge: renders (evidence: `frontend/src/App.tsx`)
- Forecast chart → Display formatting: formats values (evidence: `frontend/src/components/ForecastChart.tsx`)
- Error breakdown → Display formatting: formats values (evidence: `frontend/src/components/Breakdown.tsx`)
- Accuracy KPIs → Display formatting: formats values (evidence: `frontend/src/components/KpiTiles.tsx`)
- Forecast vintages → Display formatting: formats values (evidence: `frontend/src/components/VintagesPanel.tsx`)
- Windmill hero → Motion effects: uses (evidence: `frontend/src/components/Hero.tsx`)
- Query controls → Dashboard cards: uses (evidence: `frontend/src/components/Controls.tsx`)
- Dashboard app → API routes: calls API (evidence: `README.md`)
- API routes → Day data service: loads window (evidence: `backend/app/main.py`)
- API routes → Forecast analysis: selects forecasts (evidence: `backend/app/main.py`)
- Day data service → Elexon client: fetches missing days (evidence: `backend/app/data_service.py`)
- Elexon client → Elexon BMRS: requests datasets (evidence: `backend/app/elexon_client.py`)
- Day data service → Day cache: reads and writes (evidence: `backend/app/data_service.py`)
- Day data service → Parquet snapshots: falls back to (evidence: `backend/app/data_service.py`)
- Day data service → Runtime settings: reads settings (evidence: `backend/app/data_service.py`)
- Elexon client → Runtime settings: reads settings (evidence: `backend/app/elexon_client.py`)
- API routes → Runtime settings: reads defaults (evidence: `backend/app/main.py`)
- Typed API client → API routes: calls endpoints (evidence: `README.md`)
