# sarveshwaran20/global-temperature-tracker architecture

> Architecture diagram of the GitHub repository sarveshwaran20/global-temperature-tracker, 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/sarveshwaran20/global-temperature-tracker
- Repository: https://github.com/sarveshwaran20/global-temperature-tracker

## Overview

The repository is a browser-based temperature-tracking and climate-awareness platform, with a Flask/MySQL community pledge and voting backend. The main user workflow is viewing city temperatures and comparing weather; separate pages provide climate education, maps, alerts, and Earth-pulse content. Sampled JavaScript shows direct calls to OpenWeatherMap and a climate-news service, while the backend routes pledge and vote requests through database operations. Some page wiring and feature implementations are unsampled, so their internal connections are left unspecified.

Main entry points: [`script.js`](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/script.js) (Browser logic), [`web_server.py`](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/web_server.py) (Pledge and vote API), [`database_operations.py`](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/database_operations.py) (Database operations), [`generate_sample_data.py`](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/generate_sample_data.py) (Sample data generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_home["Home page<br/>[index.html]"]
  node_temperature["Temperature views<br/>[data.html]"]
  node_map["Interactive map<br/>[map.html]"]
  node_frontend["Browser logic<br/>[script.js]"]
end

subgraph group_climate["Climate content"]
  node_awareness["Awareness page<br/>[awareness.html]"]
  node_alerts["Climate alerts<br/>[alert.html]"]
  node_earthpulse["Earth pulse<br/>[earth_pulse.html]"]
  node_news["Climate news"]
end

subgraph group_community["Community backend"]
  node_api["Pledge and vote API<br/>[web_server.py]"]
  node_dbops["Database operations"]
  node_mysqldb[("MySQL store")]
  node_flask["Flask runtime"]
end

subgraph group_data["Temperature data"]
  node_weather["Weather service"]
  node_sampledata["Temperature CSV"]
  node_samplegenerator["Sample data generator"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"views"| node_temperature
node_visitor -->|"views"| node_map
node_visitor -->|"visits"| node_awareness
node_visitor -->|"views"| node_alerts
node_visitor -->|"views"| node_earthpulse
node_frontend -->|"fetches weather"| node_weather
node_frontend -->|"fetches news"| node_news
node_samplegenerator -->|"writes sample"| node_sampledata
node_api -->|"calls"| node_dbops
node_dbops -->|"reads and writes"| node_mysqldb
node_flask -->|"runs routes"| node_api

click node_home "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/index.html"
click node_temperature "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/data.html"
click node_map "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/map.html"
click node_awareness "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/awareness.html"
click node_alerts "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/alert.html"
click node_earthpulse "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/earth_pulse.html"
click node_frontend "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/script.js"
click node_sampledata "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/global_temperatures.csv"
click node_samplegenerator "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/generate_sample_data.py"
click node_api "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/web_server.py"
click node_dbops "https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/database_operations.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_home,node_temperature,node_map,node_frontend toneBlue
class node_awareness,node_alerts,node_earthpulse,node_news toneAmber
class node_api,node_dbops,node_mysqldb,node_flask toneMint
class node_weather,node_sampledata,node_samplegenerator toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Home page](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/index.html): `index.html`
- [Temperature views](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/data.html): `data.html`
- [Interactive map](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/map.html): `map.html`
- [Browser logic](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/script.js): `script.js`

### Climate content

- [Awareness page](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/awareness.html): `awareness.html`
- [Climate alerts](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/alert.html): `alert.html`
- [Earth pulse](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/earth_pulse.html): `earth_pulse.html`
- **Climate news**

### Community backend

- [Pledge and vote API](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/web_server.py): `web_server.py`
- [Database operations](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/database_operations.py): `database_operations.py`
- **MySQL store**
- **Flask runtime**

### Temperature data

- **Weather service**
- [Temperature CSV](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/global_temperatures.csv): `global_temperatures.csv`
- [Sample data generator](https://github.com/sarveshwaran20/global-temperature-tracker/blob/main/generate_sample_data.py): `generate_sample_data.py`

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens (evidence: `README.md`)
- Visitor → Temperature views: views (evidence: `README.md`)
- Visitor → Interactive map: views (evidence: `README.md`)
- Visitor → Awareness page: visits (evidence: `README.md`)
- Visitor → Climate alerts: views (evidence: `README.md`)
- Visitor → Earth pulse: views (evidence: `README.md`)
- Browser logic → Weather service: fetches weather (evidence: `script.js`)
- Browser logic → Climate news: fetches news (evidence: `script.js`)
- Sample data generator → Temperature CSV: writes sample (evidence: `generate_sample_data.py`)
- Pledge and vote API → Database operations: calls (evidence: `web_server.py`)
- Database operations → MySQL store: reads and writes (evidence: `database_operations.py`)
- Flask runtime → Pledge and vote API: runs routes (evidence: `web_server.py`)
