# openshiporg/openfront-restaurant architecture

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

- Interactive diagram: https://gitdiagram.com/openshiporg/openfront-restaurant
- Repository: https://github.com/openshiporg/openfront-restaurant

## Overview

Openfront Restaurant is a restaurant operations and ordering platform. Guests browse a digital menu, place orders, and manage accounts; staff use the dashboard for POS, kitchen, floor, menu, and guest-flow operations. The README describes Keystone/GraphQL-backed services and role-aware AI tools; sampled POS and service-floor clients directly request `/api/graphql`, while the payment webhook route invokes the Keystone webhook mutation. Other domain links below follow documented capabilities; unsampled implementations are represented at their existing feature paths, and the source excerpts do not establish their internal call graph.

Main entry points: [`pages/api/graphql.ts`](https://github.com/openshiporg/openfront-restaurant/blob/master/pages/api/graphql.ts) (GraphQL API), [`features/keystone/mutations/transitionRestaurantOrder.ts`](https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/mutations/transitionRestaurantOrder.ts) (Order lifecycle), [`app/api/integrations/payment/[providerCode]/webhook/route.ts`](https://github.com/openshiporg/openfront-restaurant/blob/master/app/api/integrations/payment/%5BproviderCode%5D/webhook/route.ts) (Payment webhook), [`app/(storefront)/(main)/menu/[id]/page.tsx`](https://github.com/openshiporg/openfront-restaurant/blob/master/app/(storefront)/(main)/menu/%5Bid%5D/page.tsx) (Menu and ordering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest storefront"]
  node_storefront["Menu and ordering<br/>[page.tsx]"]
  node_cart["Cart and checkout<br/>[CartContext.tsx]"]
  node_account["Guest account<br/>[page.tsx]"]
end

subgraph group_staff["Staff operations"]
  node_admin["Admin dashboard<br/>[ListPageClient.tsx]"]
  node_menuadmin["Menu engineering<br/>[page.tsx]"]
  node_pos["Point of sale<br/>[POSClient.tsx]"]
  node_floor["Service floor"]
  node_kds["Kitchen display<br/>[KDSClient.tsx]"]
  node_waitlist["Waitlist and reservations"]
  node_reports["Operations reports<br/>[page.tsx]"]
end

subgraph group_backend["Restaurant backend"]
  node_graphql{{"GraphQL API<br/>[graphql.ts]"}}
  node_orders["Order lifecycle"]
  node_inventory["Inventory and recipes<br/>[inventoryLedger.ts]"]
  node_data[("Restaurant records<br/>[RestaurantOrder.ts]")]
  node_permissions["Role permissions<br/>[access.ts]"]
  node_payments["Payment processing<br/>[processPayment.ts]"]
end

subgraph group_integrations["External interfaces"]
  node_provider["Payment providers<br/>[index.ts]"]
  node_webhook{{"Payment webhook<br/>[route.ts]"}}
  node_ai["AI assistant<br/>[route.ts]"]
end

node_guest(("Guest"))
node_staffuser(("Restaurant staff"))

node_guest -.->|"browses"| node_storefront
node_storefront -.->|"adds items"| node_cart
node_cart -.->|"submits order"| node_graphql
node_guest -.->|"manages account"| node_account
node_staffuser -->|"manages"| node_admin
node_admin -->|"configures"| node_menuadmin
node_staffuser -->|"takes orders"| node_pos
node_pos -->|"requests data"| node_graphql
node_staffuser -->|"seats guests"| node_floor
node_floor -->|"requests data"| node_graphql
node_staffuser -->|"prepares orders"| node_kds
node_staffuser -->|"manages guest flow"| node_waitlist
node_staffuser -->|"reviews performance"| node_reports
node_graphql -.->|"dispatches operations"| node_orders
node_orders -.->|"updates records"| node_data
node_orders -.->|"reconciles stock"| node_inventory
node_graphql -->|"enforces roles"| node_permissions
node_graphql -.->|"processes payment"| node_payments
node_payments -.->|"charges through"| node_provider
node_webhook -->|"uses Keystone context"| node_graphql
node_webhook -->|"invokes handler"| node_orders
node_staffuser -->|"asks operations"| node_ai
node_ai -->|"uses same API"| node_graphql

click node_storefront "https://github.com/openshiporg/openfront-restaurant/blob/master/app/(storefront)/(main)/menu/%5Bid%5D/page.tsx"
click node_cart "https://github.com/openshiporg/openfront-restaurant/blob/master/features/storefront/context/CartContext.tsx"
click node_account "https://github.com/openshiporg/openfront-restaurant/blob/master/app/(storefront)/(main)/account/%40dashboard/page.tsx"
click node_admin "https://github.com/openshiporg/openfront-restaurant/blob/master/features/dashboard/screens/ListPage/ListPageClient.tsx"
click node_menuadmin "https://github.com/openshiporg/openfront-restaurant/blob/master/app/dashboard/(admin)/platform/menu-items/page.tsx"
click node_pos "https://github.com/openshiporg/openfront-restaurant/blob/master/features/platform/pos/screens/POSClient.tsx"
click node_floor "https://github.com/openshiporg/openfront-restaurant/blob/master/features/platform/service-floor/screens/ServiceFloorClient.tsx"
click node_kds "https://github.com/openshiporg/openfront-restaurant/blob/master/features/platform/kds/screens/KDSClient.tsx"
click node_waitlist "https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/mutations/waitlistManagement.ts"
click node_reports "https://github.com/openshiporg/openfront-restaurant/blob/master/app/dashboard/(admin)/reports/sales/page.tsx"
click node_graphql "https://github.com/openshiporg/openfront-restaurant/blob/master/pages/api/graphql.ts"
click node_orders "https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/mutations/transitionRestaurantOrder.ts"
click node_inventory "https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/utils/inventoryLedger.ts"
click node_data "https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/models/RestaurantOrder.ts"
click node_permissions "https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/access.ts"
click node_payments "https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/mutations/processPayment.ts"
click node_provider "https://github.com/openshiporg/openfront-restaurant/blob/master/features/integrations/payment/index.ts"
click node_webhook "https://github.com/openshiporg/openfront-restaurant/blob/master/app/api/integrations/payment/%5BproviderCode%5D/webhook/route.ts"
click node_ai "https://github.com/openshiporg/openfront-restaurant/blob/master/app/api/mcp-transport/%5Btransport%5D/route.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_storefront,node_cart,node_account toneBlue
class node_admin,node_menuadmin,node_pos,node_floor,node_kds,node_waitlist,node_reports toneAmber
class node_graphql,node_orders,node_inventory,node_data,node_permissions,node_payments toneMint
class node_provider,node_webhook,node_ai toneRose
class node_guest,node_staffuser toneIndigo
```

## Components

### Guest storefront

- [Menu and ordering](https://github.com/openshiporg/openfront-restaurant/blob/master/app/(storefront)/(main)/menu/%5Bid%5D/page.tsx): `app/(storefront)/(main)/menu/[id]/page.tsx`
- [Cart and checkout](https://github.com/openshiporg/openfront-restaurant/blob/master/features/storefront/context/CartContext.tsx): `features/storefront/context/CartContext.tsx`
- [Guest account](https://github.com/openshiporg/openfront-restaurant/blob/master/app/(storefront)/(main)/account/%40dashboard/page.tsx): `app/(storefront)/(main)/account/@dashboard/page.tsx`

### Staff operations

- [Admin dashboard](https://github.com/openshiporg/openfront-restaurant/blob/master/features/dashboard/screens/ListPage/ListPageClient.tsx): `features/dashboard/screens/ListPage/ListPageClient.tsx`
- [Menu engineering](https://github.com/openshiporg/openfront-restaurant/blob/master/app/dashboard/(admin)/platform/menu-items/page.tsx): `app/dashboard/(admin)/platform/menu-items/page.tsx`
- [Point of sale](https://github.com/openshiporg/openfront-restaurant/blob/master/features/platform/pos/screens/POSClient.tsx): `features/platform/pos/screens/POSClient.tsx`
- [Service floor](https://github.com/openshiporg/openfront-restaurant/blob/master/features/platform/service-floor/screens/ServiceFloorClient.tsx): `features/platform/service-floor/screens/ServiceFloorClient.tsx`
- [Kitchen display](https://github.com/openshiporg/openfront-restaurant/blob/master/features/platform/kds/screens/KDSClient.tsx): `features/platform/kds/screens/KDSClient.tsx`
- [Waitlist and reservations](https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/mutations/waitlistManagement.ts): `features/keystone/mutations/waitlistManagement.ts`
- [Operations reports](https://github.com/openshiporg/openfront-restaurant/blob/master/app/dashboard/(admin)/reports/sales/page.tsx): `app/dashboard/(admin)/reports/sales/page.tsx`

### Restaurant backend

- [GraphQL API](https://github.com/openshiporg/openfront-restaurant/blob/master/pages/api/graphql.ts): `pages/api/graphql.ts`
- [Order lifecycle](https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/mutations/transitionRestaurantOrder.ts): `features/keystone/mutations/transitionRestaurantOrder.ts`
- [Inventory and recipes](https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/utils/inventoryLedger.ts): `features/keystone/utils/inventoryLedger.ts`
- [Restaurant records](https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/models/RestaurantOrder.ts): `features/keystone/models/RestaurantOrder.ts`
- [Role permissions](https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/access.ts): `features/keystone/access.ts`
- [Payment processing](https://github.com/openshiporg/openfront-restaurant/blob/master/features/keystone/mutations/processPayment.ts): `features/keystone/mutations/processPayment.ts`

### External interfaces

- [Payment providers](https://github.com/openshiporg/openfront-restaurant/blob/master/features/integrations/payment/index.ts): `features/integrations/payment/index.ts`
- [Payment webhook](https://github.com/openshiporg/openfront-restaurant/blob/master/app/api/integrations/payment/%5BproviderCode%5D/webhook/route.ts): `app/api/integrations/payment/[providerCode]/webhook/route.ts`
- [AI assistant](https://github.com/openshiporg/openfront-restaurant/blob/master/app/api/mcp-transport/%5Btransport%5D/route.ts): `app/api/mcp-transport/[transport]/route.ts`

### Other components

- **Guest**
- **Restaurant staff**

## Connections

- Guest → Menu and ordering: browses
- Menu and ordering → Cart and checkout: adds items
- Cart and checkout → GraphQL API: submits order
- Guest → Guest account: manages account
- Restaurant staff → Admin dashboard: manages (evidence: `README.md`)
- Admin dashboard → Menu engineering: configures (evidence: `README.md`)
- Restaurant staff → Point of sale: takes orders (evidence: `README.md`)
- Point of sale → GraphQL API: requests data (evidence: `features/platform/pos/screens/POSClient.tsx`)
- Restaurant staff → Service floor: seats guests (evidence: `README.md`)
- Service floor → GraphQL API: requests data (evidence: `features/platform/service-floor/screens/ServiceFloorClient.tsx`)
- Restaurant staff → Kitchen display: prepares orders (evidence: `README.md`)
- Restaurant staff → Waitlist and reservations: manages guest flow (evidence: `README.md`)
- Restaurant staff → Operations reports: reviews performance (evidence: `README.md`)
- GraphQL API → Order lifecycle: dispatches operations
- Order lifecycle → Restaurant records: updates records
- Order lifecycle → Inventory and recipes: reconciles stock
- GraphQL API → Role permissions: enforces roles (evidence: `README.md`)
- GraphQL API → Payment processing: processes payment
- Payment processing → Payment providers: charges through
- Payment webhook → GraphQL API: uses Keystone context (evidence: `app/api/integrations/payment/[providerCode]/webhook/route.ts`)
- Payment webhook → Order lifecycle: invokes handler (evidence: `app/api/integrations/payment/[providerCode]/webhook/route.ts`)
- Restaurant staff → AI assistant: asks operations (evidence: `README.md`)
- AI assistant → GraphQL API: uses same API (evidence: `README.md`)
