# cuongtran33200-ctrl/tranvietcuong24ct1-cnpm architecture

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

- Interactive diagram: https://gitdiagram.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm
- Repository: https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm

## Overview

Shop SBCB is a server-rendered Django technology store. Customers browse and review products, manage a session cart, check out, and track orders; staff handle orders, inventory, customers, and support, while admins manage roles and view analytics. The graph separates request routing, customer workflows, staff/admin operations, and domain data. Source excerpts show the cart, checkout, staff, and admin behavior; other listed capabilities and infrastructure links are included where the README documents them.

Main entry points: [`backend/shop/models.py`](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/models.py) (Shop models), [`backend/shop/urls.py`](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/urls.py) (Shop routes), [`backend/shop/views.py`](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/views.py) (Customer workflows), [`backend/shop/staff_views.py`](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/staff_views.py) (Staff workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Web entry"]
  node_shop_routes["Shop routes<br/>[urls.py]"]
  node_home_page["Home page<br/>[views.py]"]
end

subgraph group_customer["Customer commerce"]
  node_customer_views["Customer workflows<br/>[views.py]"]
  node_forms["Input forms<br/>[forms.py]"]
  node_cart["Session cart<br/>[cart.py]"]
  node_shop_templates["Storefront templates"]
  node_account_templates["Account templates"]
end

subgraph group_operations["Staff and admin"]
  node_staff_views["Staff workflows<br/>[staff_views.py]"]
  node_admin_views["Admin dashboard<br/>[admin_views.py]"]
  node_access_control["Role checks<br/>[decorators.py]"]
  node_admin_interface["Django admin<br/>[admin.py]"]
end

subgraph group_domain["Domain and storage"]
  node_domain_models["Shop models<br/>[models.py]"]
  node_mysql[("MySQL database")]
  node_cloudinary["Cloudinary images"]
end

node_shopper(("Customer"))
node_staff_actor(("Staff user"))
node_admin_actor(("Admin user"))

node_shopper -->|"requests pages"| node_shop_routes
node_staff_actor -->|"requests operations"| node_shop_routes
node_admin_actor -->|"requests admin"| node_shop_routes
node_shop_routes -->|"dispatches"| node_customer_views
node_shop_routes -->|"dispatches"| node_staff_views
node_shop_routes -->|"dispatches"| node_admin_views
node_customer_views -->|"validates input"| node_forms
node_customer_views -->|"uses cart"| node_cart
node_customer_views -->|"reads and writes"| node_domain_models
node_cart -->|"loads products"| node_domain_models
node_forms -->|"model forms"| node_domain_models
node_customer_views -->|"renders pages"| node_shop_templates
node_shop_routes -->|"serves login"| node_account_templates
node_staff_views -->|"checks staff role"| node_access_control
node_admin_views -->|"checks admin role"| node_access_control
node_staff_views -->|"reads and updates"| node_domain_models
node_admin_views -->|"queries analytics"| node_domain_models
node_staff_views -->|"renders operations"| node_shop_templates
node_admin_views -->|"renders dashboard"| node_shop_templates
node_admin_interface -->|"registers models"| node_domain_models
node_domain_models -->|"persists records"| node_mysql
node_domain_models -->|"stores product images"| node_cloudinary

click node_shop_routes "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/urls.py"
click node_home_page "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/home/views.py"
click node_customer_views "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/views.py"
click node_forms "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/forms.py"
click node_cart "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/cart.py"
click node_shop_templates "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/tree/main/frontend/templates/shop"
click node_account_templates "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/tree/main/frontend/templates/registration"
click node_staff_views "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/staff_views.py"
click node_admin_views "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/admin_views.py"
click node_access_control "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/decorators.py"
click node_admin_interface "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/admin.py"
click node_domain_models "https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/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_shop_routes,node_home_page,node_staff_actor,node_admin_actor toneBlue
class node_customer_views,node_forms,node_cart,node_shop_templates,node_account_templates toneAmber
class node_staff_views,node_admin_views,node_access_control,node_admin_interface toneMint
class node_domain_models,node_mysql,node_cloudinary toneRose
class node_shopper toneIndigo
```

## Components

### Web entry

- [Shop routes](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/urls.py): `backend/shop/urls.py`
- [Home page](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/home/views.py): `backend/home/views.py`

### Customer commerce

- [Customer workflows](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/views.py): `backend/shop/views.py`
- [Input forms](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/forms.py): `backend/shop/forms.py`
- [Session cart](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/cart.py): `backend/shop/cart.py`
- [Storefront templates](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/tree/main/frontend/templates/shop): `frontend/templates/shop`
- [Account templates](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/tree/main/frontend/templates/registration): `frontend/templates/registration`

### Staff and admin

- [Staff workflows](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/staff_views.py): `backend/shop/staff_views.py`
- [Admin dashboard](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/admin_views.py): `backend/shop/admin_views.py`
- [Role checks](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/decorators.py): `backend/shop/decorators.py`
- [Django admin](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/admin.py): `backend/shop/admin.py`

### Domain and storage

- [Shop models](https://github.com/cuongtran33200-ctrl/tranvietcuong24ct1-cnpm/blob/main/backend/shop/models.py): `backend/shop/models.py`
- **MySQL database**
- **Cloudinary images**

### Other components

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

## Connections

- Customer → Shop routes: requests pages (evidence: `README.md`)
- Staff user → Shop routes: requests operations (evidence: `README.md`)
- Admin user → Shop routes: requests admin (evidence: `README.md`)
- Shop routes → Customer workflows: dispatches (evidence: `backend/shop/urls.py`)
- Shop routes → Staff workflows: dispatches (evidence: `backend/shop/urls.py`)
- Shop routes → Admin dashboard: dispatches (evidence: `backend/shop/urls.py`)
- Customer workflows → Input forms: validates input (evidence: `backend/shop/views.py`)
- Customer workflows → Session cart: uses cart (evidence: `backend/shop/views.py`)
- Customer workflows → Shop models: reads and writes (evidence: `backend/shop/views.py`)
- Session cart → Shop models: loads products (evidence: `backend/shop/cart.py`)
- Input forms → Shop models: model forms (evidence: `backend/shop/forms.py`)
- Customer workflows → Storefront templates: renders pages (evidence: `README.md`)
- Shop routes → Account templates: serves login (evidence: `backend/shop/urls.py`)
- Staff workflows → Role checks: checks staff role (evidence: `backend/shop/staff_views.py`)
- Admin dashboard → Role checks: checks admin role (evidence: `backend/shop/admin_views.py`)
- Staff workflows → Shop models: reads and updates (evidence: `backend/shop/staff_views.py`)
- Admin dashboard → Shop models: queries analytics (evidence: `backend/shop/admin_views.py`)
- Staff workflows → Storefront templates: renders operations (evidence: `backend/shop/staff_views.py`)
- Admin dashboard → Storefront templates: renders dashboard (evidence: `backend/shop/admin_views.py`)
- Django admin → Shop models: registers models (evidence: `backend/shop/admin.py`)
- Shop models → MySQL database: persists records (evidence: `README.md`)
- Shop models → Cloudinary images: stores product images (evidence: `README.md`)
