# highonkohi/monolith-pos architecture

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

- Interactive diagram: https://gitdiagram.com/highonkohi/monolith-pos
- Repository: https://github.com/highonkohi/monolith-pos

## Overview

Monolith POS is a multi-role restaurant point-of-sale and management application. Guests place table or advance orders; kitchen staff prepare and dispatch them; floor staff handle assistance and service; cashiers settle bills; managers administer menus, tables, events, staff, and reporting. The UI routes and role guards coordinate these workflows, while services and Supabase provide domain access and synchronization. The graph combines README-documented capabilities with excerpted routing, session, and persistence evidence; unsampled page internals are represented at their existing page paths, and uncertain implementation links are omitted.

Main entry points: [`src/routes/index.tsx`](https://github.com/highonkohi/monolith-pos/blob/main/src/routes/index.tsx) (Route Workflows), [`src/services/orderService.ts`](https://github.com/highonkohi/monolith-pos/blob/main/src/services/orderService.ts) (Order Operations), [`src/lib/supabase.ts`](https://github.com/highonkohi/monolith-pos/blob/main/src/lib/supabase.ts) (Supabase Client), [`src/pages/ServiceInterface/index.tsx`](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/ServiceInterface/index.tsx) (Floor Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Guest Ordering"]
  node_customer["QR Ordering<br/>[index.tsx]"]
  node_advance["Advance Orders<br/>[index.tsx]"]
end

subgraph group_operations["Restaurant Operations"]
  node_reception["Reception Desk<br/>[index.tsx]"]
  node_dispatcher["Kitchen Dispatch<br/>[index.tsx]"]
  node_viewer["Kitchen Viewer<br/>[index.tsx]"]
  node_service["Floor Service<br/>[index.tsx]"]
  node_cashier["Checkout<br/>[index.tsx]"]
end

subgraph group_management["Management"]
  node_tables["Floor Layout<br/>[index.tsx]"]
  node_menu["Menu Management<br/>[index.tsx]"]
  node_catalog["Menu Catalog<br/>[index.tsx]"]
  node_events["Events<br/>[index.tsx]"]
  node_accounts["Staff Accounts<br/>[index.tsx]"]
  node_analytics["Analytics<br/>[index.tsx]"]
  node_logs["Order Logs<br/>[index.tsx]"]
end

subgraph group_application["Application Control"]
  node_routes["Route Workflows<br/>[index.tsx]"]
  node_guards["Role Guards<br/>[ProtectedRoute.tsx]"]
  node_service_session["Service Sessions"]
end

subgraph group_data["Domain Data"]
  node_service_shifts["Shift Operations"]
  node_orders["Order Operations<br/>[orderService.ts]"]
  node_business_day["Business Day"]
  node_layout_service["Layout Operations"]
  node_menu_service["Menu Operations<br/>[menuService.ts]"]
  node_supabase_client["Supabase Client<br/>[supabase.ts]"]
end

node_guest(("Dining Guest"))
node_advance_guest(("Advance Guest"))
node_supabase[("Supabase Platform")]

node_guest -->|"places orders"| node_customer
node_advance_guest -->|"preorders"| node_advance
node_routes -->|"routes to"| node_customer
node_routes -->|"routes to"| node_advance
node_routes -->|"routes to"| node_dispatcher
node_routes -->|"routes to"| node_viewer
node_routes -->|"routes to"| node_service
node_routes -->|"routes to"| node_cashier
node_routes -->|"routes to"| node_reception
node_routes -->|"routes to"| node_tables
node_routes -->|"routes to"| node_menu
node_routes -->|"routes to"| node_catalog
node_routes -->|"routes to"| node_events
node_routes -->|"routes to"| node_accounts
node_routes -->|"routes to"| node_analytics
node_routes -->|"routes to"| node_logs
node_routes -->|"wraps protected routes"| node_guards
node_service -.->|"uses shift context"| node_service_session
node_service_session -->|"calls shift operations"| node_service_shifts
node_service_session -->|"syncs session events"| node_supabase
node_customer -->|"creates orders"| node_orders
node_advance -->|"submits preorders"| node_orders
node_dispatcher -->|"advances preparation"| node_orders
node_viewer -->|"monitors tickets"| node_orders
node_service -->|"tracks order status"| node_orders
node_cashier -->|"settles bills"| node_orders
node_tables -->|"manages layouts"| node_layout_service
node_layout_service -->|"queries data"| node_supabase_client
node_menu -->|"manages catalog"| node_menu_service
node_catalog -.->|"uses menu data"| node_menu_service
node_analytics -->|"reports on sales"| node_orders
node_logs -->|"audits history"| node_orders
node_supabase_client -->|"connects to"| node_supabase
node_service_shifts -->|"queries shifts"| node_supabase_client
node_orders -.->|"persists orders"| node_supabase_client
node_business_day -.->|"accesses day data"| node_supabase_client
node_menu_service -.->|"accesses menu data"| node_supabase_client

click node_customer "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/Customer/index.tsx"
click node_advance "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/AdvanceOrder/index.tsx"
click node_reception "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/ReceptionistInterface/index.tsx"
click node_dispatcher "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/DispatcherInterface/index.tsx"
click node_viewer "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/OrderViewer/index.tsx"
click node_service "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/ServiceInterface/index.tsx"
click node_cashier "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/CashierInterface/index.tsx"
click node_tables "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/TableManager/index.tsx"
click node_menu "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/MenuManager/index.tsx"
click node_catalog "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/MenuCatalog/index.tsx"
click node_events "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/Events/index.tsx"
click node_accounts "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/AccountManager/index.tsx"
click node_analytics "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/Analytics/index.tsx"
click node_logs "https://github.com/highonkohi/monolith-pos/blob/main/src/pages/OrderLogs/index.tsx"
click node_routes "https://github.com/highonkohi/monolith-pos/blob/main/src/routes/index.tsx"
click node_guards "https://github.com/highonkohi/monolith-pos/blob/main/src/components/auth/ProtectedRoute.tsx"
click node_service_session "https://github.com/highonkohi/monolith-pos/blob/main/src/contexts/ServiceSessionContext.tsx"
click node_service_shifts "https://github.com/highonkohi/monolith-pos/blob/main/src/services/serviceShiftService.ts"
click node_orders "https://github.com/highonkohi/monolith-pos/blob/main/src/services/orderService.ts"
click node_business_day "https://github.com/highonkohi/monolith-pos/blob/main/src/services/businessDayService.ts"
click node_layout_service "https://github.com/highonkohi/monolith-pos/blob/main/src/services/tableLayoutService.ts"
click node_menu_service "https://github.com/highonkohi/monolith-pos/blob/main/src/services/menuService.ts"
click node_supabase_client "https://github.com/highonkohi/monolith-pos/blob/main/src/lib/supabase.ts"

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_customer,node_advance toneBlue
class node_reception,node_dispatcher,node_viewer,node_service,node_cashier,node_supabase toneAmber
class node_tables,node_menu,node_catalog,node_events,node_accounts,node_analytics,node_logs toneMint
class node_routes,node_guards,node_service_session toneRose
class node_service_shifts,node_orders,node_business_day,node_layout_service,node_menu_service,node_supabase_client,node_guest,node_advance_guest toneIndigo
```

## Components

### Guest Ordering

- [QR Ordering](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/Customer/index.tsx): `src/pages/Customer/index.tsx`
- [Advance Orders](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/AdvanceOrder/index.tsx): `src/pages/AdvanceOrder/index.tsx`

### Restaurant Operations

- [Reception Desk](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/ReceptionistInterface/index.tsx): `src/pages/ReceptionistInterface/index.tsx`
- [Kitchen Dispatch](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/DispatcherInterface/index.tsx): `src/pages/DispatcherInterface/index.tsx`
- [Kitchen Viewer](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/OrderViewer/index.tsx): `src/pages/OrderViewer/index.tsx`
- [Floor Service](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/ServiceInterface/index.tsx): `src/pages/ServiceInterface/index.tsx`
- [Checkout](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/CashierInterface/index.tsx): `src/pages/CashierInterface/index.tsx`

### Management

- [Floor Layout](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/TableManager/index.tsx): `src/pages/TableManager/index.tsx`
- [Menu Management](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/MenuManager/index.tsx): `src/pages/MenuManager/index.tsx`
- [Menu Catalog](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/MenuCatalog/index.tsx): `src/pages/MenuCatalog/index.tsx`
- [Events](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/Events/index.tsx): `src/pages/Events/index.tsx`
- [Staff Accounts](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/AccountManager/index.tsx): `src/pages/AccountManager/index.tsx`
- [Analytics](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/Analytics/index.tsx): `src/pages/Analytics/index.tsx`
- [Order Logs](https://github.com/highonkohi/monolith-pos/blob/main/src/pages/OrderLogs/index.tsx): `src/pages/OrderLogs/index.tsx`

### Application Control

- [Route Workflows](https://github.com/highonkohi/monolith-pos/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Role Guards](https://github.com/highonkohi/monolith-pos/blob/main/src/components/auth/ProtectedRoute.tsx): `src/components/auth/ProtectedRoute.tsx`
- [Service Sessions](https://github.com/highonkohi/monolith-pos/blob/main/src/contexts/ServiceSessionContext.tsx): `src/contexts/ServiceSessionContext.tsx`

### Domain Data

- [Shift Operations](https://github.com/highonkohi/monolith-pos/blob/main/src/services/serviceShiftService.ts): `src/services/serviceShiftService.ts`
- [Order Operations](https://github.com/highonkohi/monolith-pos/blob/main/src/services/orderService.ts): `src/services/orderService.ts`
- [Business Day](https://github.com/highonkohi/monolith-pos/blob/main/src/services/businessDayService.ts): `src/services/businessDayService.ts`
- [Layout Operations](https://github.com/highonkohi/monolith-pos/blob/main/src/services/tableLayoutService.ts): `src/services/tableLayoutService.ts`
- [Menu Operations](https://github.com/highonkohi/monolith-pos/blob/main/src/services/menuService.ts): `src/services/menuService.ts`
- [Supabase Client](https://github.com/highonkohi/monolith-pos/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Dining Guest**
- **Advance Guest**
- **Supabase Platform**

## Connections

- Dining Guest → QR Ordering: places orders (evidence: `README.md`)
- Advance Guest → Advance Orders: preorders (evidence: `README.md`)
- Route Workflows → QR Ordering: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Advance Orders: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Kitchen Dispatch: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Kitchen Viewer: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Floor Service: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Checkout: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Reception Desk: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Floor Layout: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Menu Management: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Menu Catalog: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Events: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Staff Accounts: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Analytics: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Order Logs: routes to (evidence: `src/routes/index.tsx`)
- Route Workflows → Role Guards: wraps protected routes (evidence: `src/routes/index.tsx`)
- Floor Service → Service Sessions: uses shift context
- Service Sessions → Shift Operations: calls shift operations (evidence: `src/contexts/ServiceSessionContext.tsx`)
- Service Sessions → Supabase Platform: syncs session events
- QR Ordering → Order Operations: creates orders (evidence: `README.md`)
- Advance Orders → Order Operations: submits preorders (evidence: `README.md`)
- Kitchen Dispatch → Order Operations: advances preparation (evidence: `README.md`)
- Kitchen Viewer → Order Operations: monitors tickets (evidence: `README.md`)
- Floor Service → Order Operations: tracks order status (evidence: `README.md`)
- Checkout → Order Operations: settles bills (evidence: `README.md`)
- Floor Layout → Layout Operations: manages layouts
- Layout Operations → Supabase Client: queries data (evidence: `src/services/tableLayoutService.ts`)
- Menu Management → Menu Operations: manages catalog
- Menu Catalog → Menu Operations: uses menu data
- Analytics → Order Operations: reports on sales (evidence: `README.md`)
- Order Logs → Order Operations: audits history (evidence: `README.md`)
- Supabase Client → Supabase Platform: connects to (evidence: `src/lib/supabase.ts`)
- Shift Operations → Supabase Client: queries shifts (evidence: `src/services/serviceShiftService.ts`)
- Order Operations → Supabase Client: persists orders
- Business Day → Supabase Client: accesses day data
- Menu Operations → Supabase Client: accesses menu data
