# sovandarachim2-commits/shadow-shop architecture

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

- Interactive diagram: https://gitdiagram.com/sovandarachim2-commits/shadow-shop
- Repository: https://github.com/sovandarachim2-commits/shadow-shop

## Overview

Shadow Shop is a wholesale cosmetics commerce and operations system: customers browse products, build a cart, check out, pay, and track orders; staff manage orders, inventory, delivery, finance, and reports. The React app routes customer and admin experiences to a Django REST API, with MySQL-backed domain apps and optional Telegram and payment-provider integrations. The README documents the main capabilities and API modules; sampled source confirms selected payment, inventory, notification, and routing behavior, but many views and frontend pages were not inspected, so their internal call paths are not asserted.

Main entry points: [`frontend/src/api`](https://github.com/sovandarachim2-commits/shadow-shop/tree/main/frontend/src/api) (Frontend API modules), [`backend/apps/orders/models.py`](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/orders/models.py) (Order management), [`backend/apps/payments/services.py`](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/payments/services.py) (Payment services), [`frontend/src/App.jsx`](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/frontend/src/App.jsx) (React application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["Web application"]
  node_webapp["React application<br/>[App.jsx]"]
  node_shop["Customer shopping"]
  node_adminui["Admin dashboard"]
  node_api["Frontend API modules"]
end

subgraph group_commerce["Commerce and catalog"]
  node_catalog["Product catalog<br/>[models.py]"]
  node_orders[("Order management<br/>[models.py]")]
  node_checkout["Checkout orchestration<br/>[checkout_flow.py]"]
  node_payment["Payment services<br/>[services.py]"]
  node_paymentrecords[("Payment records<br/>[models.py]")]
end

subgraph group_operations["Operations"]
  node_inventory["Inventory and transfers<br/>[services.py]"]
  node_delivery["Delivery tracking"]
  node_finance[("Finance<br/>[models.py]")]
  node_reports["Business reports"]
end

subgraph group_platform["Identity and integrations"]
  node_accounts[("Accounts and permissions<br/>[models.py]")]
  node_accountviews["Account workflows<br/>[views.py]"]
  node_notifications["Telegram notifications<br/>[services.py]"]
  node_media[("Media storage<br/>[storage.py]")]
end

node_customer(("Customer"))
node_staff(("Staff user"))
node_telegram{{"Telegram Bot"}}
node_aba{{"ABA PayWay"}}
node_bakong{{"Bakong payment"}}

node_customer -->|"uses"| node_webapp
node_staff -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_shop
node_webapp -->|"routes to"| node_adminui
node_shop -.->|"requests data"| node_api
node_adminui -.->|"requests data"| node_api
node_api -.->|"calls API"| node_catalog
node_api -.->|"calls API"| node_orders
node_api -.->|"calls API"| node_checkout
node_api -.->|"calls API"| node_inventory
node_api -.->|"calls API"| node_delivery
node_api -.->|"calls API"| node_finance
node_api -.->|"calls API"| node_reports
node_api -.->|"calls API"| node_accountviews
node_checkout -->|"delegates to"| node_payment
node_payment -->|"records payments"| node_paymentrecords
node_payment -.->|"checks status"| node_aba
node_payment -->|"checks status"| node_bakong
node_checkout -->|"fulfills checkout"| node_orders
node_orders -->|"deducts stock"| node_inventory
node_orders -->|"updates finance"| node_finance
node_orders -->|"notifies"| node_notifications
node_notifications -->|"sends messages"| node_telegram
node_accountviews -->|"reads and updates"| node_accounts
node_accountviews -->|"requests alerts"| node_notifications
node_catalog -->|"stores uploads"| node_media
node_catalog -->|"uses stock"| node_inventory

click node_webapp "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/frontend/src/App.jsx"
click node_shop "https://github.com/sovandarachim2-commits/shadow-shop/tree/main/frontend/src/pages/customer"
click node_adminui "https://github.com/sovandarachim2-commits/shadow-shop/tree/main/frontend/src/pages/admin"
click node_api "https://github.com/sovandarachim2-commits/shadow-shop/tree/main/frontend/src/api"
click node_catalog "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/products/models.py"
click node_orders "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/orders/models.py"
click node_checkout "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/payments/checkout_flow.py"
click node_payment "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/payments/services.py"
click node_paymentrecords "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/payments/models.py"
click node_inventory "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/inventory/services.py"
click node_delivery "https://github.com/sovandarachim2-commits/shadow-shop/tree/main/backend/apps/delivery"
click node_finance "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/finance/models.py"
click node_reports "https://github.com/sovandarachim2-commits/shadow-shop/tree/main/backend/apps/reports"
click node_accounts "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/accounts/models.py"
click node_accountviews "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/accounts/views.py"
click node_notifications "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/notifications/services.py"
click node_media "https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/utils/storage.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_webapp,node_shop,node_adminui,node_api,node_staff toneBlue
class node_catalog,node_orders,node_checkout,node_payment,node_paymentrecords toneAmber
class node_inventory,node_delivery,node_finance,node_reports toneMint
class node_accounts,node_accountviews,node_notifications,node_media toneRose
class node_customer,node_telegram,node_aba,node_bakong toneIndigo
```

## Components

### Web application

- [React application](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Customer shopping](https://github.com/sovandarachim2-commits/shadow-shop/tree/main/frontend/src/pages/customer): `frontend/src/pages/customer`
- [Admin dashboard](https://github.com/sovandarachim2-commits/shadow-shop/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Frontend API modules](https://github.com/sovandarachim2-commits/shadow-shop/tree/main/frontend/src/api): `frontend/src/api`

### Commerce and catalog

- [Product catalog](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/products/models.py): `backend/apps/products/models.py`
- [Order management](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/orders/models.py): `backend/apps/orders/models.py`
- [Checkout orchestration](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/payments/checkout_flow.py): `backend/apps/payments/checkout_flow.py`
- [Payment services](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/payments/services.py): `backend/apps/payments/services.py`
- [Payment records](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/payments/models.py): `backend/apps/payments/models.py`

### Operations

- [Inventory and transfers](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/inventory/services.py): `backend/apps/inventory/services.py`
- [Delivery tracking](https://github.com/sovandarachim2-commits/shadow-shop/tree/main/backend/apps/delivery): `backend/apps/delivery`
- [Finance](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/finance/models.py): `backend/apps/finance/models.py`
- [Business reports](https://github.com/sovandarachim2-commits/shadow-shop/tree/main/backend/apps/reports): `backend/apps/reports`

### Identity and integrations

- [Accounts and permissions](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/accounts/models.py): `backend/apps/accounts/models.py`
- [Account workflows](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/accounts/views.py): `backend/apps/accounts/views.py`
- [Telegram notifications](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/apps/notifications/services.py): `backend/apps/notifications/services.py`
- [Media storage](https://github.com/sovandarachim2-commits/shadow-shop/blob/main/backend/utils/storage.py): `backend/utils/storage.py`

### Other components

- **Customer**
- **Staff user**
- **Telegram Bot**
- **ABA PayWay**
- **Bakong payment**

## Connections

- Customer → React application: uses (evidence: `README.md`)
- Staff user → React application: uses (evidence: `README.md`)
- React application → Customer shopping: routes to (evidence: `frontend/src/App.jsx`)
- React application → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Customer shopping → Frontend API modules: requests data
- Admin dashboard → Frontend API modules: requests data
- Frontend API modules → Product catalog: calls API
- Frontend API modules → Order management: calls API
- Frontend API modules → Checkout orchestration: calls API
- Frontend API modules → Inventory and transfers: calls API
- Frontend API modules → Delivery tracking: calls API
- Frontend API modules → Finance: calls API
- Frontend API modules → Business reports: calls API
- Frontend API modules → Account workflows: calls API
- Checkout orchestration → Payment services: delegates to (evidence: `backend/apps/payments/checkout_flow.py`)
- Payment services → Payment records: records payments (evidence: `backend/apps/payments/services.py`)
- Payment services → ABA PayWay: checks status
- Payment services → Bakong payment: checks status (evidence: `backend/apps/payments/services.py`)
- Checkout orchestration → Order management: fulfills checkout
- Order management → Inventory and transfers: deducts stock (evidence: `backend/apps/orders/serializers.py`)
- Order management → Finance: updates finance (evidence: `backend/apps/orders/serializers.py`)
- Order management → Telegram notifications: notifies (evidence: `backend/apps/orders/serializers.py`)
- Telegram notifications → Telegram Bot: sends messages (evidence: `backend/apps/notifications/services.py`)
- Account workflows → Accounts and permissions: reads and updates (evidence: `backend/apps/accounts/views.py`)
- Account workflows → Telegram notifications: requests alerts (evidence: `backend/apps/accounts/views.py`)
- Product catalog → Media storage: stores uploads (evidence: `backend/apps/products/models.py`)
- Product catalog → Inventory and transfers: uses stock (evidence: `backend/apps/products/models.py`)
