# cuongtran33200-ctrl/cnpm architecture

> Architecture diagram of the GitHub repository cuongtran33200-ctrl/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/cnpm
- Repository: https://github.com/cuongtran33200-ctrl/cnpm

## Overview

Shop SBCB is a Django technology storefront. Customers browse and filter products, add them to a session cart, submit checkout to create orders and order items, then view order history and leave eligible reviews. Separate account/support, staff operations, and admin reporting capabilities are also documented and represented. Edges follow sampled view calls and URL routing or explicit README statements; Cloudinary is documented, while its runtime configuration path was not sampled.

Main entry points: [`shop/models.py`](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/models.py) (Commerce models), [`shop/urls.py`](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/urls.py) (Shop routes), [`shop/views.py`](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py) (Checkout and orders), [`shop/forms.py`](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/forms.py) (Commerce forms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer commerce"]
  node_storefront["Catalog and product views<br/>[views.py]"]
  node_cart_ops["Cart actions<br/>[views.py]"]
  node_session_cart["Session cart<br/>[cart.py]"]
  node_checkout["Checkout and orders<br/>[views.py]"]
  node_accounts["Accounts and profiles<br/>[views.py]"]
  node_forms["Commerce forms<br/>[forms.py]"]
  node_reviews["Product reviews<br/>[views.py]"]
  node_customer_support["Customer support requests<br/>[views.py]"]
end

subgraph group_operations["Store operations"]
  node_staff_views["Staff operations<br/>[staff_views.py]"]
  node_admin_views["Admin reporting and roles<br/>[admin_views.py]"]
  node_access_control["Role access checks<br/>[decorators.py]"]
end

subgraph group_domain["Commerce domain"]
  node_domain_models["Commerce models<br/>[models.py]"]
  node_mysql[("MySQL database")]
  node_cloudinary[("Cloudinary image storage")]
end

subgraph group_platform["Django platform"]
  node_shop_routes["Shop routes<br/>[urls.py]"]
  node_home_routes["Home route<br/>[urls.py]"]
  node_home_page["Home page<br/>[views.py]"]
end

node_shopper(("Customer"))
node_visitor(("Site visitor"))

node_shopper -->|"requests pages"| node_shop_routes
node_shop_routes -->|"routes catalog"| node_storefront
node_shop_routes -->|"routes cart"| node_cart_ops
node_shop_routes -->|"routes orders"| node_checkout
node_shop_routes -->|"routes accounts"| node_accounts
node_shop_routes -->|"routes reviews"| node_reviews
node_shop_routes -->|"routes support"| node_customer_support
node_cart_ops -->|"updates cart"| node_session_cart
node_checkout -->|"reads and clears"| node_session_cart
node_checkout -->|"validates checkout"| node_forms
node_accounts -->|"validates profile"| node_forms
node_reviews -->|"validates review"| node_forms
node_customer_support -->|"validates request"| node_forms
node_storefront -->|"queries catalog"| node_domain_models
node_cart_ops -->|"loads products"| node_domain_models
node_checkout -->|"creates orders"| node_domain_models
node_accounts -->|"updates profile"| node_domain_models
node_reviews -->|"saves reviews"| node_domain_models
node_customer_support -->|"saves requests"| node_domain_models
node_session_cart -->|"loads products"| node_domain_models
node_shop_routes -->|"routes staff"| node_staff_views
node_shop_routes -->|"routes admin"| node_admin_views
node_staff_views -->|"checks staff role"| node_access_control
node_admin_views -->|"checks admin role"| node_access_control
node_staff_views -->|"manages orders stock"| node_domain_models
node_admin_views -->|"queries commerce data"| node_domain_models
node_domain_models -.->|"persists records"| node_mysql
node_domain_models -.->|"stores product images"| node_cloudinary
node_visitor -->|"requests home"| node_home_routes
node_home_routes -->|"routes home"| node_home_page

click node_shop_routes "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/urls.py"
click node_storefront "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py"
click node_cart_ops "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py"
click node_session_cart "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/cart.py"
click node_checkout "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py"
click node_accounts "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py"
click node_forms "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/forms.py"
click node_reviews "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py"
click node_customer_support "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py"
click node_staff_views "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/staff_views.py"
click node_admin_views "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/admin_views.py"
click node_access_control "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/decorators.py"
click node_domain_models "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/models.py"
click node_home_routes "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/home/urls.py"
click node_home_page "https://github.com/cuongtran33200-ctrl/cnpm/blob/main/home/views.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_cart_ops,node_session_cart,node_checkout,node_accounts,node_forms,node_reviews,node_customer_support toneBlue
class node_staff_views,node_admin_views,node_access_control toneAmber
class node_domain_models,node_mysql,node_cloudinary toneMint
class node_shop_routes,node_home_routes,node_home_page toneRose
class node_shopper,node_visitor toneIndigo
```

## Components

### Customer commerce

- [Catalog and product views](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py): `shop/views.py`
- [Cart actions](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py): `shop/views.py`
- [Session cart](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/cart.py): `shop/cart.py`
- [Checkout and orders](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py): `shop/views.py`
- [Accounts and profiles](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py): `shop/views.py`
- [Commerce forms](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/forms.py): `shop/forms.py`
- [Product reviews](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py): `shop/views.py`
- [Customer support requests](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/views.py): `shop/views.py`

### Store operations

- [Staff operations](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/staff_views.py): `shop/staff_views.py`
- [Admin reporting and roles](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/admin_views.py): `shop/admin_views.py`
- [Role access checks](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/decorators.py): `shop/decorators.py`

### Commerce domain

- [Commerce models](https://github.com/cuongtran33200-ctrl/cnpm/blob/main/shop/models.py): `shop/models.py`
- **MySQL database**
- **Cloudinary image storage**

### Django platform

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

### Other components

- **Customer**
- **Site visitor**

## Connections

- Customer → Shop routes: requests pages (evidence: `shop/urls.py`)
- Shop routes → Catalog and product views: routes catalog (evidence: `shop/urls.py`)
- Shop routes → Cart actions: routes cart (evidence: `shop/urls.py`)
- Shop routes → Checkout and orders: routes orders (evidence: `shop/urls.py`)
- Shop routes → Accounts and profiles: routes accounts (evidence: `shop/urls.py`)
- Shop routes → Product reviews: routes reviews (evidence: `shop/urls.py`)
- Shop routes → Customer support requests: routes support (evidence: `shop/urls.py`)
- Cart actions → Session cart: updates cart (evidence: `shop/views.py`)
- Checkout and orders → Session cart: reads and clears (evidence: `shop/views.py`)
- Checkout and orders → Commerce forms: validates checkout (evidence: `shop/views.py`)
- Accounts and profiles → Commerce forms: validates profile (evidence: `shop/views.py`)
- Product reviews → Commerce forms: validates review (evidence: `shop/views.py`)
- Customer support requests → Commerce forms: validates request (evidence: `shop/views.py`)
- Catalog and product views → Commerce models: queries catalog (evidence: `shop/views.py`)
- Cart actions → Commerce models: loads products (evidence: `shop/views.py`)
- Checkout and orders → Commerce models: creates orders (evidence: `shop/views.py`)
- Accounts and profiles → Commerce models: updates profile (evidence: `shop/views.py`)
- Product reviews → Commerce models: saves reviews (evidence: `shop/views.py`)
- Customer support requests → Commerce models: saves requests (evidence: `shop/views.py`)
- Session cart → Commerce models: loads products (evidence: `shop/cart.py`)
- Shop routes → Staff operations: routes staff (evidence: `shop/urls.py`)
- Shop routes → Admin reporting and roles: routes admin (evidence: `shop/urls.py`)
- Staff operations → Role access checks: checks staff role (evidence: `shop/staff_views.py`)
- Admin reporting and roles → Role access checks: checks admin role (evidence: `shop/admin_views.py`)
- Staff operations → Commerce models: manages orders stock (evidence: `shop/staff_views.py`)
- Admin reporting and roles → Commerce models: queries commerce data (evidence: `shop/admin_views.py`)
- Commerce models → MySQL database: persists records (evidence: `README.md`)
- Commerce models → Cloudinary image storage: stores product images (evidence: `README.md`)
- Site visitor → Home route: requests home (evidence: `home/urls.py`)
- Home route → Home page: routes home (evidence: `home/urls.py`)
