# sarthakdeshmukh87/climate-model architecture

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

- Interactive diagram: https://gitdiagram.com/sarthakdeshmukh87/climate-model
- Repository: https://github.com/sarthakdeshmukh87/climate-model

## Overview

Climate Intelligence is a web application for station-based weather monitoring, heat-risk assessment, alerts, reports, and user administration. The main workflow is selecting a station, viewing live conditions and climate records, then exploring predictions and warnings; separate views support reports, feedback, and administration. The page-to-view and selected service relationships shown below are supported by excerpts or the source index. Some data-access and domain-generation details are unsampled, so their relationships are not inferred.

Main entry points: [`src/app/page.tsx`](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/app/page.tsx) (Main dashboard), [`src/context/AuthContext.tsx`](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/context/AuthContext.tsx) (Authentication context), [`src/components/StationSelector.tsx`](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/StationSelector.tsx) (Station selector), [`src/lib/services/openmeteo.ts`](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/services/openmeteo.ts) (Live weather service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Application experience"]
  node_home["Main dashboard<br/>[page.tsx]"]
  node_navigation["Navigation<br/>[Navigation.tsx]"]
  node_dashboard["Weather dashboard<br/>[DashboardView.tsx]"]
  node_records["Weather records"]
  node_login["Login page<br/>[page.tsx]"]
end

subgraph group_weather["Station and weather"]
  node_station["Station selector"]
  node_geocoding["Location geocoding<br/>[geocoding.ts]"]
  node_weather_service["Live weather service<br/>[openmeteo.ts]"]
end

subgraph group_intelligence["Climate intelligence"]
  node_risk["Risk prediction<br/>[openmeteo.ts]"]
  node_predictions["Predictions view"]
  node_alerts["Alert management<br/>[AlertsView.tsx]"]
  node_reports["Report analysis<br/>[ReportsView.tsx]"]
  node_risk_badge["Risk badge<br/>[RiskBadge.tsx]"]
end

subgraph group_identity["Identity and data"]
  node_admin["Admin operations"]
  node_feedback["User feedback<br/>[FeedbackView.tsx]"]
  node_auth_modal["Authentication modal<br/>[AuthModal.tsx]"]
  node_auth_context["Authentication context<br/>[AuthContext.tsx]"]
  node_data_service["Climate data service<br/>[client.ts]"]
  node_schema["Climate data schema<br/>[schema.sql]"]
  node_types["Climate data types<br/>[database.ts]"]
end

node_visitor(("User"))
node_weather_api{{"Weather data API"}}
node_supabase[("Supabase")]

node_visitor -->|"opens"| node_home
node_visitor -->|"signs in"| node_login
node_home -->|"renders"| node_navigation
node_home -->|"renders"| node_station
node_home -->|"renders"| node_dashboard
node_home -->|"renders"| node_records
node_home -->|"renders"| node_predictions
node_home -->|"renders"| node_alerts
node_home -->|"renders"| node_reports
node_home -->|"renders"| node_feedback
node_home -->|"renders"| node_admin
node_home -->|"renders"| node_auth_modal
node_station -->|"searches locations"| node_geocoding
node_station -->|"adds station"| node_data_service
node_dashboard -->|"fetches live weather"| node_weather_service
node_weather_service -->|"requests weather data"| node_weather_api
node_weather_service -.->|"calculates risk"| node_risk
node_alerts -->|"renders severity"| node_risk_badge
node_auth_modal -.->|"uses authentication"| node_auth_context
node_login -->|"uses authentication"| node_auth_context
node_auth_context -->|"loads user data"| node_data_service
node_auth_context -->|"authenticates and syncs"| node_supabase
node_data_service -->|"reads and writes"| node_supabase
node_supabase -->|"implements schema"| node_schema

click node_home "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/app/page.tsx"
click node_navigation "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/Navigation.tsx"
click node_dashboard "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/DashboardView.tsx"
click node_records "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/WeatherRecordsView.tsx"
click node_login "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/app/login/page.tsx"
click node_station "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/StationSelector.tsx"
click node_geocoding "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/services/geocoding.ts"
click node_weather_service "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/services/openmeteo.ts"
click node_risk "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/services/openmeteo.ts"
click node_predictions "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/PredictionsView.tsx"
click node_alerts "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/AlertsView.tsx"
click node_reports "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/ReportsView.tsx"
click node_risk_badge "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/RiskBadge.tsx"
click node_admin "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/AdminDashboardView.tsx"
click node_feedback "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/FeedbackView.tsx"
click node_auth_modal "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/AuthModal.tsx"
click node_auth_context "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/context/AuthContext.tsx"
click node_data_service "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/supabase/client.ts"
click node_schema "https://github.com/sarthakdeshmukh87/climate-model/blob/main/supabase/schema.sql"
click node_types "https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/types/database.ts"

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_home,node_navigation,node_dashboard,node_records,node_login,node_visitor toneBlue
class node_station,node_geocoding,node_weather_service,node_supabase toneAmber
class node_risk,node_predictions,node_alerts,node_reports,node_risk_badge,node_weather_api toneMint
class node_admin,node_feedback,node_auth_modal,node_auth_context,node_data_service,node_schema,node_types toneRose
```

## Components

### Application experience

- [Main dashboard](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Navigation](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/Navigation.tsx): `src/components/Navigation.tsx`
- [Weather dashboard](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Weather records](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/WeatherRecordsView.tsx): `src/components/WeatherRecordsView.tsx`
- [Login page](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`

### Station and weather

- [Station selector](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/StationSelector.tsx): `src/components/StationSelector.tsx`
- [Location geocoding](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/services/geocoding.ts): `src/lib/services/geocoding.ts`
- [Live weather service](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/services/openmeteo.ts): `src/lib/services/openmeteo.ts`

### Climate intelligence

- [Risk prediction](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/services/openmeteo.ts): `src/lib/services/openmeteo.ts`
- [Predictions view](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/PredictionsView.tsx): `src/components/PredictionsView.tsx`
- [Alert management](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/AlertsView.tsx): `src/components/AlertsView.tsx`
- [Report analysis](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/ReportsView.tsx): `src/components/ReportsView.tsx`
- [Risk badge](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/RiskBadge.tsx): `src/components/RiskBadge.tsx`

### Identity and data

- [Admin operations](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/AdminDashboardView.tsx): `src/components/AdminDashboardView.tsx`
- [User feedback](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/FeedbackView.tsx): `src/components/FeedbackView.tsx`
- [Authentication modal](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Authentication context](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Climate data service](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Climate data schema](https://github.com/sarthakdeshmukh87/climate-model/blob/main/supabase/schema.sql): `supabase/schema.sql`
- [Climate data types](https://github.com/sarthakdeshmukh87/climate-model/blob/main/src/types/database.ts): `src/types/database.ts`

### Other components

- **User**
- **Weather data API**
- **Supabase**

## Connections

- User → Main dashboard: opens (evidence: `README.md`)
- User → Login page: signs in (evidence: `README.md`)
- Main dashboard → Navigation: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Station selector: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Weather dashboard: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Weather records: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Predictions view: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Alert management: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Report analysis: renders (evidence: `src/app/page.tsx`)
- Main dashboard → User feedback: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Admin operations: renders (evidence: `src/app/page.tsx`)
- Main dashboard → Authentication modal: renders (evidence: `src/app/page.tsx`)
- Station selector → Location geocoding: searches locations (evidence: `src/components/StationSelector.tsx`)
- Station selector → Climate data service: adds station (evidence: `src/components/StationSelector.tsx`)
- Weather dashboard → Live weather service: fetches live weather (evidence: `src/components/DashboardView.tsx`)
- Live weather service → Weather data API: requests weather data (evidence: `README.md`)
- Live weather service → Risk prediction: calculates risk (evidence: `src/lib/services/openmeteo.ts`)
- Alert management → Risk badge: renders severity (evidence: `src/components/AlertsView.tsx`)
- Authentication modal → Authentication context: uses authentication (evidence: `src/components/AuthModal.tsx`)
- Login page → Authentication context: uses authentication (evidence: `src/app/login/page.tsx`)
- Authentication context → Climate data service: loads user data (evidence: `src/context/AuthContext.tsx`)
- Authentication context → Supabase: authenticates and syncs (evidence: `src/context/AuthContext.tsx`)
- Climate data service → Supabase: reads and writes (evidence: `src/lib/supabase/client.ts`)
- Supabase → Climate data schema: implements schema (evidence: `README.md`)
