# lebogang-g-masia/milky-shakes-drinks architecture

> Architecture diagram of the GitHub repository lebogang-g-masia/milky-shakes-drinks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lebogang-g-masia/milky-shakes-drinks
- Repository: https://github.com/lebogang-g-masia/milky-shakes-drinks

## Overview

Milky Shakes Drinks is a patron ordering and payment app paired with a manager/kitchen operations portal. Patrons browse the menu, configure a saved drink-pack draft, authenticate, submit an order, pay, and track/print or receive a receipt. Managers handle live order operations, inventory/store settings, reporting, and audit records. The README documents these API capabilities, but the sampled API excerpt does not expose every handler or its persistence path, so those branches are represented without speculative internal call chains.

Main entry points: [`packages/client/src/App.jsx`](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/App.jsx) (Web application), [`packages/client/src/OrderPlacement.jsx`](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/OrderPlacement.jsx) (Order builder), [`packages/api/src/app.js`](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/app.js) (Store and admin API), [`packages/client/src/LandingPage.jsx`](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/LandingPage.jsx) (Menu browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patron["Patron experience"]
  node_spa["Web application<br/>[App.jsx]"]
  node_navigation["Route navigation<br/>[router.jsx]"]
  node_browse["Menu browsing<br/>[LandingPage.jsx]"]
  node_flavours["Flavour guide<br/>[FlavoursPage.jsx]"]
  node_auth["Authentication<br/>[AuthPage.jsx]"]
  node_signup["Account signup<br/>[SignUp.jsx]"]
  node_draft[("Saved order draft<br/>[orderDraft.js]")]
  node_ordering["Order builder<br/>[OrderPlacement.jsx]"]
  node_order_history["Order history"]
  node_receipt["Receipt printing<br/>[ReceiptPrinter.jsx]"]
end

subgraph group_operations["Kitchen operations"]
  node_management["Manager dashboard"]
end

subgraph group_api["API services"]
  node_orders_api["Order and payment API<br/>[app.js]"]
  node_email["Receipt email<br/>[emailService.js]"]
  node_rbac["Role access control<br/>[rbac.js]"]
  node_operations_api["Store and admin API<br/>[app.js]"]
end

subgraph group_shared["Domain rules"]
  node_pricing["Pricing rules<br/>[rules.js]"]
  node_reporting["Reports and audit"]
end

node_patron(("Patron"))
node_supabase_auth["Supabase Auth"]
node_stripe["Stripe payments"]
node_smtp["SMTP relay"]
node_database[("Supabase PostgreSQL")]

node_patron -->|"opens"| node_spa
node_spa -->|"routes through"| node_navigation
node_spa -->|"renders"| node_browse
node_spa -->|"renders"| node_auth
node_spa -->|"renders"| node_ordering
node_spa -->|"renders"| node_flavours
node_spa -->|"renders"| node_order_history
node_spa -->|"renders"| node_management
node_ordering -->|"saves and loads"| node_draft
node_auth -->|"loads"| node_draft
node_browse -->|"reads count"| node_draft
node_ordering -->|"calculates totals"| node_pricing
node_ordering -.->|"reads menu and records payment"| node_database
node_ordering -.->|"submits orders"| node_orders_api
node_orders_api -->|"verifies payment webhook"| node_stripe
node_orders_api -->|"sends confirmation"| node_email
node_email -->|"delivers email"| node_smtp
node_order_history -->|"renders receipt"| node_receipt
node_management -.->|"manages orders and store"| node_operations_api
node_operations_api -->|"enforces roles"| node_rbac
node_operations_api -->|"uses report rules"| node_reporting
node_operations_api -.->|"reads and writes"| node_database
node_signup -.->|"registers accounts"| node_supabase_auth
node_auth -->|"renders signup"| node_signup
node_browse -.->|"reads flavour catalog"| node_database

click node_spa "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/App.jsx"
click node_navigation "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/router.jsx"
click node_browse "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/LandingPage.jsx"
click node_flavours "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/FlavoursPage.jsx"
click node_auth "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/AuthPage.jsx"
click node_signup "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/SignUp.jsx"
click node_draft "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/orderDraft.js"
click node_ordering "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/OrderPlacement.jsx"
click node_pricing "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/shared/src/constraints/rules.js"
click node_orders_api "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/app.js"
click node_order_history "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/PatronOrdersPage.jsx"
click node_receipt "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/ReceiptPrinter.jsx"
click node_email "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/emailService.js"
click node_management "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/ManagementDashboard.jsx"
click node_rbac "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/middleware/rbac.js"
click node_operations_api "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/app.js"
click node_reporting "https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/shared/src/schema/reporting.schema.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_spa,node_navigation,node_browse,node_flavours,node_auth,node_signup,node_draft,node_ordering,node_order_history,node_receipt toneBlue
class node_management,node_database toneAmber
class node_orders_api,node_email,node_rbac,node_operations_api toneMint
class node_pricing,node_reporting toneRose
class node_patron,node_supabase_auth,node_stripe,node_smtp toneIndigo
```

## Components

### Patron experience

- [Web application](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/App.jsx): `packages/client/src/App.jsx`
- [Route navigation](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/router.jsx): `packages/client/src/router.jsx`
- [Menu browsing](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/LandingPage.jsx): `packages/client/src/LandingPage.jsx`
- [Flavour guide](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/FlavoursPage.jsx): `packages/client/src/FlavoursPage.jsx`
- [Authentication](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/AuthPage.jsx): `packages/client/src/AuthPage.jsx`
- [Account signup](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/SignUp.jsx): `packages/client/src/SignUp.jsx`
- [Saved order draft](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/orderDraft.js): `packages/client/src/orderDraft.js`
- [Order builder](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/OrderPlacement.jsx): `packages/client/src/OrderPlacement.jsx`
- [Order history](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/PatronOrdersPage.jsx): `packages/client/src/PatronOrdersPage.jsx`
- [Receipt printing](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/ReceiptPrinter.jsx): `packages/client/src/ReceiptPrinter.jsx`

### Kitchen operations

- [Manager dashboard](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/client/src/ManagementDashboard.jsx): `packages/client/src/ManagementDashboard.jsx`

### API services

- [Order and payment API](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/app.js): `packages/api/src/app.js`
- [Receipt email](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/emailService.js): `packages/api/src/emailService.js`
- [Role access control](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/middleware/rbac.js): `packages/api/src/middleware/rbac.js`
- [Store and admin API](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/api/src/app.js): `packages/api/src/app.js`

### Domain rules

- [Pricing rules](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/shared/src/constraints/rules.js): `packages/shared/src/constraints/rules.js`
- [Reports and audit](https://github.com/lebogang-g-masia/milky-shakes-drinks/blob/main/packages/shared/src/schema/reporting.schema.js): `packages/shared/src/schema/reporting.schema.js`

### Other components

- **Patron**
- **Supabase Auth**
- **Stripe payments**
- **SMTP relay**
- **Supabase PostgreSQL**

## Connections

- Patron → Web application: opens (evidence: `README.md`)
- Web application → Route navigation: routes through (evidence: `packages/client/src/App.jsx`)
- Web application → Menu browsing: renders (evidence: `packages/client/src/App.jsx`)
- Web application → Authentication: renders (evidence: `packages/client/src/App.jsx`)
- Web application → Order builder: renders (evidence: `packages/client/src/App.jsx`)
- Web application → Flavour guide: renders (evidence: `packages/client/src/App.jsx`)
- Web application → Order history: renders (evidence: `packages/client/src/App.jsx`)
- Web application → Manager dashboard: renders (evidence: `packages/client/src/App.jsx`)
- Order builder → Saved order draft: saves and loads (evidence: `packages/client/src/OrderPlacement.jsx`)
- Authentication → Saved order draft: loads (evidence: `packages/client/src/AuthPage.jsx`)
- Menu browsing → Saved order draft: reads count (evidence: `packages/client/src/LandingPage.jsx`)
- Order builder → Pricing rules: calculates totals (evidence: `packages/client/src/OrderPlacement.jsx`)
- Order builder → Supabase PostgreSQL: reads menu and records payment
- Order builder → Order and payment API: submits orders
- Order and payment API → Stripe payments: verifies payment webhook (evidence: `README.md`)
- Order and payment API → Receipt email: sends confirmation (evidence: `packages/api/src/app.js`)
- Receipt email → SMTP relay: delivers email (evidence: `README.md`)
- Order history → Receipt printing: renders receipt (evidence: `packages/client/src/PatronOrdersPage.jsx`)
- Manager dashboard → Store and admin API: manages orders and store
- Store and admin API → Role access control: enforces roles (evidence: `packages/api/src/app.js`)
- Store and admin API → Reports and audit: uses report rules (evidence: `packages/api/src/app.js`)
- Store and admin API → Supabase PostgreSQL: reads and writes
- Account signup → Supabase Auth: registers accounts
- Authentication → Account signup: renders signup (evidence: `packages/client/src/AuthPage.jsx`)
- Menu browsing → Supabase PostgreSQL: reads flavour catalog
