# virajpa4/weather-alert-system architecture

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

- Interactive diagram: https://gitdiagram.com/virajpa4/weather-alert-system
- Repository: https://github.com/virajpa4/weather-alert-system

## Overview

This Django site serves weather lookup and chatbot responses, alongside account, contact, and informational pages. The main implemented workflow is a user request routed through Django URLs to a view; weather views fetch wttr.in data and render or return a response. Contact submissions are saved and emailed. The README also describes 50 km alerts, but marks them as under development; the sampled runtime source shows no radius calculation or notification implementation, so that capability is shown as planned only.

Main entry points: [`app/views.py`](https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py) (Contact handler), [`project/urls.py`](https://github.com/virajpa4/weather-alert-system/blob/main/project/urls.py) (Password flows), [`app/models.py`](https://github.com/virajpa4/weather-alert-system/blob/main/app/models.py) (Contact record), [`app/urls.py`](https://github.com/virajpa4/weather-alert-system/blob/main/app/urls.py) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_weather["Weather experience"]
  node_weather_view["Weather lookup<br/>[views.py]"]
  node_chat_view["Weather chatbot<br/>[views.py]"]
  node_weather_fetch["Weather fetcher<br/>[views.py]"]
  node_weather_page["Weather page<br/>[weather.html]"]
  node_planned_alerts["Radius alerts planned<br/>[README.md]"]
end

subgraph group_accounts["Accounts"]
  node_auth_view["Account views<br/>[views.py]"]
  node_django_auth["Django auth"]
  node_auth_pages["Auth templates"]
  node_password_routes["Password flows<br/>[urls.py]"]
  node_password_pages["Password templates"]
end

subgraph group_contact["Contact handling"]
  node_contact_view["Contact handler<br/>[views.py]"]
  node_contact_form["Contact page<br/>[contact.html]"]
  node_contact_model["Contact record<br/>[models.py]"]
  node_database[("SQLite database")]
  node_email_service{{"SMTP email"}}
end

subgraph group_web["Web routing"]
  node_root_routes["Project routes<br/>[urls.py]"]
  node_app_routes["App routes<br/>[urls.py]"]
  node_views["Django views<br/>[views.py]"]
end

node_user(("Site user"))
node_wttrin{{"wttr.in API"}}

node_user -->|"requests pages"| node_root_routes
node_root_routes -->|"includes routes"| node_app_routes
node_app_routes -->|"dispatches requests"| node_views
node_views -->|"dispatches weather"| node_weather_view
node_views -->|"dispatches chat"| node_chat_view
node_weather_view -->|"calls fetcher"| node_weather_fetch
node_chat_view -->|"calls fetcher"| node_weather_fetch
node_weather_fetch -->|"fetches conditions"| node_wttrin
node_weather_view -->|"renders result"| node_weather_page
node_user -->|"submits credentials"| node_auth_view
node_auth_view -->|"authenticates user"| node_django_auth
node_auth_view -->|"renders account forms"| node_auth_pages
node_root_routes -->|"routes password flows"| node_password_routes
node_password_routes -->|"uses auth views"| node_django_auth
node_password_routes -->|"renders forms"| node_password_pages
node_user -->|"submits inquiry"| node_contact_view
node_contact_view -->|"renders form"| node_contact_form
node_contact_view -->|"creates record"| node_contact_model
node_contact_model -->|"persists record"| node_database
node_contact_view -->|"sends messages"| node_email_service
node_planned_alerts -.->|"planned notifications"| node_user

click node_root_routes "https://github.com/virajpa4/weather-alert-system/blob/main/project/urls.py"
click node_app_routes "https://github.com/virajpa4/weather-alert-system/blob/main/app/urls.py"
click node_views "https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py"
click node_weather_view "https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py"
click node_chat_view "https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py"
click node_weather_fetch "https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py"
click node_weather_page "https://github.com/virajpa4/weather-alert-system/blob/main/templates/weather.html"
click node_auth_view "https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py"
click node_auth_pages "https://github.com/virajpa4/weather-alert-system/tree/main/templates/auth"
click node_password_routes "https://github.com/virajpa4/weather-alert-system/blob/main/project/urls.py"
click node_password_pages "https://github.com/virajpa4/weather-alert-system/tree/main/templates/common"
click node_contact_view "https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py"
click node_contact_form "https://github.com/virajpa4/weather-alert-system/blob/main/templates/contact.html"
click node_contact_model "https://github.com/virajpa4/weather-alert-system/blob/main/app/models.py"
click node_planned_alerts "https://github.com/virajpa4/weather-alert-system/blob/main/README.md"

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_weather_view,node_chat_view,node_weather_fetch,node_weather_page,node_planned_alerts,node_user toneBlue
class node_auth_view,node_django_auth,node_auth_pages,node_password_routes,node_password_pages toneAmber
class node_contact_view,node_contact_form,node_contact_model,node_database,node_email_service,node_wttrin toneMint
class node_root_routes,node_app_routes,node_views toneRose
```

## Components

### Weather experience

- [Weather lookup](https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py): `app/views.py`
- [Weather chatbot](https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py): `app/views.py`
- [Weather fetcher](https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py): `app/views.py`
- [Weather page](https://github.com/virajpa4/weather-alert-system/blob/main/templates/weather.html): `templates/weather.html`
- [Radius alerts planned](https://github.com/virajpa4/weather-alert-system/blob/main/README.md): `README.md`

### Accounts

- [Account views](https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py): `app/views.py`
- **Django auth**
- [Auth templates](https://github.com/virajpa4/weather-alert-system/tree/main/templates/auth): `templates/auth`
- [Password flows](https://github.com/virajpa4/weather-alert-system/blob/main/project/urls.py): `project/urls.py`
- [Password templates](https://github.com/virajpa4/weather-alert-system/tree/main/templates/common): `templates/common`

### Contact handling

- [Contact handler](https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py): `app/views.py`
- [Contact page](https://github.com/virajpa4/weather-alert-system/blob/main/templates/contact.html): `templates/contact.html`
- [Contact record](https://github.com/virajpa4/weather-alert-system/blob/main/app/models.py): `app/models.py`
- **SQLite database**
- **SMTP email**

### Web routing

- [Project routes](https://github.com/virajpa4/weather-alert-system/blob/main/project/urls.py): `project/urls.py`
- [App routes](https://github.com/virajpa4/weather-alert-system/blob/main/app/urls.py): `app/urls.py`
- [Django views](https://github.com/virajpa4/weather-alert-system/blob/main/app/views.py): `app/views.py`

### Other components

- **Site user**
- **wttr.in API**

## Connections

- Site user → Project routes: requests pages
- Project routes → App routes: includes routes
- App routes → Django views: dispatches requests
- Django views → Weather lookup: dispatches weather
- Django views → Weather chatbot: dispatches chat
- Weather lookup → Weather fetcher: calls fetcher
- Weather chatbot → Weather fetcher: calls fetcher
- Weather fetcher → wttr.in API: fetches conditions
- Weather lookup → Weather page: renders result
- Site user → Account views: submits credentials
- Account views → Django auth: authenticates user
- Account views → Auth templates: renders account forms
- Project routes → Password flows: routes password flows
- Password flows → Django auth: uses auth views
- Password flows → Password templates: renders forms
- Site user → Contact handler: submits inquiry
- Contact handler → Contact page: renders form
- Contact handler → Contact record: creates record
- Contact record → SQLite database: persists record
- Contact handler → SMTP email: sends messages
- Radius alerts planned → Site user: planned notifications
