# ritesh23s/react-weather architecture

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

- Interactive diagram: https://gitdiagram.com/ritesh23s/react-weather
- Repository: https://github.com/ritesh23s/react-weather

## Overview

WeatherNow is a React weather dashboard. A user searches for a city (or selects a recent search); App fetches current conditions and forecast data from OpenWeather, then renders current, hourly, and weekly views. The dashboard also provides unit and theme controls plus persistent search history. The graph reflects the sampled runtime code and README capabilities; mock mode is documented, but its implementation was not present in the sampled App excerpt, so it is not mapped as a verified flow.

Main entry points: [`src/App.jsx`](https://github.com/ritesh23s/react-weather/blob/main/src/App.jsx) (Dashboard and search), [`src/components/HourlyForecast.jsx`](https://github.com/ritesh23s/react-weather/blob/main/src/components/HourlyForecast.jsx) (Hourly forecast), [`src/components/WeeklyForecast.jsx`](https://github.com/ritesh23s/react-weather/blob/main/src/components/WeeklyForecast.jsx) (Weekly forecast), [`src/utils/iconMap.js`](https://github.com/ritesh23s/react-weather/blob/main/src/utils/iconMap.js) (Weather icon mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["Dashboard and search<br/>[App.jsx]"]
  node_styles["Dashboard styling"]
end

subgraph group_weather["Weather views"]
  node_current["Current conditions<br/>[WeatherCard.jsx]"]
  node_hourly["Hourly forecast<br/>[HourlyForecast.jsx]"]
  node_weekly["Weekly forecast<br/>[WeeklyForecast.jsx]"]
end

subgraph group_preferences["History and preferences"]
  node_history["Search history<br/>[SearchHistory.jsx]"]
  node_units["Temperature toggle"]
  node_theme["Theme toggle<br/>[ThemeToggle.jsx]"]
end

subgraph group_helpers["Display helpers"]
  node_icons["Weather icon mapping<br/>[iconMap.js]"]
  node_conversion["Temperature conversion<br/>[tempConvert.js]"]
end

node_user(("Weather app user"))
node_openweather["OpenWeather API"]
node_storage[("Browser localStorage")]

node_user -->|"opens dashboard"| node_entry
node_entry -->|"renders"| node_app
node_user -->|"searches city"| node_app
node_app -->|"fetches weather and forecast"| node_openweather
node_app -->|"loads and saves preferences"| node_storage
node_app -->|"renders current data"| node_current
node_app -->|"renders forecast data"| node_hourly
node_app -->|"renders forecast data"| node_weekly
node_app -->|"renders and supplies callbacks"| node_history
node_history -->|"invokes selection or delete callback"| node_app
node_app -->|"renders unit control"| node_units
node_app -->|"renders theme control"| node_theme
node_theme -->|"reads and saves theme"| node_storage
node_current -->|"maps condition icon"| node_icons
node_hourly -->|"maps condition icons"| node_icons
node_hourly -->|"converts temperatures"| node_conversion
node_weekly -->|"maps condition icons"| node_icons
node_weekly -->|"converts temperatures"| node_conversion
node_app -->|"imports dashboard styles"| node_styles

click node_entry "https://github.com/ritesh23s/react-weather/blob/main/src/main.jsx"
click node_app "https://github.com/ritesh23s/react-weather/blob/main/src/App.jsx"
click node_current "https://github.com/ritesh23s/react-weather/blob/main/src/components/WeatherCard.jsx"
click node_hourly "https://github.com/ritesh23s/react-weather/blob/main/src/components/HourlyForecast.jsx"
click node_weekly "https://github.com/ritesh23s/react-weather/blob/main/src/components/WeeklyForecast.jsx"
click node_history "https://github.com/ritesh23s/react-weather/blob/main/src/components/SearchHistory.jsx"
click node_units "https://github.com/ritesh23s/react-weather/blob/main/src/components/TemperatureToggle.jsx"
click node_theme "https://github.com/ritesh23s/react-weather/blob/main/src/components/ThemeToggle.jsx"
click node_icons "https://github.com/ritesh23s/react-weather/blob/main/src/utils/iconMap.js"
click node_conversion "https://github.com/ritesh23s/react-weather/blob/main/src/utils/tempConvert.js"
click node_styles "https://github.com/ritesh23s/react-weather/tree/main/src/styles"

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_app,node_styles,node_user toneBlue
class node_current,node_hourly,node_weekly,node_storage toneAmber
class node_history,node_units,node_theme,node_openweather toneMint
class node_icons,node_conversion toneRose
```

## Components

### App runtime

- [React entry](https://github.com/ritesh23s/react-weather/blob/main/src/main.jsx): `src/main.jsx`
- [Dashboard and search](https://github.com/ritesh23s/react-weather/blob/main/src/App.jsx): `src/App.jsx`
- [Dashboard styling](https://github.com/ritesh23s/react-weather/tree/main/src/styles): `src/styles`

### Weather views

- [Current conditions](https://github.com/ritesh23s/react-weather/blob/main/src/components/WeatherCard.jsx): `src/components/WeatherCard.jsx`
- [Hourly forecast](https://github.com/ritesh23s/react-weather/blob/main/src/components/HourlyForecast.jsx): `src/components/HourlyForecast.jsx`
- [Weekly forecast](https://github.com/ritesh23s/react-weather/blob/main/src/components/WeeklyForecast.jsx): `src/components/WeeklyForecast.jsx`

### History and preferences

- [Search history](https://github.com/ritesh23s/react-weather/blob/main/src/components/SearchHistory.jsx): `src/components/SearchHistory.jsx`
- [Temperature toggle](https://github.com/ritesh23s/react-weather/blob/main/src/components/TemperatureToggle.jsx): `src/components/TemperatureToggle.jsx`
- [Theme toggle](https://github.com/ritesh23s/react-weather/blob/main/src/components/ThemeToggle.jsx): `src/components/ThemeToggle.jsx`

### Display helpers

- [Weather icon mapping](https://github.com/ritesh23s/react-weather/blob/main/src/utils/iconMap.js): `src/utils/iconMap.js`
- [Temperature conversion](https://github.com/ritesh23s/react-weather/blob/main/src/utils/tempConvert.js): `src/utils/tempConvert.js`

### Other components

- **Weather app user**
- **OpenWeather API**
- **Browser localStorage**

## Connections

- Weather app user → React entry: opens dashboard (evidence: `src/main.jsx`)
- React entry → Dashboard and search: renders (evidence: `src/main.jsx`)
- Weather app user → Dashboard and search: searches city (evidence: `src/App.jsx`)
- Dashboard and search → OpenWeather API: fetches weather and forecast (evidence: `src/App.jsx`)
- Dashboard and search → Browser localStorage: loads and saves preferences (evidence: `src/App.jsx`)
- Dashboard and search → Current conditions: renders current data (evidence: `src/App.jsx`)
- Dashboard and search → Hourly forecast: renders forecast data (evidence: `src/App.jsx`)
- Dashboard and search → Weekly forecast: renders forecast data (evidence: `src/App.jsx`)
- Dashboard and search → Search history: renders and supplies callbacks (evidence: `src/App.jsx`)
- Search history → Dashboard and search: invokes selection or delete callback (evidence: `src/components/SearchHistory.jsx`)
- Dashboard and search → Temperature toggle: renders unit control (evidence: `src/App.jsx`)
- Dashboard and search → Theme toggle: renders theme control (evidence: `src/App.jsx`)
- Theme toggle → Browser localStorage: reads and saves theme (evidence: `src/components/ThemeToggle.jsx`)
- Current conditions → Weather icon mapping: maps condition icon (evidence: `src/components/WeatherCard.jsx`)
- Hourly forecast → Weather icon mapping: maps condition icons (evidence: `src/components/HourlyForecast.jsx`)
- Hourly forecast → Temperature conversion: converts temperatures (evidence: `src/components/HourlyForecast.jsx`)
- Weekly forecast → Weather icon mapping: maps condition icons (evidence: `src/components/WeeklyForecast.jsx`)
- Weekly forecast → Temperature conversion: converts temperatures (evidence: `src/components/WeeklyForecast.jsx`)
- Dashboard and search → Dashboard styling: imports dashboard styles (evidence: `src/App.jsx`)
