# vannarith10/coffee-shop-management-system architecture

> Architecture diagram of the GitHub repository vannarith10/coffee-shop-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vannarith10/coffee-shop-management-system
- Repository: https://github.com/vannarith10/coffee-shop-management-system

## Overview

This is a role-based café point-of-sale and shop-management frontend, rather than the generic Vite template described by its README. Staff sign in, reach role-specific admin, cashier, or barista screens, and use those workflows to manage the catalog and shop, process orders, and view business reports. The graph preserves these distinct product areas and shows only relationships supported by the router, sampled calls, or SOURCE INDEX references; several feature implementations were not sampled, so their internal wiring is intentionally omitted.

Main entry points: [`src/features/admin`](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/admin) (Admin workspace), [`src/App.tsx`](https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/App.tsx) (Role-based routes), [`src/lib/axios.ts`](https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/lib/axios.ts) (HTTP client), [`src/features/cashier`](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/cashier) (Cashier checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_routes["Role-based routes<br/>[App.tsx]"]
  node_auth["Login and session"]
  node_authstore[("Auth state<br/>[useAuthStore.ts]")]
  node_http["HTTP client<br/>[axios.ts]"]
  node_realtime["WebSocket manager"]
end

subgraph group_catalog["Catalog and inventory"]
  node_admin["Admin workspace"]
  node_products["Product catalog"]
  node_categories["Category management"]
  node_stock["Stock management"]
  node_menu["Product menu"]
end

subgraph group_orders["Sales and fulfillment"]
  node_cashier["Cashier checkout"]
  node_cart[("Cart state<br/>[useCartStore.ts]")]
  node_orders["Order operations"]
  node_barista["Barista order queue"]
end

subgraph group_insights["Shop and analytics"]
  node_staffmgmt["Staff administration"]
  node_shop["Shop settings"]
  node_analytics["Business analytics"]
  node_reports["Sales reports"]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_routes
node_routes -->|"routes to"| node_auth
node_routes -->|"routes to"| node_admin
node_routes -->|"routes to"| node_cashier
node_routes -->|"routes to"| node_barista
node_auth -->|"calls"| node_http
node_http -->|"reads token"| node_authstore
node_authstore -->|"connects or disconnects"| node_realtime
node_realtime -->|"reads token"| node_authstore
node_categories -->|"calls"| node_http
node_categories -->|"subscribes"| node_realtime
node_products -->|"calls"| node_http
node_orders -.->|"calls"| node_http
node_cashier -.->|"uses"| node_cart
node_cashier -.->|"submits orders"| node_orders
node_barista -.->|"views queue"| node_orders
node_admin -.->|"manages"| node_staffmgmt
node_admin -.->|"configures"| node_shop
node_admin -.->|"views"| node_analytics
node_admin -.->|"views"| node_reports
node_admin -.->|"manages"| node_categories
node_admin -.->|"manages"| node_products
node_admin -.->|"manages"| node_stock
node_cashier -.->|"browses"| node_menu

click node_routes "https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/App.tsx"
click node_auth "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/auth"
click node_authstore "https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/stores/useAuthStore.ts"
click node_http "https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/lib/axios.ts"
click node_realtime "https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/websocket/websocket-manager.ts"
click node_admin "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/admin"
click node_products "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/products"
click node_categories "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/categories"
click node_stock "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/stock"
click node_cashier "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/cashier"
click node_cart "https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/features/cart/hooks/useCartStore.ts"
click node_orders "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/orders"
click node_barista "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/barista"
click node_staffmgmt "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/staff"
click node_shop "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/shop"
click node_analytics "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/analytic"
click node_reports "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/report"
click node_menu "https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/Menu"

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_routes,node_auth,node_authstore,node_http,node_realtime,node_staff toneBlue
class node_admin,node_products,node_categories,node_stock,node_menu toneAmber
class node_cashier,node_cart,node_orders,node_barista toneMint
class node_staffmgmt,node_shop,node_analytics,node_reports toneRose
```

## Components

### Application and access

- [Role-based routes](https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/App.tsx): `src/App.tsx`
- [Login and session](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/auth): `src/features/auth`
- [Auth state](https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/stores/useAuthStore.ts): `src/stores/useAuthStore.ts`
- [HTTP client](https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/lib/axios.ts): `src/lib/axios.ts`
- [WebSocket manager](https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/websocket/websocket-manager.ts): `src/websocket/websocket-manager.ts`

### Catalog and inventory

- [Admin workspace](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/admin): `src/features/admin`
- [Product catalog](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/products): `src/features/products`
- [Category management](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/categories): `src/features/categories`
- [Stock management](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/stock): `src/features/stock`
- [Product menu](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/Menu): `src/features/Menu`

### Sales and fulfillment

- [Cashier checkout](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/cashier): `src/features/cashier`
- [Cart state](https://github.com/vannarith10/coffee-shop-management-system/blob/main/src/features/cart/hooks/useCartStore.ts): `src/features/cart/hooks/useCartStore.ts`
- [Order operations](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/orders): `src/features/orders`
- [Barista order queue](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/barista): `src/features/barista`

### Shop and analytics

- [Staff administration](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/staff): `src/features/staff`
- [Shop settings](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/shop): `src/features/shop`
- [Business analytics](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/analytic): `src/features/analytic`
- [Sales reports](https://github.com/vannarith10/coffee-shop-management-system/tree/main/src/features/report): `src/features/report`

### Other components

- **Staff user**

## Connections

- Staff user → Role-based routes: uses (evidence: `src/App.tsx`)
- Role-based routes → Login and session: routes to (evidence: `src/App.tsx`)
- Role-based routes → Admin workspace: routes to (evidence: `src/App.tsx`)
- Role-based routes → Cashier checkout: routes to (evidence: `src/App.tsx`)
- Role-based routes → Barista order queue: routes to (evidence: `src/App.tsx`)
- Login and session → HTTP client: calls (evidence: `src/features/auth/services/auth.service.ts`)
- HTTP client → Auth state: reads token (evidence: `src/lib/axios.ts`)
- Auth state → WebSocket manager: connects or disconnects (evidence: `src/stores/useAuthStore.ts`)
- WebSocket manager → Auth state: reads token (evidence: `src/websocket/websocket-manager.ts`)
- Category management → HTTP client: calls (evidence: `src/features/categories/services/category.ts`)
- Category management → WebSocket manager: subscribes (evidence: `src/features/categories/realtime/useUpdateCategoryWebsocket.ts`)
- Product catalog → HTTP client: calls (evidence: `src/features/products/services/product.ts`)
- Order operations → HTTP client: calls (evidence: `src/features/orders/hooks/useRetrieveOrder.ts`)
- Cashier checkout → Cart state: uses
- Cashier checkout → Order operations: submits orders
- Barista order queue → Order operations: views queue
- Admin workspace → Staff administration: manages
- Admin workspace → Shop settings: configures (evidence: `src/features/admin/components/Navbar.tsx`)
- Admin workspace → Business analytics: views
- Admin workspace → Sales reports: views
- Admin workspace → Category management: manages
- Admin workspace → Product catalog: manages
- Admin workspace → Stock management: manages
- Cashier checkout → Product menu: browses
