# sivaprasad-ai/cafe architecture

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

- Interactive diagram: https://gitdiagram.com/sivaprasad-ai/cafe
- Repository: https://github.com/sivaprasad-ai/cafe

## Overview

Raghuveer Cafe is a QR-accessible cafe menu and order-management application. Customers browse and search menu categories, build a dine-in or takeaway cart, and submit an order; cafe staff can monitor and update orders, enter orders manually, and prepare receipts for sharing. The React app also provides table QR codes, while a Django REST backend stores and serves orders; the frontend has a local-storage fallback. Edges reflect shown imports and calls; the excerpts do not show the complete Django URL wiring.

Main entry points: [`customer-menu/src/App.jsx`](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/App.jsx) (Customer menu app), [`customer-menu/src/components/OwnerDashboard.jsx`](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/OwnerDashboard.jsx) (Order dashboard), [`customer-menu/src/menuData.js`](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/menuData.js) (Cafe menu data), [`backend/orders/views.py`](https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/views.py) (Order endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Ordering"]
  node_app["Customer menu app<br/>[App.jsx]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_category_nav["Category navigation<br/>[CategoryNav.jsx]"]
  node_menu_item["Menu item<br/>[MenuItem.jsx]"]
  node_search["Menu search<br/>[SearchBar.jsx]"]
  node_cart["Cart and checkout<br/>[CartDrawer.jsx]"]
  node_success["Order confirmation<br/>[OrderSuccess.jsx]"]
end

subgraph group_owner["Cafe Operations"]
  node_owner_dashboard["Order dashboard<br/>[OwnerDashboard.jsx]"]
  node_qr_codes["Table QR codes<br/>[TableQrCodes.jsx]"]
  node_bill_sharing["Receipt sharing<br/>[shareBill.js]"]
end

subgraph group_shared["Menu and Pricing"]
  node_menu_data["Cafe menu data<br/>[menuData.js]"]
  node_pricing["Variant and packing rules<br/>[pricing.js]"]
end

subgraph group_backend["Order Service"]
  node_api_client["Order API client<br/>[api.js]"]
  node_order_routes["Order routes<br/>[urls.py]"]
  node_order_views["Order endpoints<br/>[views.py]"]
  node_serializer["Order serialization<br/>[serializers.py]"]
  node_order_model[("Order records<br/>[models.py]")]
end

node_customer(("Cafe customer"))
node_owner_user(("Cafe staff"))

node_customer -->|"opens menu"| node_app
node_app -->|"renders"| node_landing
node_app -->|"renders"| node_category_nav
node_app -->|"renders"| node_menu_item
node_app -->|"renders"| node_search
node_app -->|"renders"| node_cart
node_app -->|"renders"| node_success
node_app -->|"reads menu"| node_menu_data
node_app -->|"calculates packing"| node_pricing
node_menu_item -->|"parses variants"| node_pricing
node_category_nav -->|"reads categories"| node_menu_data
node_landing -->|"reads menu"| node_menu_data
node_app -->|"submits order"| node_api_client
node_owner_user -->|"opens dashboard"| node_owner_dashboard
node_owner_user -->|"opens QR view"| node_qr_codes
node_owner_dashboard -->|"loads and updates"| node_api_client
node_owner_dashboard -->|"reads menu"| node_menu_data
node_owner_dashboard -->|"calculates order prices"| node_pricing
node_owner_dashboard -->|"formats receipt"| node_bill_sharing
node_api_client -.->|"requests order endpoints"| node_order_routes
node_order_routes -->|"routes requests"| node_order_views
node_order_views -->|"serializes orders"| node_serializer
node_order_views -->|"reads and updates"| node_order_model
node_serializer -->|"maps fields"| node_order_model

click node_app "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/App.jsx"
click node_landing "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/Landing.jsx"
click node_category_nav "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/CategoryNav.jsx"
click node_menu_item "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/MenuItem.jsx"
click node_search "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/SearchBar.jsx"
click node_cart "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/CartDrawer.jsx"
click node_success "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/OrderSuccess.jsx"
click node_menu_data "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/menuData.js"
click node_pricing "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/utils/pricing.js"
click node_owner_dashboard "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/OwnerDashboard.jsx"
click node_qr_codes "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/TableQrCodes.jsx"
click node_bill_sharing "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/utils/shareBill.js"
click node_api_client "https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/utils/api.js"
click node_order_routes "https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/urls.py"
click node_order_views "https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/views.py"
click node_serializer "https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/serializers.py"
click node_order_model "https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/models.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_app,node_landing,node_category_nav,node_menu_item,node_search,node_cart,node_success toneBlue
class node_owner_dashboard,node_qr_codes,node_bill_sharing toneAmber
class node_menu_data,node_pricing toneMint
class node_api_client,node_order_routes,node_order_views,node_serializer,node_order_model toneRose
class node_customer,node_owner_user toneIndigo
```

## Components

### Customer Ordering

- [Customer menu app](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/App.jsx): `customer-menu/src/App.jsx`
- [Landing page](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/Landing.jsx): `customer-menu/src/components/Landing.jsx`
- [Category navigation](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/CategoryNav.jsx): `customer-menu/src/components/CategoryNav.jsx`
- [Menu item](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/MenuItem.jsx): `customer-menu/src/components/MenuItem.jsx`
- [Menu search](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/SearchBar.jsx): `customer-menu/src/components/SearchBar.jsx`
- [Cart and checkout](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/CartDrawer.jsx): `customer-menu/src/components/CartDrawer.jsx`
- [Order confirmation](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/OrderSuccess.jsx): `customer-menu/src/components/OrderSuccess.jsx`

### Cafe Operations

- [Order dashboard](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/OwnerDashboard.jsx): `customer-menu/src/components/OwnerDashboard.jsx`
- [Table QR codes](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/components/TableQrCodes.jsx): `customer-menu/src/components/TableQrCodes.jsx`
- [Receipt sharing](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/utils/shareBill.js): `customer-menu/src/utils/shareBill.js`

### Menu and Pricing

- [Cafe menu data](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/menuData.js): `customer-menu/src/menuData.js`
- [Variant and packing rules](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/utils/pricing.js): `customer-menu/src/utils/pricing.js`

### Order Service

- [Order API client](https://github.com/sivaprasad-ai/cafe/blob/main/customer-menu/src/utils/api.js): `customer-menu/src/utils/api.js`
- [Order routes](https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/urls.py): `backend/orders/urls.py`
- [Order endpoints](https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/views.py): `backend/orders/views.py`
- [Order serialization](https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/serializers.py): `backend/orders/serializers.py`
- [Order records](https://github.com/sivaprasad-ai/cafe/blob/main/backend/orders/models.py): `backend/orders/models.py`

### Other components

- **Cafe customer**
- **Cafe staff**

## Connections

- Cafe customer → Customer menu app: opens menu
- Customer menu app → Landing page: renders (evidence: `customer-menu/src/App.jsx`)
- Customer menu app → Category navigation: renders (evidence: `customer-menu/src/App.jsx`)
- Customer menu app → Menu item: renders (evidence: `customer-menu/src/App.jsx`)
- Customer menu app → Menu search: renders (evidence: `customer-menu/src/App.jsx`)
- Customer menu app → Cart and checkout: renders (evidence: `customer-menu/src/App.jsx`)
- Customer menu app → Order confirmation: renders (evidence: `customer-menu/src/App.jsx`)
- Customer menu app → Cafe menu data: reads menu (evidence: `customer-menu/src/App.jsx`)
- Customer menu app → Variant and packing rules: calculates packing (evidence: `customer-menu/src/App.jsx`)
- Menu item → Variant and packing rules: parses variants (evidence: `customer-menu/src/components/MenuItem.jsx`)
- Category navigation → Cafe menu data: reads categories (evidence: `customer-menu/src/components/CategoryNav.jsx`)
- Landing page → Cafe menu data: reads menu (evidence: `customer-menu/src/components/Landing.jsx`)
- Customer menu app → Order API client: submits order (evidence: `customer-menu/src/App.jsx`)
- Cafe staff → Order dashboard: opens dashboard
- Cafe staff → Table QR codes: opens QR view
- Order dashboard → Order API client: loads and updates (evidence: `customer-menu/src/components/OwnerDashboard.jsx`)
- Order dashboard → Cafe menu data: reads menu (evidence: `customer-menu/src/components/OwnerDashboard.jsx`)
- Order dashboard → Variant and packing rules: calculates order prices (evidence: `customer-menu/src/components/OwnerDashboard.jsx`)
- Order dashboard → Receipt sharing: formats receipt (evidence: `customer-menu/src/components/OwnerDashboard.jsx`)
- Order API client → Order routes: requests order endpoints
- Order routes → Order endpoints: routes requests (evidence: `backend/orders/urls.py`)
- Order endpoints → Order serialization: serializes orders (evidence: `backend/orders/views.py`)
- Order endpoints → Order records: reads and updates (evidence: `backend/orders/views.py`)
- Order serialization → Order records: maps fields (evidence: `backend/orders/serializers.py`)
