How tiwaribh/h2s-prompt works
AirSathi is a civic air-intelligence dashboard: users authenticate, choose a location, view live air-quality telemetry and comparisons, then generate analysis, civic actions, briefings, and saved-report comparisons. The map follows documented capabilities and shown imports/calls; some client-to-API and optional-provider links are documented rather than visible in the sampled runtime excerpts.
Main entry points: page.tsx Dashboard orchestration · storage.ts Browser report storage · OverviewTab.tsx Live overview · route.ts Intelligence endpoint
Components 26
Access and dashboard
- Dashboard orchestration
src/app/page.tsx - Dashboard navigation
src/components/Sidebar.tsx - User and location header
src/components/Header.tsx - Google sign-in screen
src/components/LoginPage.tsx - Authentication state
src/context/AuthContext.tsx - Firebase client auth
src/lib/firebase.ts
Telemetry and location
- Location search
src/components/LocationModal.tsx - Geocoding endpoint
src/app/api/geocode/route.ts - Open-Meteo geocoding
- Air-quality endpoint
src/app/api/air-quality/route.ts - Open-Meteo air API
- CPCB provider endpoint
src/app/api/cpcb/route.ts - OpenAQ provider endpoint
src/app/api/openaq/route.ts
Analysis and trends
- Live overview
src/components/OverviewTab.tsx - Pollutant details
src/components/LiveAirQualityTab.tsx - Location trends
src/components/HotspotsTrendsTab.tsx - Intelligence endpoint
src/app/api/gemini/route.ts - Google Gemini
- AQI classification
src/lib/aqi-utils.ts - AQI status badge
src/components/AQIBadge.tsx - Data intelligence view
src/components/DataIntelligenceTab.tsx
Civic actions and records
- Stakeholder actions
src/components/RecommendationsTab.tsx - Bilingual briefings
src/components/BriefingsTab.tsx - Report comparison
src/components/PreviousReportsTab.tsx - Browser report storage
src/lib/storage.ts
Other components
- Dashboard user
Connections 30
- Dashboard user → Google sign-in screen: signs in
README.md - Google sign-in screen → Authentication state: requests sign-in
src/components/LoginPage.tsx - Authentication state → Firebase client auth: delegates auth
src/context/AuthContext.tsx - Dashboard user → Dashboard orchestration: uses dashboard
README.md - Dashboard orchestration → Dashboard navigation: renders
src/app/page.tsx - Dashboard orchestration → User and location header: renders
src/app/page.tsx - User and location header → Location search: opens selector
src/components/Header.tsx - Location search → Geocoding endpoint: searches places
README.md - Geocoding endpoint → Open-Meteo geocoding: queries
src/app/api/geocode/route.ts - Dashboard orchestration → Air-quality endpoint: fetches telemetry
src/app/page.tsx - Air-quality endpoint → Open-Meteo air API: fetches model data
src/app/api/air-quality/route.ts - Dashboard orchestration → Live overview: renders tab
src/app/page.tsx - Dashboard orchestration → Pollutant details: renders tab
src/app/page.tsx - Dashboard orchestration → Location trends: renders tab
src/app/page.tsx - Dashboard orchestration → Data intelligence view: renders tab
src/app/page.tsx - Dashboard orchestration → Intelligence endpoint: requests analysis
README.md - Intelligence endpoint → Google Gemini: generates analysis
src/app/api/gemini/route.ts - Intelligence endpoint → Dashboard orchestration: returns analysis
README.md - Dashboard orchestration → Stakeholder actions: renders tab
src/app/page.tsx - Dashboard orchestration → Bilingual briefings: renders tab
src/app/page.tsx - Dashboard orchestration → Report comparison: renders tab
src/app/page.tsx - Dashboard orchestration → Browser report storage: saves snapshots
src/app/page.tsx - Report comparison → Browser report storage: reads snapshots
src/components/PreviousReportsTab.tsx - Live overview → AQI classification: classifies AQI
src/components/OverviewTab.tsx - Live overview → Browser report storage: loads recommendations
src/components/OverviewTab.tsx - Stakeholder actions → Browser report storage: gets actions
src/components/RecommendationsTab.tsx - Pollutant details → AQI classification: classifies readings
src/components/LiveAirQualityTab.tsx - AQI status badge → AQI classification: formats AQI
src/components/AQIBadge.tsx - Dashboard orchestration → CPCB provider endpoint: offers secondary data
README.md - Dashboard orchestration → OpenAQ provider endpoint: offers secondary data
README.md