# craw-code/craw-weather-app architecture

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

- Interactive diagram: https://gitdiagram.com/craw-code/craw-weather-app
- Repository: https://github.com/craw-code/craw-weather-app

## Overview

This is a small browser weather app. Users can search a city or request weather for their current location; the app fetches current conditions and, for city searches, a forecast, then renders the results and supports Celsius/Fahrenheit display. The runtime is concentrated in `src/index.js`; the excerpts show its event wiring and API calls, but no README or HTML/CSS contents were provided.

Main entry points: [`src/index.js`](https://github.com/craw-code/craw-weather-app/blob/master/src/index.js) (Weather controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controls["Search and controls"]
  node_controller["Weather controls<br/>[index.js]"]
end

subgraph group_weather["Weather display"]
  node_current["Current conditions<br/>[index.js]"]
  node_forecast["Hourly forecast<br/>[index.js]"]
  node_units["Temperature units<br/>[index.js]"]
end

node_user(("User"))
node_geolocation["Browser geolocation"]
node_weather_api["OpenWeather API"]

node_user -->|"submits or clicks"| node_controller
node_controller -->|"requests position"| node_geolocation
node_geolocation -->|"provides coordinates"| node_controller
node_controller -->|"requests weather"| node_weather_api
node_controller -->|"passes response"| node_current
node_controller -->|"passes forecast"| node_forecast
node_controller -->|"handles unit clicks"| node_units

click node_controller "https://github.com/craw-code/craw-weather-app/blob/master/src/index.js"
click node_current "https://github.com/craw-code/craw-weather-app/blob/master/src/index.js"
click node_forecast "https://github.com/craw-code/craw-weather-app/blob/master/src/index.js"
click node_units "https://github.com/craw-code/craw-weather-app/blob/master/src/index.js"

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_controller,node_user,node_geolocation toneBlue
class node_current,node_forecast,node_units toneAmber
class node_weather_api toneMint
```

## Components

### Search and controls

- [Weather controls](https://github.com/craw-code/craw-weather-app/blob/master/src/index.js): `src/index.js`

### Weather display

- [Current conditions](https://github.com/craw-code/craw-weather-app/blob/master/src/index.js): `src/index.js`
- [Hourly forecast](https://github.com/craw-code/craw-weather-app/blob/master/src/index.js): `src/index.js`
- [Temperature units](https://github.com/craw-code/craw-weather-app/blob/master/src/index.js): `src/index.js`

### Other components

- **User**
- **Browser geolocation**
- **OpenWeather API**

## Connections

- User → Weather controls: submits or clicks (evidence: `src/index.js`)
- Weather controls → Browser geolocation: requests position (evidence: `src/index.js`)
- Browser geolocation → Weather controls: provides coordinates (evidence: `src/index.js`)
- Weather controls → OpenWeather API: requests weather (evidence: `src/index.js`)
- Weather controls → Current conditions: passes response (evidence: `src/index.js`)
- Weather controls → Hourly forecast: passes forecast (evidence: `src/index.js`)
- Weather controls → Temperature units: handles unit clicks (evidence: `src/index.js`)
