# kh0165/planet-accessories architecture

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

- Interactive diagram: https://gitdiagram.com/kh0165/planet-accessories
- Repository: https://github.com/kh0165/planet-accessories

## Overview

This Django storefront lets shoppers browse products, manage a session cart, submit an order with customer and deposit confirmation, and view an order-success page. Staff manage products, categories, and order status through protected views or Django admin; order changes can be mirrored to Google Sheets. Models persist catalog and order data in the configured relational database. The graph reflects relationships visible in excerpts, the source index, or configuration; unsampled templates and view branches limit finer-grained flow detail.

Main entry points: [`store/views.py`](https://github.com/kh0165/planet-accessories/blob/main/store/views.py) (Checkout), [`store/urls.py`](https://github.com/kh0165/planet-accessories/blob/main/store/urls.py) (Store Routes), [`store/models.py`](https://github.com/kh0165/planet-accessories/blob/main/store/models.py) (Catalog Models), [`store/admin.py`](https://github.com/kh0165/planet-accessories/blob/main/store/admin.py) (Django Admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopper["Storefront"]
  node_storefront["Catalog and Cart<br/>[views.py]"]
  node_checkout["Checkout<br/>[views.py]"]
  node_order_success["Order Confirmation<br/>[views.py]"]
  node_store_routes["Store Routes<br/>[urls.py]"]
end

subgraph group_commerce["Order Management"]
  node_management["Staff Management<br/>[views.py]"]
  node_django_admin["Django Admin<br/>[admin.py]"]
end

subgraph group_persistence["Persistence"]
  node_catalog_data["Catalog Models<br/>[models.py]"]
  node_order_data["Order Models<br/>[models.py]"]
  node_relational_db[("Relational Database<br/>[settings.py]")]
end

subgraph group_integrations["External Services"]
  node_order_sync["Sheet Sync<br/>[google_sheets.py]"]
  node_google_sheets[("Google Sheets")]
end

node_shopper(("Shopper"))
node_staff(("Store Staff"))

node_shopper -->|"requests pages"| node_store_routes
node_store_routes -->|"routes catalog"| node_storefront
node_store_routes -->|"routes checkout"| node_checkout
node_store_routes -->|"routes result"| node_order_success
node_storefront -->|"queries products"| node_catalog_data
node_storefront -->|"updates session cart"| node_checkout
node_checkout -->|"loads products"| node_catalog_data
node_checkout -->|"creates order items"| node_order_data
node_checkout -->|"adds order"| node_order_sync
node_checkout -->|"saves order reference"| node_order_success
node_order_success -->|"loads order"| node_order_data
node_staff -->|"manages store"| node_store_routes
node_store_routes -->|"routes management"| node_management
node_management -->|"edits catalog"| node_catalog_data
node_management -->|"updates orders"| node_order_data
node_management -->|"syncs status"| node_order_sync
node_staff -->|"administers records"| node_django_admin
node_django_admin -->|"manages catalog"| node_catalog_data
node_django_admin -->|"manages orders"| node_order_data
node_django_admin -->|"updates sheet"| node_order_sync
node_order_sync -->|"reads and writes"| node_google_sheets
node_catalog_data -.->|"persists catalog"| node_relational_db
node_order_data -.->|"persists orders"| node_relational_db

click node_storefront "https://github.com/kh0165/planet-accessories/blob/main/store/views.py"
click node_checkout "https://github.com/kh0165/planet-accessories/blob/main/store/views.py"
click node_order_success "https://github.com/kh0165/planet-accessories/blob/main/store/views.py"
click node_store_routes "https://github.com/kh0165/planet-accessories/blob/main/store/urls.py"
click node_management "https://github.com/kh0165/planet-accessories/blob/main/store/views.py"
click node_django_admin "https://github.com/kh0165/planet-accessories/blob/main/store/admin.py"
click node_order_sync "https://github.com/kh0165/planet-accessories/blob/main/store/google_sheets.py"
click node_catalog_data "https://github.com/kh0165/planet-accessories/blob/main/store/models.py"
click node_order_data "https://github.com/kh0165/planet-accessories/blob/main/store/models.py"
click node_relational_db "https://github.com/kh0165/planet-accessories/blob/main/config/settings.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_storefront,node_checkout,node_order_success,node_store_routes toneBlue
class node_management,node_django_admin toneAmber
class node_catalog_data,node_order_data,node_relational_db toneMint
class node_order_sync,node_google_sheets toneRose
class node_shopper,node_staff toneIndigo
```

## Components

### Storefront

- [Catalog and Cart](https://github.com/kh0165/planet-accessories/blob/main/store/views.py): `store/views.py`
- [Checkout](https://github.com/kh0165/planet-accessories/blob/main/store/views.py): `store/views.py`
- [Order Confirmation](https://github.com/kh0165/planet-accessories/blob/main/store/views.py): `store/views.py`
- [Store Routes](https://github.com/kh0165/planet-accessories/blob/main/store/urls.py): `store/urls.py`

### Order Management

- [Staff Management](https://github.com/kh0165/planet-accessories/blob/main/store/views.py): `store/views.py`
- [Django Admin](https://github.com/kh0165/planet-accessories/blob/main/store/admin.py): `store/admin.py`

### Persistence

- [Catalog Models](https://github.com/kh0165/planet-accessories/blob/main/store/models.py): `store/models.py`
- [Order Models](https://github.com/kh0165/planet-accessories/blob/main/store/models.py): `store/models.py`
- [Relational Database](https://github.com/kh0165/planet-accessories/blob/main/config/settings.py): `config/settings.py`

### External Services

- [Sheet Sync](https://github.com/kh0165/planet-accessories/blob/main/store/google_sheets.py): `store/google_sheets.py`
- **Google Sheets**

### Other components

- **Shopper**
- **Store Staff**

## Connections

- Shopper → Store Routes: requests pages (evidence: `store/urls.py`)
- Store Routes → Catalog and Cart: routes catalog (evidence: `store/urls.py`)
- Store Routes → Checkout: routes checkout (evidence: `store/urls.py`)
- Store Routes → Order Confirmation: routes result (evidence: `store/urls.py`)
- Catalog and Cart → Catalog Models: queries products (evidence: `store/views.py`)
- Catalog and Cart → Checkout: updates session cart (evidence: `store/views.py`)
- Checkout → Catalog Models: loads products (evidence: `store/views.py`)
- Checkout → Order Models: creates order items (evidence: `store/views.py`)
- Checkout → Sheet Sync: adds order (evidence: `store/views.py`)
- Checkout → Order Confirmation: saves order reference (evidence: `store/views.py`)
- Order Confirmation → Order Models: loads order (evidence: `store/views.py`)
- Store Staff → Store Routes: manages store (evidence: `store/urls.py`)
- Store Routes → Staff Management: routes management (evidence: `store/urls.py`)
- Staff Management → Catalog Models: edits catalog (evidence: `store/views.py`)
- Staff Management → Order Models: updates orders (evidence: `store/views.py`)
- Staff Management → Sheet Sync: syncs status (evidence: `store/views.py`)
- Store Staff → Django Admin: administers records (evidence: `store/admin.py`)
- Django Admin → Catalog Models: manages catalog (evidence: `store/admin.py`)
- Django Admin → Order Models: manages orders (evidence: `store/admin.py`)
- Django Admin → Sheet Sync: updates sheet (evidence: `store/admin.py`)
- Sheet Sync → Google Sheets: reads and writes (evidence: `store/google_sheets.py`)
- Catalog Models → Relational Database: persists catalog (evidence: `config/settings.py`)
- Order Models → Relational Database: persists orders (evidence: `config/settings.py`)
