# yashveer-dev/aeropulse architecture

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

- Interactive diagram: https://gitdiagram.com/yashveer-dev/aeropulse
- Repository: https://github.com/yashveer-dev/aeropulse

## Overview

AeroPulse is a browser-based urban air-quality and exposure assistant. Its main workflow is location selection, live air-quality and weather retrieval, then an interactive dashboard with health metrics, a 48-hour forecast, and persona-tailored routines; users can also ask the grounded copilot questions. The README documents geolocation, pollutant comparisons, indoor-air guidance, and sustainable-swap impact estimates. Source excerpts show the app orchestrating telemetry and advice; some component wiring and optional integrations are documented rather than fully shown.

Main entry points: [`src/App.tsx`](https://github.com/yashveer-dev/aeropulse/blob/main/src/App.tsx) (App Orchestrator), [`src/services/telemetryService.ts`](https://github.com/yashveer-dev/aeropulse/blob/main/src/services/telemetryService.ts) (Telemetry Service), [`src/services/geminiService.ts`](https://github.com/yashveer-dev/aeropulse/blob/main/src/services/geminiService.ts) (Advice Engine), [`src/utils/aqiCalculations.ts`](https://github.com/yashveer-dev/aeropulse/blob/main/src/utils/aqiCalculations.ts) (AQI & Exposure Calculations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["App Orchestrator<br/>[App.tsx]"]
  node_header["Location &amp; Key Header<br/>[Header.tsx]"]
  node_hero["Exposure Overview<br/>[HeroTelemetry.tsx]"]
  node_pollutants["Pollutant Cards<br/>[PollutantGrid.tsx]"]
  node_forecast["Forecast Chart<br/>[ForecastChart.tsx]"]
end

subgraph group_telemetry["Location &amp; Telemetry"]
  node_telemetry["Telemetry Service"]
  node_geocoding["Open-Meteo Geocoding"]
  node_airapi["Open-Meteo Air Quality"]
  node_weatherapi["Open-Meteo Weather"]
  node_reversegeo["BigDataCloud Reverse Geocoding"]
end

subgraph group_health["Health Intelligence"]
  node_metrics["AQI &amp; Exposure Calculations<br/>[aqiCalculations.ts]"]
  node_personas["Household Personas<br/>[personas.ts]"]
end

subgraph group_personalization["Advice &amp; Copilot"]
  node_advice["Advice Engine<br/>[geminiService.ts]"]
  node_gemini["Gemini API"]
  node_routine["Routine &amp; Impact Deck"]
  node_copilot["Smog Copilot Drawer"]
end

node_user(("Residents"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_header
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_pollutants
node_app -->|"renders"| node_forecast
node_app -->|"renders"| node_routine
node_app -->|"renders"| node_copilot
node_app -->|"fetches telemetry"| node_telemetry
node_app -->|"reverse geocodes"| node_telemetry
node_app -->|"requests advice"| node_advice
node_header -->|"searches cities"| node_telemetry
node_telemetry -->|"searches"| node_geocoding
node_telemetry -->|"fetches air data"| node_airapi
node_telemetry -->|"fetches weather"| node_weatherapi
node_telemetry -->|"reverse geocodes"| node_reversegeo
node_hero -->|"calculates health metrics"| node_metrics
node_hero -->|"uses profiles"| node_personas
node_pollutants -->|"reads pollutant limits"| node_metrics
node_forecast -->|"classifies AQI"| node_metrics
node_advice -->|"calculates risk context"| node_metrics
node_advice -->|"selects profile"| node_personas
node_advice -->|"generates advice"| node_gemini
node_copilot -->|"asks questions"| node_advice
node_routine -.->|"presents recommendations"| node_user

click node_app "https://github.com/yashveer-dev/aeropulse/blob/main/src/App.tsx"
click node_header "https://github.com/yashveer-dev/aeropulse/blob/main/src/components/Header.tsx"
click node_hero "https://github.com/yashveer-dev/aeropulse/blob/main/src/components/HeroTelemetry.tsx"
click node_pollutants "https://github.com/yashveer-dev/aeropulse/blob/main/src/components/PollutantGrid.tsx"
click node_forecast "https://github.com/yashveer-dev/aeropulse/blob/main/src/components/ForecastChart.tsx"
click node_telemetry "https://github.com/yashveer-dev/aeropulse/blob/main/src/services/telemetryService.ts"
click node_metrics "https://github.com/yashveer-dev/aeropulse/blob/main/src/utils/aqiCalculations.ts"
click node_personas "https://github.com/yashveer-dev/aeropulse/blob/main/src/utils/personas.ts"
click node_advice "https://github.com/yashveer-dev/aeropulse/blob/main/src/services/geminiService.ts"
click node_routine "https://github.com/yashveer-dev/aeropulse/blob/main/src/components/ActionRoutineDeck.tsx"
click node_copilot "https://github.com/yashveer-dev/aeropulse/blob/main/src/components/SmogCopilotDrawer.tsx"

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_header,node_hero,node_pollutants,node_forecast toneBlue
class node_telemetry,node_geocoding,node_airapi,node_weatherapi,node_reversegeo toneAmber
class node_metrics,node_personas toneMint
class node_advice,node_gemini,node_routine,node_copilot toneRose
class node_user toneIndigo
```

## Components

### Dashboard

- [App Orchestrator](https://github.com/yashveer-dev/aeropulse/blob/main/src/App.tsx): `src/App.tsx`
- [Location & Key Header](https://github.com/yashveer-dev/aeropulse/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Exposure Overview](https://github.com/yashveer-dev/aeropulse/blob/main/src/components/HeroTelemetry.tsx): `src/components/HeroTelemetry.tsx`
- [Pollutant Cards](https://github.com/yashveer-dev/aeropulse/blob/main/src/components/PollutantGrid.tsx): `src/components/PollutantGrid.tsx`
- [Forecast Chart](https://github.com/yashveer-dev/aeropulse/blob/main/src/components/ForecastChart.tsx): `src/components/ForecastChart.tsx`

### Location & Telemetry

- [Telemetry Service](https://github.com/yashveer-dev/aeropulse/blob/main/src/services/telemetryService.ts): `src/services/telemetryService.ts`
- **Open-Meteo Geocoding**
- **Open-Meteo Air Quality**
- **Open-Meteo Weather**
- **BigDataCloud Reverse Geocoding**

### Health Intelligence

- [AQI & Exposure Calculations](https://github.com/yashveer-dev/aeropulse/blob/main/src/utils/aqiCalculations.ts): `src/utils/aqiCalculations.ts`
- [Household Personas](https://github.com/yashveer-dev/aeropulse/blob/main/src/utils/personas.ts): `src/utils/personas.ts`

### Advice & Copilot

- [Advice Engine](https://github.com/yashveer-dev/aeropulse/blob/main/src/services/geminiService.ts): `src/services/geminiService.ts`
- **Gemini API**
- [Routine & Impact Deck](https://github.com/yashveer-dev/aeropulse/blob/main/src/components/ActionRoutineDeck.tsx): `src/components/ActionRoutineDeck.tsx`
- [Smog Copilot Drawer](https://github.com/yashveer-dev/aeropulse/blob/main/src/components/SmogCopilotDrawer.tsx): `src/components/SmogCopilotDrawer.tsx`

### Other components

- **Residents**

## Connections

- Residents → App Orchestrator: uses (evidence: `README.md`)
- App Orchestrator → Location & Key Header: renders (evidence: `src/App.tsx`)
- App Orchestrator → Exposure Overview: renders (evidence: `src/App.tsx`)
- App Orchestrator → Pollutant Cards: renders (evidence: `src/App.tsx`)
- App Orchestrator → Forecast Chart: renders (evidence: `src/App.tsx`)
- App Orchestrator → Routine & Impact Deck: renders (evidence: `src/App.tsx`)
- App Orchestrator → Smog Copilot Drawer: renders (evidence: `src/App.tsx`)
- App Orchestrator → Telemetry Service: fetches telemetry (evidence: `src/App.tsx`)
- App Orchestrator → Telemetry Service: reverse geocodes (evidence: `src/App.tsx`)
- App Orchestrator → Advice Engine: requests advice (evidence: `src/App.tsx`)
- Location & Key Header → Telemetry Service: searches cities (evidence: `src/components/Header.tsx`)
- Telemetry Service → Open-Meteo Geocoding: searches (evidence: `src/services/telemetryService.ts`)
- Telemetry Service → Open-Meteo Air Quality: fetches air data (evidence: `src/services/telemetryService.ts`)
- Telemetry Service → Open-Meteo Weather: fetches weather (evidence: `src/services/telemetryService.ts`)
- Telemetry Service → BigDataCloud Reverse Geocoding: reverse geocodes (evidence: `src/services/telemetryService.ts`)
- Exposure Overview → AQI & Exposure Calculations: calculates health metrics (evidence: `src/components/HeroTelemetry.tsx`)
- Exposure Overview → Household Personas: uses profiles (evidence: `src/components/HeroTelemetry.tsx`)
- Pollutant Cards → AQI & Exposure Calculations: reads pollutant limits (evidence: `src/components/PollutantGrid.tsx`)
- Forecast Chart → AQI & Exposure Calculations: classifies AQI (evidence: `src/components/ForecastChart.tsx`)
- Advice Engine → AQI & Exposure Calculations: calculates risk context (evidence: `src/services/geminiService.ts`)
- Advice Engine → Household Personas: selects profile (evidence: `src/services/geminiService.ts`)
- Advice Engine → Gemini API: generates advice (evidence: `src/services/geminiService.ts`)
- Smog Copilot Drawer → Advice Engine: asks questions (evidence: `src/components/SmogCopilotDrawer.tsx`)
- Routine & Impact Deck → Residents: presents recommendations (evidence: `README.md`)
