# wsvincent/lithium architecture

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

- Interactive diagram: https://gitdiagram.com/wsvincent/lithium
- Repository: https://github.com/wsvincent/lithium

## Overview

Lithium is a Django starter site. A visitor requests a page, project URL routing dispatches home/about requests to page views, and those views select templates for the response. Account routes use django-allauth; the project also supplies a custom user model and admin forms. Settings connect authentication, database, static-file serving, and optional developer tooling. The README documents further capabilities, including custom error pages and crispy forms; their detailed wiring is not shown in the sampled source.

Main entry points: [`django_project/settings.py`](https://github.com/wsvincent/lithium/blob/main/django_project/settings.py) (Project settings), [`django_project/urls.py`](https://github.com/wsvincent/lithium/blob/main/django_project/urls.py) (URL routing), [`pages/views.py`](https://github.com/wsvincent/lithium/blob/main/pages/views.py) (Page views), [`accounts/models.py`](https://github.com/wsvincent/lithium/blob/main/accounts/models.py) (Custom user)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web pages"]
  node_page_routes["Page routes<br/>[urls.py]"]
  node_page_views["Page views<br/>[views.py]"]
end

subgraph group_identity["Accounts"]
  node_auth_routes["Auth routes"]
  node_allauth["django-allauth"]
  node_custom_user["Custom user<br/>[models.py]"]
  node_admin_forms["Admin forms<br/>[forms.py]"]
  node_user_admin["User admin<br/>[admin.py]"]
end

subgraph group_platform["Django platform"]
  node_routing["URL routing<br/>[urls.py]"]
  node_database[("Configured database<br/>[settings.py]")]
  node_project_settings["Project settings<br/>[settings.py]"]
  node_static_middleware["Static serving<br/>[settings.py]"]
  node_crispy["Crispy forms"]
  node_debug_toolbar["Debug toolbar"]
end

subgraph group_assets["Presentation assets"]
  node_page_templates["Page templates"]
  node_shared_template["Base template<br/>[_base.html]"]
  node_static_assets["Static assets"]
  node_error_templates["Error pages"]
end

node_visitor(("Visitor"))

node_visitor -->|"requests"| node_routing
node_routing -->|"includes"| node_page_routes
node_page_routes -->|"dispatches"| node_page_views
node_page_views -->|"selects"| node_page_templates
node_page_templates -.->|"extends"| node_shared_template
node_routing -->|"includes"| node_auth_routes
node_auth_routes -->|"routes to"| node_allauth
node_project_settings -->|"configures"| node_allauth
node_project_settings -->|"sets user model"| node_custom_user
node_user_admin -->|"uses"| node_admin_forms
node_user_admin -->|"registers"| node_custom_user
node_admin_forms -->|"models"| node_custom_user
node_project_settings -->|"configures"| node_database
node_project_settings -->|"configures"| node_static_middleware
node_static_middleware -->|"serves"| node_static_assets
node_project_settings -->|"configures"| node_crispy
node_routing -->|"routes to"| node_debug_toolbar
node_project_settings -->|"enables"| node_debug_toolbar
node_page_views -.->|"uses"| node_error_templates

click node_routing "https://github.com/wsvincent/lithium/blob/main/django_project/urls.py"
click node_page_routes "https://github.com/wsvincent/lithium/blob/main/pages/urls.py"
click node_page_views "https://github.com/wsvincent/lithium/blob/main/pages/views.py"
click node_page_templates "https://github.com/wsvincent/lithium/tree/main/templates/pages"
click node_shared_template "https://github.com/wsvincent/lithium/blob/main/templates/_base.html"
click node_static_assets "https://github.com/wsvincent/lithium/tree/main/static"
click node_custom_user "https://github.com/wsvincent/lithium/blob/main/accounts/models.py"
click node_admin_forms "https://github.com/wsvincent/lithium/blob/main/accounts/forms.py"
click node_user_admin "https://github.com/wsvincent/lithium/blob/main/accounts/admin.py"
click node_database "https://github.com/wsvincent/lithium/blob/main/django_project/settings.py"
click node_project_settings "https://github.com/wsvincent/lithium/blob/main/django_project/settings.py"
click node_static_middleware "https://github.com/wsvincent/lithium/blob/main/django_project/settings.py"
click node_error_templates "https://github.com/wsvincent/lithium/tree/main/templates"

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_page_routes,node_page_views toneBlue
class node_auth_routes,node_allauth,node_custom_user,node_admin_forms,node_user_admin toneAmber
class node_routing,node_database,node_project_settings,node_static_middleware,node_crispy,node_debug_toolbar toneMint
class node_page_templates,node_shared_template,node_static_assets,node_error_templates toneRose
class node_visitor toneIndigo
```

## Components

### Web pages

- [Page routes](https://github.com/wsvincent/lithium/blob/main/pages/urls.py): `pages/urls.py`
- [Page views](https://github.com/wsvincent/lithium/blob/main/pages/views.py): `pages/views.py`

### Accounts

- **Auth routes**
- **django-allauth**
- [Custom user](https://github.com/wsvincent/lithium/blob/main/accounts/models.py): `accounts/models.py`
- [Admin forms](https://github.com/wsvincent/lithium/blob/main/accounts/forms.py): `accounts/forms.py`
- [User admin](https://github.com/wsvincent/lithium/blob/main/accounts/admin.py): `accounts/admin.py`

### Django platform

- [URL routing](https://github.com/wsvincent/lithium/blob/main/django_project/urls.py): `django_project/urls.py`
- [Configured database](https://github.com/wsvincent/lithium/blob/main/django_project/settings.py): `django_project/settings.py`
- [Project settings](https://github.com/wsvincent/lithium/blob/main/django_project/settings.py): `django_project/settings.py`
- [Static serving](https://github.com/wsvincent/lithium/blob/main/django_project/settings.py): `django_project/settings.py`
- **Crispy forms**
- **Debug toolbar**

### Presentation assets

- [Page templates](https://github.com/wsvincent/lithium/tree/main/templates/pages): `templates/pages`
- [Base template](https://github.com/wsvincent/lithium/blob/main/templates/_base.html): `templates/_base.html`
- [Static assets](https://github.com/wsvincent/lithium/tree/main/static): `static`
- [Error pages](https://github.com/wsvincent/lithium/tree/main/templates): `templates`

### Other components

- **Visitor**

## Connections

- Visitor → URL routing: requests (evidence: `django_project/urls.py`)
- URL routing → Page routes: includes (evidence: `django_project/urls.py`)
- Page routes → Page views: dispatches (evidence: `pages/urls.py`)
- Page views → Page templates: selects (evidence: `pages/views.py`)
- Page templates → Base template: extends
- URL routing → Auth routes: includes (evidence: `django_project/urls.py`)
- Auth routes → django-allauth: routes to
- Project settings → django-allauth: configures (evidence: `django_project/settings.py`)
- Project settings → Custom user: sets user model (evidence: `django_project/settings.py`)
- User admin → Admin forms: uses (evidence: `accounts/admin.py`)
- User admin → Custom user: registers (evidence: `accounts/admin.py`)
- Admin forms → Custom user: models (evidence: `accounts/forms.py`)
- Project settings → Configured database: configures (evidence: `django_project/settings.py`)
- Project settings → Static serving: configures (evidence: `django_project/settings.py`)
- Static serving → Static assets: serves (evidence: `django_project/settings.py`)
- Project settings → Crispy forms: configures (evidence: `django_project/settings.py`)
- URL routing → Debug toolbar: routes to (evidence: `django_project/urls.py`)
- Project settings → Debug toolbar: enables (evidence: `django_project/settings.py`)
- Page views → Error pages: uses
