# antonyremay/elite-weather architecture

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

- Interactive diagram: https://gitdiagram.com/antonyremay/elite-weather
- Repository: https://github.com/antonyremay/elite-weather

## Overview

Elite Weather is a React weather dashboard. A visitor is routed to sign-in or the authenticated app; weather views request a city’s forecast, then display current conditions, forecasts, air quality, and alerts. Authentication and preferences are stored locally, while weather data comes from WeatherAPI. The excerpts show routing, provider setup, weather fetching, and air-quality rendering; relationships for unsampled pages and forecast components are left out rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/antonyremay/elite-weather/blob/main/src/App.tsx) (App router), [`src/contexts/WeatherContext.tsx`](https://github.com/antonyremay/elite-weather/blob/main/src/contexts/WeatherContext.tsx) (Weather context), [`src/contexts/AuthContext.tsx`](https://github.com/antonyremay/elite-weather/blob/main/src/contexts/AuthContext.tsx) (Auth context), [`src/pages/AirQualityPage.tsx`](https://github.com/antonyremay/elite-weather/blob/main/src/pages/AirQualityPage.tsx) (Air quality)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app_entry["App router<br/>[App.tsx]"]
  node_layout["Main layout<br/>[MainLayout.tsx]"]
  node_index["Entry redirect<br/>[Index.tsx]"]
end

subgraph group_identity["Identity and preferences"]
  node_login["Login<br/>[Login.tsx]"]
  node_signup["Signup<br/>[Signup.tsx]"]
  node_auth["Auth context<br/>[AuthContext.tsx]"]
  node_profile["Profile<br/>[Profile.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
end

subgraph group_weather["Weather data and views"]
  node_home["Home<br/>[Home.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_air_quality["Air quality<br/>[AirQualityPage.tsx]"]
  node_alerts["Alerts<br/>[Alerts.tsx]"]
  node_weather_context["Weather context<br/>[WeatherContext.tsx]"]
  node_weather_api["Weather API client<br/>[weatherApi.ts]"]
  node_forecast_views["Forecast selectors"]
end

subgraph group_shared["Shared UI and domain"]
  node_air_utils["Air quality formatting<br/>[weatherUtils.ts]"]
  node_weather_types["Weather and user types<br/>[weather.ts]"]
end

node_visitor(("Visitor"))
node_local_storage[("Browser storage")]
node_weatherapi["WeatherAPI"]

node_visitor -->|"opens"| node_app_entry
node_app_entry -->|"routes to"| node_index
node_app_entry -->|"routes to"| node_login
node_app_entry -->|"routes to"| node_signup
node_app_entry -->|"wraps routes"| node_layout
node_app_entry -->|"provides"| node_auth
node_app_entry -->|"provides"| node_weather_context
node_app_entry -->|"routes to"| node_home
node_app_entry -->|"routes to"| node_dashboard
node_app_entry -->|"routes to"| node_air_quality
node_app_entry -->|"routes to"| node_alerts
node_app_entry -->|"routes to"| node_profile
node_app_entry -->|"routes to"| node_settings
node_index -->|"checks session"| node_auth
node_auth -->|"reads and writes"| node_local_storage
node_settings -->|"updates preferences"| node_auth
node_air_quality -->|"loads weather"| node_weather_context
node_air_quality -->|"formats AQI"| node_air_utils
node_weather_context -->|"requests data"| node_weather_api
node_weather_api -->|"fetches forecast"| node_weatherapi
node_weather_context -->|"uses data types"| node_weather_types
node_air_utils -->|"uses data types"| node_weather_types

click node_app_entry "https://github.com/antonyremay/elite-weather/blob/main/src/App.tsx"
click node_layout "https://github.com/antonyremay/elite-weather/blob/main/src/components/layout/MainLayout.tsx"
click node_index "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Index.tsx"
click node_login "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Login.tsx"
click node_signup "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Signup.tsx"
click node_auth "https://github.com/antonyremay/elite-weather/blob/main/src/contexts/AuthContext.tsx"
click node_profile "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Profile.tsx"
click node_settings "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Settings.tsx"
click node_home "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Home.tsx"
click node_dashboard "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Dashboard.tsx"
click node_air_quality "https://github.com/antonyremay/elite-weather/blob/main/src/pages/AirQualityPage.tsx"
click node_alerts "https://github.com/antonyremay/elite-weather/blob/main/src/pages/Alerts.tsx"
click node_weather_context "https://github.com/antonyremay/elite-weather/blob/main/src/contexts/WeatherContext.tsx"
click node_weather_api "https://github.com/antonyremay/elite-weather/blob/main/src/services/weatherApi.ts"
click node_air_utils "https://github.com/antonyremay/elite-weather/blob/main/src/utils/weatherUtils.ts"
click node_weather_types "https://github.com/antonyremay/elite-weather/blob/main/src/types/weather.ts"
click node_forecast_views "https://github.com/antonyremay/elite-weather/tree/main/src/components/weather"

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_entry,node_layout,node_index toneBlue
class node_login,node_signup,node_auth,node_profile,node_settings,node_local_storage toneAmber
class node_home,node_dashboard,node_air_quality,node_alerts,node_weather_context,node_weather_api,node_forecast_views,node_weatherapi toneMint
class node_air_utils,node_weather_types toneRose
class node_visitor toneIndigo
```

## Components

### App and navigation

- [App router](https://github.com/antonyremay/elite-weather/blob/main/src/App.tsx): `src/App.tsx`
- [Main layout](https://github.com/antonyremay/elite-weather/blob/main/src/components/layout/MainLayout.tsx): `src/components/layout/MainLayout.tsx`
- [Entry redirect](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`

### Identity and preferences

- [Login](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Signup](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Signup.tsx): `src/pages/Signup.tsx`
- [Auth context](https://github.com/antonyremay/elite-weather/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Profile](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Settings](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`

### Weather data and views

- [Home](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Dashboard](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Air quality](https://github.com/antonyremay/elite-weather/blob/main/src/pages/AirQualityPage.tsx): `src/pages/AirQualityPage.tsx`
- [Alerts](https://github.com/antonyremay/elite-weather/blob/main/src/pages/Alerts.tsx): `src/pages/Alerts.tsx`
- [Weather context](https://github.com/antonyremay/elite-weather/blob/main/src/contexts/WeatherContext.tsx): `src/contexts/WeatherContext.tsx`
- [Weather API client](https://github.com/antonyremay/elite-weather/blob/main/src/services/weatherApi.ts): `src/services/weatherApi.ts`
- [Forecast selectors](https://github.com/antonyremay/elite-weather/tree/main/src/components/weather): `src/components/weather`

### Shared UI and domain

- [Air quality formatting](https://github.com/antonyremay/elite-weather/blob/main/src/utils/weatherUtils.ts): `src/utils/weatherUtils.ts`
- [Weather and user types](https://github.com/antonyremay/elite-weather/blob/main/src/types/weather.ts): `src/types/weather.ts`

### Other components

- **Visitor**
- **Browser storage**
- **WeatherAPI**

## Connections

- Visitor → App router: opens
- App router → Entry redirect: routes to (evidence: `src/App.tsx`)
- App router → Login: routes to (evidence: `src/App.tsx`)
- App router → Signup: routes to (evidence: `src/App.tsx`)
- App router → Main layout: wraps routes (evidence: `src/App.tsx`)
- App router → Auth context: provides (evidence: `src/App.tsx`)
- App router → Weather context: provides (evidence: `src/App.tsx`)
- App router → Home: routes to (evidence: `src/App.tsx`)
- App router → Dashboard: routes to (evidence: `src/App.tsx`)
- App router → Air quality: routes to (evidence: `src/App.tsx`)
- App router → Alerts: routes to (evidence: `src/App.tsx`)
- App router → Profile: routes to (evidence: `src/App.tsx`)
- App router → Settings: routes to (evidence: `src/App.tsx`)
- Entry redirect → Auth context: checks session (evidence: `src/pages/Index.tsx`)
- Auth context → Browser storage: reads and writes (evidence: `src/contexts/AuthContext.tsx`)
- Settings → Auth context: updates preferences (evidence: `src/pages/Settings.tsx`)
- Air quality → Weather context: loads weather (evidence: `src/pages/AirQualityPage.tsx`)
- Air quality → Air quality formatting: formats AQI (evidence: `src/pages/AirQualityPage.tsx`)
- Weather context → Weather API client: requests data (evidence: `src/contexts/WeatherContext.tsx`)
- Weather API client → WeatherAPI: fetches forecast (evidence: `src/services/weatherApi.ts`)
- Weather context → Weather and user types: uses data types (evidence: `src/contexts/WeatherContext.tsx`)
- Air quality formatting → Weather and user types: uses data types (evidence: `src/utils/weatherUtils.ts`)
