# nigler10/3d-frontend-and-backend architecture

> Architecture diagram of the GitHub repository nigler10/3d-frontend-and-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nigler10/3d-frontend-and-backend
- Repository: https://github.com/nigler10/3d-frontend-and-backend

## Overview

This is a custom-cake e-commerce application: customers browse products or configure a cake, manage a cart, check out, then track orders and contact support; administrators manage products, orders, and support. The frontend also includes a substantial 3D topping-placement subsystem. Backend excerpts establish the Django/Channels chat and order-status messaging, data models, and payment-gateway capability. Several page implementations and API views were not sampled, so those relationships are shown only where routing, imports, or excerpts support them.

Main entry points: [`frontend/src/App.jsx`](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/App.jsx) (Web app routes), [`backend/orders/admin_views.py`](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/orders/admin_views.py) (Order administration API), [`frontend/src/pages/BuildBentoPage.jsx`](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/BuildBentoPage.jsx) (Cake builder), [`backend/chat/consumers.py`](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/consumers.py) (WebSocket consumers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer shopping"]
  node_app["Web app routes<br/>[App.jsx]"]
  node_catalog["Product catalog<br/>[ProductList.jsx]"]
  node_product["Product details<br/>[ProductDetails.jsx]"]
  node_cart["Cart state<br/>[CartContext.jsx]"]
  node_checkout["Checkout<br/>[CheckoutPage.jsx]"]
  node_customerorders["Customer orders"]
  node_orderdetail["Order detail"]
  node_statushook["Order status notifications"]
end

subgraph group_custom["Cake customization"]
  node_builder["Cake builder<br/>[BuildBentoPage.jsx]"]
  node_customization["Customization state<br/>[Customization.jsx]"]
  node_dragcontrols["Topping controls"]
  node_dragcontroller["Drag controller"]
  node_placement["Placement geometry"]
end

subgraph group_admin["Operations"]
  node_adminorders["Order operations<br/>[AdminDashboard.jsx]"]
  node_adminproducts["Product administration"]
end

subgraph group_backend["Backend services"]
  node_auth["Authentication<br/>[auth.js]"]
  node_storeviews["Store API<br/>[views.py]"]
  node_storedata[("Store and order data<br/>[models.py]")]
  node_ordermodels[("Order model<br/>[models.py]")]
  node_payments["Payment gateway service<br/>[services.py]"]
  node_adminapi["Order administration API<br/>[admin_views.py]"]
end

subgraph group_messaging["Messaging"]
  node_supportcustomer["Customer support"]
  node_supportadmin["Admin support"]
  node_chatmodels[("Chat data<br/>[models.py]")]
  node_chatservice["Chat and broadcast service<br/>[services.py]"]
  node_consumers["WebSocket consumers<br/>[consumers.py]"]
  node_routing["WebSocket routes<br/>[routing.py]"]
  node_asgi["ASGI entry<br/>[asgi.py]"]
end

node_shopper(("Customer"))

node_shopper -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_builder
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_customerorders
node_app -->|"routes to"| node_orderdetail
node_app -->|"routes to"| node_adminorders
node_app -->|"routes to"| node_adminproducts
node_app -->|"routes to"| node_supportcustomer
node_app -->|"routes to"| node_supportadmin
node_builder -->|"uses"| node_customization
node_builder -->|"adds items"| node_cart
node_builder -->|"renders"| node_dragcontrols
node_dragcontrols -->|"delegates to"| node_dragcontroller
node_dragcontroller -->|"uses geometry"| node_placement
node_checkout -.->|"reads cart"| node_cart
node_orderdetail -.->|"shows updates"| node_statushook
node_statushook -->|"gets token"| node_auth
node_storeviews -->|"reads and writes"| node_storedata
node_adminapi -->|"updates orders"| node_storedata
node_adminapi -->|"uses quotations"| node_chatmodels
node_adminapi -->|"calls"| node_chatservice
node_adminapi -->|"calls"| node_payments
node_ordermodels -->|"references"| node_storedata
node_chatmodels -->|"links orders"| node_storedata
node_chatservice -->|"persists messages"| node_chatmodels
node_consumers -->|"uses"| node_chatmodels
node_consumers -->|"calls"| node_chatservice
node_routing -->|"dispatches to"| node_consumers
node_asgi -->|"loads routes"| node_routing
node_statushook -.->|"receives status events"| node_consumers

click node_app "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/App.jsx"
click node_catalog "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/ProductList.jsx"
click node_product "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/ProductDetails.jsx"
click node_builder "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/BuildBentoPage.jsx"
click node_customization "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/contexts/Customization.jsx"
click node_dragcontrols "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/components/ToppingDragControls.jsx"
click node_dragcontroller "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/utils/toppingDragController.js"
click node_placement "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/utils/toppingDragPlacement.js"
click node_cart "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/context/CartContext.jsx"
click node_checkout "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/CheckoutPage.jsx"
click node_customerorders "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/customer/CustomerOrdersPage.jsx"
click node_orderdetail "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/customer/CustomerOrderDetailPage.jsx"
click node_adminorders "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/admin/AdminDashboard.jsx"
click node_adminproducts "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/admin/AdminProductList.jsx"
click node_supportcustomer "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/customer/CustomerSupportPage.jsx"
click node_supportadmin "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/admin/AdminSupportPage.jsx"
click node_auth "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/utils/auth.js"
click node_storeviews "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/store/views.py"
click node_storedata "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/store/models.py"
click node_ordermodels "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/orders/models.py"
click node_payments "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/payments/services.py"
click node_adminapi "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/orders/admin_views.py"
click node_chatmodels "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/models.py"
click node_chatservice "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/services.py"
click node_consumers "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/consumers.py"
click node_routing "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/routing.py"
click node_asgi "https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/backend/asgi.py"
click node_statushook "https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/hooks/useOrderStatusNotifications.js"

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_app,node_catalog,node_product,node_cart,node_checkout,node_customerorders,node_orderdetail,node_statushook toneBlue
class node_builder,node_customization,node_dragcontrols,node_dragcontroller,node_placement toneAmber
class node_adminorders,node_adminproducts toneMint
class node_auth,node_storeviews,node_storedata,node_ordermodels,node_payments,node_adminapi toneRose
class node_supportcustomer,node_supportadmin,node_chatmodels,node_chatservice,node_consumers,node_routing,node_asgi,node_shopper toneIndigo
```

## Components

### Customer shopping

- [Web app routes](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Product catalog](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/ProductList.jsx): `frontend/src/pages/ProductList.jsx`
- [Product details](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/ProductDetails.jsx): `frontend/src/pages/ProductDetails.jsx`
- [Cart state](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Checkout](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/CheckoutPage.jsx): `frontend/src/pages/CheckoutPage.jsx`
- [Customer orders](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/customer/CustomerOrdersPage.jsx): `frontend/src/pages/customer/CustomerOrdersPage.jsx`
- [Order detail](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/customer/CustomerOrderDetailPage.jsx): `frontend/src/pages/customer/CustomerOrderDetailPage.jsx`
- [Order status notifications](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/hooks/useOrderStatusNotifications.js): `frontend/src/hooks/useOrderStatusNotifications.js`

### Cake customization

- [Cake builder](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/BuildBentoPage.jsx): `frontend/src/pages/BuildBentoPage.jsx`
- [Customization state](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/contexts/Customization.jsx): `frontend/src/contexts/Customization.jsx`
- [Topping controls](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/components/ToppingDragControls.jsx): `frontend/src/components/ToppingDragControls.jsx`
- [Drag controller](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/utils/toppingDragController.js): `frontend/src/utils/toppingDragController.js`
- [Placement geometry](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/utils/toppingDragPlacement.js): `frontend/src/utils/toppingDragPlacement.js`

### Operations

- [Order operations](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/admin/AdminDashboard.jsx): `frontend/src/pages/admin/AdminDashboard.jsx`
- [Product administration](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/admin/AdminProductList.jsx): `frontend/src/pages/admin/AdminProductList.jsx`

### Backend services

- [Authentication](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/utils/auth.js): `frontend/src/utils/auth.js`
- [Store API](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/store/views.py): `backend/store/views.py`
- [Store and order data](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/store/models.py): `backend/store/models.py`
- [Order model](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/orders/models.py): `backend/orders/models.py`
- [Payment gateway service](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/payments/services.py): `backend/payments/services.py`
- [Order administration API](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/orders/admin_views.py): `backend/orders/admin_views.py`

### Messaging

- [Customer support](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/customer/CustomerSupportPage.jsx): `frontend/src/pages/customer/CustomerSupportPage.jsx`
- [Admin support](https://github.com/nigler10/3d-frontend-and-backend/blob/main/frontend/src/pages/admin/AdminSupportPage.jsx): `frontend/src/pages/admin/AdminSupportPage.jsx`
- [Chat data](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/models.py): `backend/chat/models.py`
- [Chat and broadcast service](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/services.py): `backend/chat/services.py`
- [WebSocket consumers](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/consumers.py): `backend/chat/consumers.py`
- [WebSocket routes](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/chat/routing.py): `backend/chat/routing.py`
- [ASGI entry](https://github.com/nigler10/3d-frontend-and-backend/blob/main/backend/backend/asgi.py): `backend/backend/asgi.py`

### Other components

- **Customer**

## Connections

- Customer → Web app routes: uses
- Web app routes → Product catalog: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Cake builder: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Checkout: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Customer orders: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Order detail: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Order operations: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Product administration: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Customer support: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Admin support: routes to (evidence: `frontend/src/App.jsx`)
- Cake builder → Customization state: uses (evidence: `frontend/src/pages/BuildBentoPage.jsx`)
- Cake builder → Cart state: adds items (evidence: `frontend/src/pages/BuildBentoPage.jsx`)
- Cake builder → Topping controls: renders (evidence: `frontend/src/pages/BuildBentoPage.jsx`)
- Topping controls → Drag controller: delegates to (evidence: `frontend/src/components/ToppingDragControls.jsx`)
- Drag controller → Placement geometry: uses geometry (evidence: `frontend/src/utils/toppingDragController.js`)
- Checkout → Cart state: reads cart
- Order detail → Order status notifications: shows updates
- Order status notifications → Authentication: gets token (evidence: `frontend/src/hooks/useOrderStatusNotifications.js`)
- Store API → Store and order data: reads and writes (evidence: `backend/store/views.py`)
- Order administration API → Store and order data: updates orders (evidence: `backend/orders/admin_views.py`)
- Order administration API → Chat data: uses quotations (evidence: `backend/orders/admin_views.py`)
- Order administration API → Chat and broadcast service: calls (evidence: `backend/orders/admin_views.py`)
- Order administration API → Payment gateway service: calls (evidence: `backend/orders/admin_views.py`)
- Order model → Store and order data: references (evidence: `backend/orders/models.py`)
- Chat data → Store and order data: links orders (evidence: `backend/chat/models.py`)
- Chat and broadcast service → Chat data: persists messages (evidence: `backend/chat/services.py`)
- WebSocket consumers → Chat data: uses (evidence: `backend/chat/consumers.py`)
- WebSocket consumers → Chat and broadcast service: calls (evidence: `backend/chat/consumers.py`)
- WebSocket routes → WebSocket consumers: dispatches to (evidence: `backend/chat/routing.py`)
- ASGI entry → WebSocket routes: loads routes (evidence: `backend/backend/asgi.py`)
- Order status notifications → WebSocket consumers: receives status events
