# lnrd01/itcs306-mini-capstone architecture

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

- Interactive diagram: https://gitdiagram.com/lnrd01/itcs306-mini-capstone
- Repository: https://github.com/lnrd01/itcs306-mini-capstone

## Overview

Tool Haven is a Django hardware storefront with customer shopping and staff operations. Customers browse products, manage a session cart, submit checkout, and view order confirmation; staff manage products, orders, messages, and editable site content. The graph separates page views, JSON endpoints, shared domain data, and supporting services. The README is empty, and browser-side wiring is not shown in the excerpts, so API-to-browser links and unsampled integrations are omitted.

Main entry points: [`toolhaven/api/views.py`](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/api/views.py) (JSON endpoints), [`toolhaven/pages/admin_views.py`](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/admin_views.py) (Management pages), [`toolhaven/core/models.py`](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/core/models.py) (Shop records), [`toolhaven/pages/views.py`](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/views.py) (Storefront pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_public_pages["Storefront pages<br/>[views.py]"]
  node_auth_forms["Auth and product forms<br/>[forms.py]"]
  node_api["JSON endpoints<br/>[views.py]"]
end

subgraph group_operations["Staff operations"]
  node_admin_pages["Management pages<br/>[admin_views.py]"]
end

subgraph group_services["Shared services"]
  node_site_context["Template context"]
  node_content_tags["Content template tags<br/>[site_content.py]"]
  node_cart["Session cart<br/>[cart.py]"]
  node_content["Editable content service<br/>[content.py]"]
  node_request_helpers["API request helpers<br/>[http.py]"]
  node_permissions["Access controls<br/>[permissions.py]"]
end

subgraph group_domain["Domain data"]
  node_records[("Shop records<br/>[models.py]")]
end

node_customer(("Customer"))
node_staff(("Staff user"))

node_customer -->|"browses"| node_public_pages
node_customer -->|"submits API requests"| node_api
node_staff -->|"manages shop"| node_admin_pages
node_public_pages -->|"queries orders/products"| node_records
node_public_pages -->|"reads cart"| node_cart
node_public_pages -->|"uses signup form"| node_auth_forms
node_api -->|"reads and writes"| node_records
node_api -->|"updates cart"| node_cart
node_api -->|"parses JSON"| node_request_helpers
node_api -->|"checks access"| node_permissions
node_admin_pages -->|"manages records"| node_records
node_admin_pages -->|"uses product form"| node_auth_forms
node_admin_pages -->|"edits site content"| node_content
node_admin_pages -->|"requires staff access"| node_permissions
node_site_context -->|"loads site details"| node_content
node_site_context -->|"counts cart items"| node_cart
node_site_context -->|"counts staff notices"| node_records
node_content_tags -->|"gets text and images"| node_content
node_content -->|"loads saved content"| node_records

click node_public_pages "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/views.py"
click node_auth_forms "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/forms.py"
click node_api "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/api/views.py"
click node_admin_pages "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/admin_views.py"
click node_site_context "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/context_processors.py"
click node_content_tags "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/templatetags/site_content.py"
click node_cart "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/cart.py"
click node_content "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/content.py"
click node_request_helpers "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/http.py"
click node_permissions "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/permissions.py"
click node_records "https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/core/models.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_public_pages,node_auth_forms,node_api,node_staff toneBlue
class node_admin_pages toneAmber
class node_site_context,node_content_tags,node_cart,node_content,node_request_helpers,node_permissions toneMint
class node_records toneRose
class node_customer toneIndigo
```

## Components

### Customer storefront

- [Storefront pages](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/views.py): `toolhaven/pages/views.py`
- [Auth and product forms](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/forms.py): `toolhaven/pages/forms.py`
- [JSON endpoints](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/api/views.py): `toolhaven/api/views.py`

### Staff operations

- [Management pages](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/admin_views.py): `toolhaven/pages/admin_views.py`

### Shared services

- [Template context](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/context_processors.py): `toolhaven/pages/context_processors.py`
- [Content template tags](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/pages/templatetags/site_content.py): `toolhaven/pages/templatetags/site_content.py`
- [Session cart](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/cart.py): `toolhaven/utils/cart.py`
- [Editable content service](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/content.py): `toolhaven/utils/content.py`
- [API request helpers](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/http.py): `toolhaven/utils/http.py`
- [Access controls](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/utils/permissions.py): `toolhaven/utils/permissions.py`

### Domain data

- [Shop records](https://github.com/lnrd01/itcs306-mini-capstone/blob/main/toolhaven/core/models.py): `toolhaven/core/models.py`

### Other components

- **Customer**
- **Staff user**

## Connections

- Customer → Storefront pages: browses
- Customer → JSON endpoints: submits API requests
- Staff user → Management pages: manages shop (evidence: `toolhaven/pages/admin_views.py`)
- Storefront pages → Shop records: queries orders/products (evidence: `toolhaven/pages/views.py`)
- Storefront pages → Session cart: reads cart (evidence: `toolhaven/pages/views.py`)
- Storefront pages → Auth and product forms: uses signup form (evidence: `toolhaven/pages/views.py`)
- JSON endpoints → Shop records: reads and writes (evidence: `toolhaven/api/views.py`)
- JSON endpoints → Session cart: updates cart (evidence: `toolhaven/api/views.py`)
- JSON endpoints → API request helpers: parses JSON (evidence: `toolhaven/api/views.py`)
- JSON endpoints → Access controls: checks access (evidence: `toolhaven/api/views.py`)
- Management pages → Shop records: manages records (evidence: `toolhaven/pages/admin_views.py`)
- Management pages → Auth and product forms: uses product form (evidence: `toolhaven/pages/admin_views.py`)
- Management pages → Editable content service: edits site content (evidence: `toolhaven/pages/admin_views.py`)
- Management pages → Access controls: requires staff access (evidence: `toolhaven/pages/admin_views.py`)
- Template context → Editable content service: loads site details (evidence: `toolhaven/pages/context_processors.py`)
- Template context → Session cart: counts cart items (evidence: `toolhaven/pages/context_processors.py`)
- Template context → Shop records: counts staff notices (evidence: `toolhaven/pages/context_processors.py`)
- Content template tags → Editable content service: gets text and images (evidence: `toolhaven/pages/templatetags/site_content.py`)
- Editable content service → Shop records: loads saved content (evidence: `toolhaven/utils/content.py`)
