# siddith31/weathergpt_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/siddith31/weathergpt_frontend
- Repository: https://github.com/siddith31/weathergpt_frontend

## Overview

WeatherGPT is a location-aware weather application with authenticated dashboards, alerts, conversational weather assistance, and intelligence views. Users sign in, enter the protected app, and can view local weather or use chat and other weather features; chat responses are saved as conversation history. The graph reflects documented routes and sampled calls. Several feature implementations were not excerpted, so their internal data flows are omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/siddith31/weathergpt_frontend/blob/main/src/App.tsx) (Application Router), [`src/hooks/useChat.ts`](https://github.com/siddith31/weathergpt_frontend/blob/main/src/hooks/useChat.ts) (Chat State & Requests), [`src/components/intelligence/SmartCity.tsx`](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/intelligence/SmartCity.tsx) (Smart City), [`src/components/settings/Settings.tsx`](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/settings/Settings.tsx) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Accounts"]
  node_authcontext["Auth Context<br/>[AuthContext.tsx]"]
  node_signin["Sign In<br/>[SignIn.tsx]"]
  node_signup["Sign Up<br/>[SignUp.tsx]"]
  node_supabase["Supabase<br/>[supabase.ts]"]
end

subgraph group_weather["Weather &amp; Alerts"]
  node_dashboard["Weather Dashboard<br/>[Dashboard.tsx]"]
  node_geolocation["Geolocation<br/>[useGeolocation.ts]"]
  node_weatherdata["Weather Data<br/>[openMeteo.ts]"]
  node_alerts["Weather Alerts<br/>[WeatherAlerts.tsx]"]
  node_sachet["SACHET Alerts<br/>[sachetAlerts.ts]"]
end

subgraph group_conversation["Conversation"]
  node_chatui["Chat Interface<br/>[ConversationAI.tsx]"]
  node_chatlogic["Chat State &amp; Requests<br/>[useChat.ts]"]
  node_weathergpt["WeatherGPT Service<br/>[weatherGPT.ts]"]
  node_history["Saved Conversations"]
  node_conversationstorage[("Conversation Storage<br/>[storage.ts]")]
end

subgraph group_insights["Intelligence"]
  node_intelligence["Personal Intelligence"]
  node_smartcity["Smart City<br/>[SmartCity.tsx]"]
  node_climate["Climate Analysis"]
end

subgraph group_app["Application Shell"]
  node_app["Application Router<br/>[App.tsx]"]
  node_layout["App Layout<br/>[AppLayout.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
  node_preferences["Local Preferences<br/>[useLocalStorage.ts]"]
end

node_user(("User"))

node_user -->|"signs in"| node_signin
node_user -->|"registers"| node_signup
node_signin -->|"authenticates"| node_supabase
node_signup -->|"uses signup"| node_authcontext
node_authcontext -->|"loads profile"| node_supabase
node_app -->|"provides auth"| node_authcontext
node_app -->|"routes to"| node_signin
node_app -->|"routes to"| node_signup
node_app -->|"wraps routes"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_chatui
node_app -->|"routes to"| node_alerts
node_app -->|"routes to"| node_intelligence
node_app -->|"routes to"| node_smartcity
node_app -->|"routes to"| node_climate
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_settings
node_dashboard -->|"gets location"| node_geolocation
node_dashboard -->|"fetches weather"| node_weatherdata
node_alerts -->|"gets location"| node_geolocation
node_alerts -->|"fetches alerts"| node_sachet
node_chatui -->|"uses chat state"| node_chatlogic
node_chatlogic -->|"gets location"| node_geolocation
node_chatlogic -->|"sends message"| node_weathergpt
node_chatlogic -->|"saves conversations"| node_conversationstorage
node_history -->|"loads and deletes"| node_conversationstorage
node_smartcity -->|"uses location"| node_geolocation
node_smartcity -->|"fetches weather"| node_weatherdata
node_smartcity -->|"fetches alerts"| node_sachet
node_settings -->|"reads account"| node_authcontext
node_settings -->|"updates profile"| node_supabase
node_settings -->|"persists preferences"| node_preferences

click node_app "https://github.com/siddith31/weathergpt_frontend/blob/main/src/App.tsx"
click node_authcontext "https://github.com/siddith31/weathergpt_frontend/blob/main/src/context/AuthContext.tsx"
click node_signin "https://github.com/siddith31/weathergpt_frontend/blob/main/src/pages/SignIn.tsx"
click node_signup "https://github.com/siddith31/weathergpt_frontend/blob/main/src/pages/SignUp.tsx"
click node_supabase "https://github.com/siddith31/weathergpt_frontend/blob/main/src/lib/supabase.ts"
click node_layout "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/layout/AppLayout.tsx"
click node_dashboard "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/dashboard/Dashboard.tsx"
click node_geolocation "https://github.com/siddith31/weathergpt_frontend/blob/main/src/hooks/useGeolocation.ts"
click node_weatherdata "https://github.com/siddith31/weathergpt_frontend/blob/main/src/services/openMeteo.ts"
click node_alerts "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/alerts/WeatherAlerts.tsx"
click node_sachet "https://github.com/siddith31/weathergpt_frontend/blob/main/src/services/sachetAlerts.ts"
click node_chatui "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/chat/ConversationAI.tsx"
click node_chatlogic "https://github.com/siddith31/weathergpt_frontend/blob/main/src/hooks/useChat.ts"
click node_weathergpt "https://github.com/siddith31/weathergpt_frontend/blob/main/src/services/weatherGPT.ts"
click node_history "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/utility/SavedConversations.tsx"
click node_conversationstorage "https://github.com/siddith31/weathergpt_frontend/blob/main/src/utils/storage.ts"
click node_intelligence "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/intelligence/PersonalIntelligence.tsx"
click node_smartcity "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/intelligence/SmartCity.tsx"
click node_climate "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/intelligence/ClimateAnalysis.tsx"
click node_settings "https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/settings/Settings.tsx"
click node_preferences "https://github.com/siddith31/weathergpt_frontend/blob/main/src/hooks/useLocalStorage.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_authcontext,node_signin,node_signup,node_supabase,node_user toneBlue
class node_dashboard,node_geolocation,node_weatherdata,node_alerts,node_sachet toneAmber
class node_chatui,node_chatlogic,node_weathergpt,node_history,node_conversationstorage toneMint
class node_intelligence,node_smartcity,node_climate toneRose
class node_app,node_layout,node_settings,node_preferences toneIndigo
```

## Components

### Access & Accounts

- [Auth Context](https://github.com/siddith31/weathergpt_frontend/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Sign In](https://github.com/siddith31/weathergpt_frontend/blob/main/src/pages/SignIn.tsx): `src/pages/SignIn.tsx`
- [Sign Up](https://github.com/siddith31/weathergpt_frontend/blob/main/src/pages/SignUp.tsx): `src/pages/SignUp.tsx`
- [Supabase](https://github.com/siddith31/weathergpt_frontend/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Weather & Alerts

- [Weather Dashboard](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/dashboard/Dashboard.tsx): `src/components/dashboard/Dashboard.tsx`
- [Geolocation](https://github.com/siddith31/weathergpt_frontend/blob/main/src/hooks/useGeolocation.ts): `src/hooks/useGeolocation.ts`
- [Weather Data](https://github.com/siddith31/weathergpt_frontend/blob/main/src/services/openMeteo.ts): `src/services/openMeteo.ts`
- [Weather Alerts](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/alerts/WeatherAlerts.tsx): `src/components/alerts/WeatherAlerts.tsx`
- [SACHET Alerts](https://github.com/siddith31/weathergpt_frontend/blob/main/src/services/sachetAlerts.ts): `src/services/sachetAlerts.ts`

### Conversation

- [Chat Interface](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/chat/ConversationAI.tsx): `src/components/chat/ConversationAI.tsx`
- [Chat State & Requests](https://github.com/siddith31/weathergpt_frontend/blob/main/src/hooks/useChat.ts): `src/hooks/useChat.ts`
- [WeatherGPT Service](https://github.com/siddith31/weathergpt_frontend/blob/main/src/services/weatherGPT.ts): `src/services/weatherGPT.ts`
- [Saved Conversations](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/utility/SavedConversations.tsx): `src/components/utility/SavedConversations.tsx`
- [Conversation Storage](https://github.com/siddith31/weathergpt_frontend/blob/main/src/utils/storage.ts): `src/utils/storage.ts`

### Intelligence

- [Personal Intelligence](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/intelligence/PersonalIntelligence.tsx): `src/components/intelligence/PersonalIntelligence.tsx`
- [Smart City](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/intelligence/SmartCity.tsx): `src/components/intelligence/SmartCity.tsx`
- [Climate Analysis](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/intelligence/ClimateAnalysis.tsx): `src/components/intelligence/ClimateAnalysis.tsx`

### Application Shell

- [Application Router](https://github.com/siddith31/weathergpt_frontend/blob/main/src/App.tsx): `src/App.tsx`
- [App Layout](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/layout/AppLayout.tsx): `src/components/layout/AppLayout.tsx`
- [Settings](https://github.com/siddith31/weathergpt_frontend/blob/main/src/components/settings/Settings.tsx): `src/components/settings/Settings.tsx`
- [Local Preferences](https://github.com/siddith31/weathergpt_frontend/blob/main/src/hooks/useLocalStorage.ts): `src/hooks/useLocalStorage.ts`

### Other components

- **User**

## Connections

- User → Sign In: signs in
- User → Sign Up: registers
- Sign In → Supabase: authenticates (evidence: `src/pages/SignIn.tsx`)
- Sign Up → Auth Context: uses signup (evidence: `src/pages/SignUp.tsx`)
- Auth Context → Supabase: loads profile (evidence: `src/context/AuthContext.tsx`)
- Application Router → Auth Context: provides auth (evidence: `src/App.tsx`)
- Application Router → Sign In: routes to (evidence: `src/App.tsx`)
- Application Router → Sign Up: routes to (evidence: `src/App.tsx`)
- Application Router → App Layout: wraps routes (evidence: `src/App.tsx`)
- Application Router → Weather Dashboard: routes to (evidence: `src/App.tsx`)
- Application Router → Chat Interface: routes to (evidence: `src/App.tsx`)
- Application Router → Weather Alerts: routes to (evidence: `src/App.tsx`)
- Application Router → Personal Intelligence: routes to (evidence: `src/App.tsx`)
- Application Router → Smart City: routes to (evidence: `src/App.tsx`)
- Application Router → Climate Analysis: routes to (evidence: `src/App.tsx`)
- Application Router → Saved Conversations: routes to (evidence: `src/App.tsx`)
- Application Router → Settings: routes to (evidence: `src/App.tsx`)
- Weather Dashboard → Geolocation: gets location (evidence: `src/components/dashboard/Dashboard.tsx`)
- Weather Dashboard → Weather Data: fetches weather (evidence: `src/components/dashboard/Dashboard.tsx`)
- Weather Alerts → Geolocation: gets location (evidence: `src/components/alerts/WeatherAlerts.tsx`)
- Weather Alerts → SACHET Alerts: fetches alerts (evidence: `src/components/alerts/WeatherAlerts.tsx`)
- Chat Interface → Chat State & Requests: uses chat state (evidence: `src/components/chat/ConversationAI.tsx`)
- Chat State & Requests → Geolocation: gets location (evidence: `src/hooks/useChat.ts`)
- Chat State & Requests → WeatherGPT Service: sends message (evidence: `src/hooks/useChat.ts`)
- Chat State & Requests → Conversation Storage: saves conversations (evidence: `src/hooks/useChat.ts`)
- Saved Conversations → Conversation Storage: loads and deletes (evidence: `src/components/utility/SavedConversations.tsx`)
- Smart City → Geolocation: uses location (evidence: `src/components/intelligence/SmartCity.tsx`)
- Smart City → Weather Data: fetches weather (evidence: `src/components/intelligence/SmartCity.tsx`)
- Smart City → SACHET Alerts: fetches alerts (evidence: `src/components/intelligence/SmartCity.tsx`)
- Settings → Auth Context: reads account (evidence: `src/components/settings/Settings.tsx`)
- Settings → Supabase: updates profile (evidence: `src/components/settings/Settings.tsx`)
- Settings → Local Preferences: persists preferences (evidence: `src/components/settings/Settings.tsx`)
