# adnanbhutta/forecastnest architecture

> Architecture diagram of the GitHub repository adnanbhutta/forecastnest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adnanbhutta/forecastnest
- Repository: https://github.com/adnanbhutta/forecastnest

## Overview

##### Project type and purpose
- This is a full-stack web application (“Django Weather App”) built on the Django (MVT) framework.
- It provides real-time weather data and dynamic background images by integrating with two external APIs (OpenWeatherMap & Google Custom Search).

##### File structure
- Top-level:
- manage.py (entry point for Django CLI)
- db.sqlite3 (local development database)
- assets, static (CSS, images)
- weatherproject/ (Django project settings, URL routing, WSGI/ASGI)
- weatherapp/ (Django app: views, URLs, templates, static files, migrations)
- Patterns:
- MVT (Model-View-Template) with no complex microservices—just one app.
- API clients are invoked in views.py.
- Static files served via Django’s static pipeline.

##### README for additional insights
- Backend: Django 5.x, Python 3.x
- Frontend: Responsive HTML/CSS (glassmorphism)
- APIs:
- OpenWeatherMap JSON API (weather data)
- Google Custom Search JSON API (background images)
- Deployment ready for Heroku/Vercel.

##### Essential elements to capture
- Labels on nodes: exactly match component names (e.g., “weatherapp/views.py”).
- Arrowheads showing direction of data flow.
- A note on environment variables (.env) in settings.py for API keys.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Nodes
    CB(("Client Browser")):::frontend
    manage(("manage.py")):::backend
    ASGI(("ASGI\nweatherproject/asgi.py")):::backend
    WSGI(("WSGI\nweatherproject/wsgi.py")):::backend
    Settings(("settings.py\nweatherproject/settings.py")):::backend
    GlobalURLs(("urls.py\nweatherproject/urls.py")):::backend
    AppURLs(("urls.py\nweatherapp/urls.py")):::backend
    Views(("views.py\nweatherapp/views.py")):::backend
    Models(("models.py\nweatherapp/models.py")):::backend
    Migrations(("migrations/\nweatherapp/migrations/")):::backend
    DB(("SQLite\ndb.sqlite3")):::backend
    OpenWeather(("OpenWeatherMap API")):::external
    GoogleCS(("Google Custom Search API")):::external
    Template(("index.html\nweatherapp/templates/weatherapp/index.html")):::frontend
    CSS(("style.css\nstatic/style.css")):::frontend
    Assets(("assets/")):::frontend

    %% Edges
    CB -->|"HTTP GET/POST"| manage
    manage --> ASGI
    manage --> WSGI
    ASGI --> Settings
    WSGI --> Settings
    Settings --> GlobalURLs
    GlobalURLs --> AppURLs
    AppURLs --> Views
    Views -->|SQL query| DB
    Views -->|migrations check| Migrations
    Views -->|"HTTP request"| OpenWeather
    Views -->|"HTTP request"| GoogleCS
    Views -->|"render"| Template
    Template -->|"HTML response"| CB
    CSS -->|"served"| CB
    Assets -->|"served"| CB

    %% Click Events
    click manage "https://github.com/adnanbhutta/forecastnest/blob/main/manage.py"
    click ASGI "https://github.com/adnanbhutta/forecastnest/blob/main/weatherproject/asgi.py"
    click WSGI "https://github.com/adnanbhutta/forecastnest/blob/main/weatherproject/wsgi.py"
    click Settings "https://github.com/adnanbhutta/forecastnest/blob/main/weatherproject/settings.py"
    click GlobalURLs "https://github.com/adnanbhutta/forecastnest/blob/main/weatherproject/urls.py"
    click AppURLs "https://github.com/adnanbhutta/forecastnest/blob/main/weatherapp/urls.py"
    click Models "https://github.com/adnanbhutta/forecastnest/blob/main/weatherapp/models.py"
    click Views "https://github.com/adnanbhutta/forecastnest/blob/main/weatherapp/views.py"
    click Template "https://github.com/adnanbhutta/forecastnest/blob/main/weatherapp/templates/weatherapp/index.html"
    click CSS "https://github.com/adnanbhutta/forecastnest/blob/main/static/style.css"
    click Assets "https://github.com/adnanbhutta/forecastnest/tree/main/assets/"
    click DB "https://github.com/adnanbhutta/forecastnest/blob/main/db.sqlite3"
    click Migrations "https://github.com/adnanbhutta/forecastnest/tree/main/weatherapp/migrations/"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
```
