# manojrajan-lab/flask-weather architecture

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

- Interactive diagram: https://gitdiagram.com/manojrajan-lab/flask-weather
- Repository: https://github.com/manojrajan-lab/flask-weather

## Overview

This small Flask app accepts a city query, fetches current conditions from OpenWeatherMap, then renders either a weather result or a not-found page. The route and API call are visible in the sampled Python files; template contents and their form wiring were not sampled, so no template-to-route interaction is asserted.

Main entry points: [`server.py`](https://github.com/manojrajan-lab/flask-weather/blob/main/server.py) (Flask routes), [`weather.py`](https://github.com/manojrajan-lab/flask-weather/blob/main/weather.py) (Weather lookup), [`templates/index.html`](https://github.com/manojrajan-lab/flask-weather/blob/main/templates/index.html) (Search page), [`templates/weather.html`](https://github.com/manojrajan-lab/flask-weather/blob/main/templates/weather.html) (Weather result)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_server["Flask routes<br/>[server.py]"]
  node_search["Search page<br/>[index.html]"]
  node_result["Weather result<br/>[weather.html]"]
  node_notfound["Not-found page"]
end

subgraph group_weather["Weather lookup"]
  node_lookup["Weather lookup<br/>[weather.py]"]
end

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

node_user -->|"requests page"| node_server
node_server -->|"renders"| node_search
node_server -->|"calls"| node_lookup
node_lookup -->|"requests conditions"| node_openweather
node_server -->|"renders on success"| node_result
node_server -->|"renders on failure"| node_notfound

click node_server "https://github.com/manojrajan-lab/flask-weather/blob/main/server.py"
click node_search "https://github.com/manojrajan-lab/flask-weather/blob/main/templates/index.html"
click node_result "https://github.com/manojrajan-lab/flask-weather/blob/main/templates/weather.html"
click node_notfound "https://github.com/manojrajan-lab/flask-weather/blob/main/templates/city_not_found.html"
click node_lookup "https://github.com/manojrajan-lab/flask-weather/blob/main/weather.py"

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_server,node_search,node_result,node_notfound,node_user toneBlue
class node_lookup toneAmber
class node_openweather toneMint
```

## Components

### Web interface

- [Flask routes](https://github.com/manojrajan-lab/flask-weather/blob/main/server.py): `server.py`
- [Search page](https://github.com/manojrajan-lab/flask-weather/blob/main/templates/index.html): `templates/index.html`
- [Weather result](https://github.com/manojrajan-lab/flask-weather/blob/main/templates/weather.html): `templates/weather.html`
- [Not-found page](https://github.com/manojrajan-lab/flask-weather/blob/main/templates/city_not_found.html): `templates/city_not_found.html`

### Weather lookup

- [Weather lookup](https://github.com/manojrajan-lab/flask-weather/blob/main/weather.py): `weather.py`

### Other components

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

## Connections

- User → Flask routes: requests page (evidence: `server.py`)
- Flask routes → Search page: renders (evidence: `server.py`)
- Flask routes → Weather lookup: calls (evidence: `server.py`)
- Weather lookup → OpenWeatherMap API: requests conditions (evidence: `weather.py`)
- Flask routes → Weather result: renders on success (evidence: `server.py`)
- Flask routes → Not-found page: renders on failure (evidence: `server.py`)
