# solohater/menu architecture

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

- Interactive diagram: https://gitdiagram.com/solohater/menu
- Repository: https://github.com/solohater/menu

## Overview

MenuFlow is a restaurant ordering and operations platform: guests browse a QR-linked menu, customize items, check out, and track orders; kitchen and floor staff handle preparation and delivery, while managers configure menus, tables, and settings and cashiers settle payments. The graph preserves those documented product surfaces and the backend domains visible in the source index. Some frontend-to-API and real-time wiring is not shown, so those links are omitted or marked unverified rather than inferred.

Main entry points: [`backend/cmd/server/main.go`](https://github.com/solohater/menu/blob/main/backend/cmd/server/main.go) (API server), [`backend/internal/order/handler.go`](https://github.com/solohater/menu/blob/main/backend/internal/order/handler.go) (Order handling), [`backend/internal/notification/handler.go`](https://github.com/solohater/menu/blob/main/backend/internal/notification/handler.go) (Notification handling), [`frontend/app/(guest)/t/[token]/menu/page.tsx`](https://github.com/solohater/menu/blob/main/frontend/app/(guest)/t/%5Btoken%5D/menu/page.tsx) (Guest menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest Ordering"]
  node_guest_menu["Guest menu<br/>[page.tsx]"]
  node_takeaway_menu["Takeaway menu<br/>[page.tsx]"]
  node_customize["Item customization<br/>[CustomizeSheet.tsx]"]
  node_voice_note["Voice notes"]
  node_offline[("Offline tray cache<br/>[offline-storage.ts]")]
  node_checkout["Guest checkout<br/>[page.tsx]"]
  node_tracker["Order tracker<br/>[page.tsx]"]
end

subgraph group_operations["Restaurant Operations"]
  node_service_request["Service requests"]
  node_admin["Manager dashboard<br/>[page.tsx]"]
  node_menu_admin["Menu management<br/>[page.tsx]"]
  node_tables_admin["Tables &amp; QR<br/>[page.tsx]"]
  node_settings["Restaurant settings<br/>[page.tsx]"]
  node_kds_ui["Kitchen display<br/>[page.tsx]"]
  node_waiter_ui["Waiter runner<br/>[page.tsx]"]
  node_cashier["Cashier register<br/>[page.tsx]"]
end

subgraph group_commerce["Orders &amp; Payments"]
  node_order_api["Order handling<br/>[handler.go]"]
  node_order_store[("Order repository<br/>[repository.go]")]
  node_payment_api["Payment handling<br/>[handler.go]"]
  node_payment_store[("Payment repository<br/>[repository.go]")]
end

subgraph group_platform["Restaurant Platform"]
  node_menu_api["Menu handling<br/>[handler.go]"]
  node_tenant_api["Tenant &amp; tables<br/>[handler.go]"]
  node_backend["API server<br/>[main.go]"]
end

subgraph group_realtime["Live Updates"]
  node_service_api["Notification handling<br/>[handler.go]"]
  node_websocket["WebSocket transport<br/>[handler.go]"]
end

node_guest(("Restaurant guest"))

node_guest -->|"browses"| node_guest_menu
node_guest -->|"browses"| node_takeaway_menu
node_guest_menu -->|"customizes items"| node_customize
node_customize -->|"renders recorder"| node_voice_note
node_guest_menu -.->|"caches menu and tray"| node_offline
node_guest -->|"reviews tray"| node_checkout
node_checkout -.->|"submits order"| node_order_api
node_order_api -->|"persists orders"| node_order_store
node_order_api -.->|"initiates payment"| node_payment_api
node_payment_api -->|"records payment"| node_payment_store
node_payment_api -.->|"updates status"| node_tracker
node_guest_menu -->|"requests assistance"| node_service_request
node_service_request -->|"posts request"| node_service_api
node_admin -->|"manages menu"| node_menu_admin
node_admin -->|"manages tables"| node_tables_admin
node_admin -->|"configures restaurant"| node_settings
node_menu_admin -.->|"updates menu"| node_menu_api
node_tables_admin -.->|"manages QR tables"| node_tenant_api
node_kds_ui -.->|"handles kitchen tickets"| node_order_api
node_waiter_ui -->|"loads requests"| node_service_api
node_waiter_ui -->|"receives live alerts"| node_websocket
node_waiter_ui -.->|"posts delivery"| node_service_api
node_cashier -.->|"settles cash"| node_payment_api
node_backend -->|"routes order requests"| node_order_api
node_backend -->|"routes menu requests"| node_menu_api
node_backend -->|"routes table requests"| node_tenant_api
node_backend -->|"routes service requests"| node_service_api
node_backend -->|"serves WebSocket"| node_websocket
node_service_api -->|"broadcasts events"| node_websocket
node_guest -->|"tracks order"| node_tracker

click node_guest_menu "https://github.com/solohater/menu/blob/main/frontend/app/(guest)/t/%5Btoken%5D/menu/page.tsx"
click node_takeaway_menu "https://github.com/solohater/menu/blob/main/frontend/app/(guest)/p/%5Btoken%5D/menu/page.tsx"
click node_customize "https://github.com/solohater/menu/blob/main/frontend/components/guest/CustomizeSheet.tsx"
click node_voice_note "https://github.com/solohater/menu/blob/main/frontend/components/guest/VoiceNoteRecorder.tsx"
click node_offline "https://github.com/solohater/menu/blob/main/frontend/lib/offline-storage.ts"
click node_checkout "https://github.com/solohater/menu/blob/main/frontend/app/(guest)/checkout/page.tsx"
click node_tracker "https://github.com/solohater/menu/blob/main/frontend/app/(guest)/order/%5Bid%5D/page.tsx"
click node_service_request "https://github.com/solohater/menu/blob/main/frontend/components/guest/ServiceRequestModal.tsx"
click node_admin "https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/page.tsx"
click node_menu_admin "https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/menu/page.tsx"
click node_tables_admin "https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/tables/page.tsx"
click node_settings "https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/settings/page.tsx"
click node_kds_ui "https://github.com/solohater/menu/blob/main/frontend/app/kds/page.tsx"
click node_waiter_ui "https://github.com/solohater/menu/blob/main/frontend/app/waiter/page.tsx"
click node_cashier "https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/cashier/page.tsx"
click node_order_api "https://github.com/solohater/menu/blob/main/backend/internal/order/handler.go"
click node_order_store "https://github.com/solohater/menu/blob/main/backend/internal/order/repository.go"
click node_payment_api "https://github.com/solohater/menu/blob/main/backend/internal/payment/handler.go"
click node_payment_store "https://github.com/solohater/menu/blob/main/backend/internal/payment/repository.go"
click node_menu_api "https://github.com/solohater/menu/blob/main/backend/internal/menu/handler.go"
click node_tenant_api "https://github.com/solohater/menu/blob/main/backend/internal/tenant/handler.go"
click node_service_api "https://github.com/solohater/menu/blob/main/backend/internal/notification/handler.go"
click node_websocket "https://github.com/solohater/menu/blob/main/backend/pkg/websocket/handler.go"
click node_backend "https://github.com/solohater/menu/blob/main/backend/cmd/server/main.go"

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_guest_menu,node_takeaway_menu,node_customize,node_voice_note,node_offline,node_checkout,node_tracker toneBlue
class node_service_request,node_admin,node_menu_admin,node_tables_admin,node_settings,node_kds_ui,node_waiter_ui,node_cashier toneAmber
class node_order_api,node_order_store,node_payment_api,node_payment_store toneMint
class node_menu_api,node_tenant_api,node_backend toneRose
class node_service_api,node_websocket,node_guest toneIndigo
```

## Components

### Guest Ordering

- [Guest menu](https://github.com/solohater/menu/blob/main/frontend/app/(guest)/t/%5Btoken%5D/menu/page.tsx): `frontend/app/(guest)/t/[token]/menu/page.tsx`
- [Takeaway menu](https://github.com/solohater/menu/blob/main/frontend/app/(guest)/p/%5Btoken%5D/menu/page.tsx): `frontend/app/(guest)/p/[token]/menu/page.tsx`
- [Item customization](https://github.com/solohater/menu/blob/main/frontend/components/guest/CustomizeSheet.tsx): `frontend/components/guest/CustomizeSheet.tsx`
- [Voice notes](https://github.com/solohater/menu/blob/main/frontend/components/guest/VoiceNoteRecorder.tsx): `frontend/components/guest/VoiceNoteRecorder.tsx`
- [Offline tray cache](https://github.com/solohater/menu/blob/main/frontend/lib/offline-storage.ts): `frontend/lib/offline-storage.ts`
- [Guest checkout](https://github.com/solohater/menu/blob/main/frontend/app/(guest)/checkout/page.tsx): `frontend/app/(guest)/checkout/page.tsx`
- [Order tracker](https://github.com/solohater/menu/blob/main/frontend/app/(guest)/order/%5Bid%5D/page.tsx): `frontend/app/(guest)/order/[id]/page.tsx`

### Restaurant Operations

- [Service requests](https://github.com/solohater/menu/blob/main/frontend/components/guest/ServiceRequestModal.tsx): `frontend/components/guest/ServiceRequestModal.tsx`
- [Manager dashboard](https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/page.tsx): `frontend/app/(admin)/admin/page.tsx`
- [Menu management](https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/menu/page.tsx): `frontend/app/(admin)/admin/menu/page.tsx`
- [Tables & QR](https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/tables/page.tsx): `frontend/app/(admin)/admin/tables/page.tsx`
- [Restaurant settings](https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/settings/page.tsx): `frontend/app/(admin)/admin/settings/page.tsx`
- [Kitchen display](https://github.com/solohater/menu/blob/main/frontend/app/kds/page.tsx): `frontend/app/kds/page.tsx`
- [Waiter runner](https://github.com/solohater/menu/blob/main/frontend/app/waiter/page.tsx): `frontend/app/waiter/page.tsx`
- [Cashier register](https://github.com/solohater/menu/blob/main/frontend/app/(admin)/admin/cashier/page.tsx): `frontend/app/(admin)/admin/cashier/page.tsx`

### Orders & Payments

- [Order handling](https://github.com/solohater/menu/blob/main/backend/internal/order/handler.go): `backend/internal/order/handler.go`
- [Order repository](https://github.com/solohater/menu/blob/main/backend/internal/order/repository.go): `backend/internal/order/repository.go`
- [Payment handling](https://github.com/solohater/menu/blob/main/backend/internal/payment/handler.go): `backend/internal/payment/handler.go`
- [Payment repository](https://github.com/solohater/menu/blob/main/backend/internal/payment/repository.go): `backend/internal/payment/repository.go`

### Restaurant Platform

- [Menu handling](https://github.com/solohater/menu/blob/main/backend/internal/menu/handler.go): `backend/internal/menu/handler.go`
- [Tenant & tables](https://github.com/solohater/menu/blob/main/backend/internal/tenant/handler.go): `backend/internal/tenant/handler.go`
- [API server](https://github.com/solohater/menu/blob/main/backend/cmd/server/main.go): `backend/cmd/server/main.go`

### Live Updates

- [Notification handling](https://github.com/solohater/menu/blob/main/backend/internal/notification/handler.go): `backend/internal/notification/handler.go`
- [WebSocket transport](https://github.com/solohater/menu/blob/main/backend/pkg/websocket/handler.go): `backend/pkg/websocket/handler.go`

### Other components

- **Restaurant guest**

## Connections

- Restaurant guest → Guest menu: browses (evidence: `README.md`)
- Restaurant guest → Takeaway menu: browses (evidence: `README.md`)
- Guest menu → Item customization: customizes items
- Item customization → Voice notes: renders recorder (evidence: `frontend/components/guest/CustomizeSheet.tsx`)
- Guest menu → Offline tray cache: caches menu and tray
- Restaurant guest → Guest checkout: reviews tray (evidence: `README.md`)
- Guest checkout → Order handling: submits order
- Order handling → Order repository: persists orders (evidence: `backend/internal/order/handler.go`)
- Order handling → Payment handling: initiates payment
- Payment handling → Payment repository: records payment (evidence: `backend/internal/payment/handler.go`)
- Payment handling → Order tracker: updates status
- Guest menu → Service requests: requests assistance (evidence: `README.md`)
- Service requests → Notification handling: posts request (evidence: `frontend/components/guest/ServiceRequestModal.tsx`)
- Manager dashboard → Menu management: manages menu (evidence: `README.md`)
- Manager dashboard → Tables & QR: manages tables (evidence: `README.md`)
- Manager dashboard → Restaurant settings: configures restaurant (evidence: `README.md`)
- Menu management → Menu handling: updates menu
- Tables & QR → Tenant & tables: manages QR tables
- Kitchen display → Order handling: handles kitchen tickets
- Waiter runner → Notification handling: loads requests (evidence: `frontend/app/waiter/page.tsx`)
- Waiter runner → WebSocket transport: receives live alerts (evidence: `frontend/app/waiter/page.tsx`)
- Waiter runner → Notification handling: posts delivery
- Cashier register → Payment handling: settles cash
- API server → Order handling: routes order requests (evidence: `backend/cmd/server/main.go`)
- API server → Menu handling: routes menu requests (evidence: `backend/cmd/server/main.go`)
- API server → Tenant & tables: routes table requests (evidence: `backend/cmd/server/main.go`)
- API server → Notification handling: routes service requests (evidence: `backend/cmd/server/main.go`)
- API server → WebSocket transport: serves WebSocket (evidence: `backend/cmd/server/main.go`)
- Notification handling → WebSocket transport: broadcasts events (evidence: `backend/internal/notification/handler.go`)
- Restaurant guest → Order tracker: tracks order (evidence: `README.md`)
