# saadyasin/weathernow architecture

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

- Interactive diagram: https://gitdiagram.com/saadyasin/weathernow
- Repository: https://github.com/saadyasin/weathernow

## Overview

WeatherNow is a React weather dashboard. A user searches for a city; the selector retrieves matching locations, and choosing one prompts the app to fetch current conditions and forecast data. The app then presents current weather, details, and hourly and daily forecasts, with temperature-unit switching. OpenWeatherMap is the external data source. The excerpts show the main UI, API, formatting, and display components; other product behavior is not inferred beyond the README and source index.

Main entry points: [`src/App.tsx`](https://github.com/saadyasin/weathernow/blob/main/src/App.tsx) (Dashboard), [`src/services/weatherApi.ts`](https://github.com/saadyasin/weathernow/blob/main/src/services/weatherApi.ts) (Weather API), [`src/components/WeatherIcon.tsx`](https://github.com/saadyasin/weathernow/blob/main/src/components/WeatherIcon.tsx) (Weather icons), [`src/utils/weather.ts`](https://github.com/saadyasin/weathernow/blob/main/src/utils/weather.ts) (Weather formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["React entry<br/>[main.tsx]"]
  node_dashboard["Dashboard<br/>[App.tsx]"]
  node_city["City selector<br/>[CitySelector.tsx]"]
end

subgraph group_data["Weather data"]
  node_api["Weather API<br/>[weatherApi.ts]"]
end

subgraph group_views["Weather views"]
  node_current["Current conditions<br/>[CurrentWeather.tsx]"]
  node_details["Weather details<br/>[WeatherDetails.tsx]"]
  node_hourly["Hourly forecast<br/>[HourlyForecast.tsx]"]
  node_daily["Daily forecast<br/>[DailyForecast.tsx]"]
  node_icon["Weather icons<br/>[WeatherIcon.tsx]"]
end

subgraph group_shared["Shared logic"]
  node_format["Weather formatting<br/>[weather.ts]"]
  node_types["Weather types<br/>[types.ts]"]
end

node_user(("User"))
node_openweather["OpenWeatherMap"]

node_user -->|"searches"| node_city
node_city -->|"searches cities"| node_api
node_api -->|"requests geocoding"| node_openweather
node_city -->|"selects city"| node_dashboard
node_dashboard -->|"fetches weather"| node_api
node_api -->|"fetches conditions"| node_openweather
node_entry -->|"renders"| node_dashboard
node_dashboard -->|"renders"| node_current
node_dashboard -->|"renders"| node_details
node_dashboard -->|"renders"| node_hourly
node_dashboard -->|"renders"| node_daily
node_current -->|"renders"| node_icon
node_hourly -->|"renders"| node_icon
node_daily -->|"renders"| node_icon
node_details -->|"imports icon helper"| node_icon
node_current -->|"formats values"| node_format
node_details -->|"formats values"| node_format
node_hourly -->|"formats values"| node_format
node_daily -->|"formats values"| node_format

click node_entry "https://github.com/saadyasin/weathernow/blob/main/src/main.tsx"
click node_dashboard "https://github.com/saadyasin/weathernow/blob/main/src/App.tsx"
click node_city "https://github.com/saadyasin/weathernow/blob/main/src/components/CitySelector.tsx"
click node_api "https://github.com/saadyasin/weathernow/blob/main/src/services/weatherApi.ts"
click node_current "https://github.com/saadyasin/weathernow/blob/main/src/components/CurrentWeather.tsx"
click node_details "https://github.com/saadyasin/weathernow/blob/main/src/components/WeatherDetails.tsx"
click node_hourly "https://github.com/saadyasin/weathernow/blob/main/src/components/HourlyForecast.tsx"
click node_daily "https://github.com/saadyasin/weathernow/blob/main/src/components/DailyForecast.tsx"
click node_icon "https://github.com/saadyasin/weathernow/blob/main/src/components/WeatherIcon.tsx"
click node_format "https://github.com/saadyasin/weathernow/blob/main/src/utils/weather.ts"
click node_types "https://github.com/saadyasin/weathernow/blob/main/src/types.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_entry,node_dashboard,node_city,node_user toneBlue
class node_api toneAmber
class node_current,node_details,node_hourly,node_daily,node_icon toneMint
class node_format,node_types toneRose
class node_openweather toneIndigo
```

## Components

### Application

- [React entry](https://github.com/saadyasin/weathernow/blob/main/src/main.tsx): `src/main.tsx`
- [Dashboard](https://github.com/saadyasin/weathernow/blob/main/src/App.tsx): `src/App.tsx`
- [City selector](https://github.com/saadyasin/weathernow/blob/main/src/components/CitySelector.tsx): `src/components/CitySelector.tsx`

### Weather data

- [Weather API](https://github.com/saadyasin/weathernow/blob/main/src/services/weatherApi.ts): `src/services/weatherApi.ts`

### Weather views

- [Current conditions](https://github.com/saadyasin/weathernow/blob/main/src/components/CurrentWeather.tsx): `src/components/CurrentWeather.tsx`
- [Weather details](https://github.com/saadyasin/weathernow/blob/main/src/components/WeatherDetails.tsx): `src/components/WeatherDetails.tsx`
- [Hourly forecast](https://github.com/saadyasin/weathernow/blob/main/src/components/HourlyForecast.tsx): `src/components/HourlyForecast.tsx`
- [Daily forecast](https://github.com/saadyasin/weathernow/blob/main/src/components/DailyForecast.tsx): `src/components/DailyForecast.tsx`
- [Weather icons](https://github.com/saadyasin/weathernow/blob/main/src/components/WeatherIcon.tsx): `src/components/WeatherIcon.tsx`

### Shared logic

- [Weather formatting](https://github.com/saadyasin/weathernow/blob/main/src/utils/weather.ts): `src/utils/weather.ts`
- [Weather types](https://github.com/saadyasin/weathernow/blob/main/src/types.ts): `src/types.ts`

### Other components

- **User**
- **OpenWeatherMap**

## Connections

- User → City selector: searches (evidence: `src/components/CitySelector.tsx`)
- City selector → Weather API: searches cities (evidence: `src/components/CitySelector.tsx`)
- Weather API → OpenWeatherMap: requests geocoding (evidence: `src/services/weatherApi.ts`)
- City selector → Dashboard: selects city (evidence: `src/components/CitySelector.tsx`)
- Dashboard → Weather API: fetches weather (evidence: `src/App.tsx`)
- Weather API → OpenWeatherMap: fetches conditions (evidence: `src/services/weatherApi.ts`)
- React entry → Dashboard: renders (evidence: `src/main.tsx`)
- Dashboard → Current conditions: renders (evidence: `src/App.tsx`)
- Dashboard → Weather details: renders (evidence: `src/App.tsx`)
- Dashboard → Hourly forecast: renders (evidence: `src/App.tsx`)
- Dashboard → Daily forecast: renders (evidence: `src/App.tsx`)
- Current conditions → Weather icons: renders (evidence: `src/components/CurrentWeather.tsx`)
- Hourly forecast → Weather icons: renders (evidence: `src/components/HourlyForecast.tsx`)
- Daily forecast → Weather icons: renders (evidence: `src/components/DailyForecast.tsx`)
- Weather details → Weather icons: imports icon helper (evidence: `src/components/WeatherDetails.tsx`)
- Current conditions → Weather formatting: formats values (evidence: `src/components/CurrentWeather.tsx`)
- Weather details → Weather formatting: formats values (evidence: `src/components/WeatherDetails.tsx`)
- Hourly forecast → Weather formatting: formats values (evidence: `src/components/HourlyForecast.tsx`)
- Daily forecast → Weather formatting: formats values (evidence: `src/components/DailyForecast.tsx`)
