# samchanpanha/smart-restaurant-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/samchanpanha/smart-restaurant-management-system
- Repository: https://github.com/samchanpanha/smart-restaurant-management-system

## Overview

Restora is a restaurant operations system centered on a shared ticket and shift state. Staff sign in to a role-scoped terminal workspace, manage floor service and tickets, and share resulting state with kitchen, inventory, and owner views. Guests can use an open QR menu, while an optional server provides tenant-scoped persistence and live synchronization; AI and Telegram are additional capabilities. The graph preserves documented product branches, but some screen-level interactions are inferred only from the README rather than sampled source.

Main entry points: [`src/App.jsx`](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/App.jsx) (Role-based workspace), [`src/lib/store.jsx`](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/store.jsx) (Client state and actions), [`server/index.js`](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/server/index.js) (API and live sync), [`src/lib/reducer.js`](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/reducer.js) (Domain reducer and models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace and identity"]
  node_workspace["Role-based workspace<br/>[App.jsx]"]
  node_auth["Accounts and roles<br/>[auth.jsx]"]
  node_tabs["Workspace tabs<br/>[TabStrip.jsx]"]
end

subgraph group_service["Restaurant service"]
  node_floor["Floor and reservations<br/>[index.jsx]"]
  node_tickets["Tickets and payments<br/>[index.jsx]"]
  node_kitchen["Kitchen display<br/>[KitchenScreen.jsx]"]
  node_guestmenu["Guest QR menu<br/>[GuestScreen.jsx]"]
  node_miniapp["Telegram mini app"]
end

subgraph group_control["Management and insights"]
  node_catalog["Menu catalog<br/>[index.jsx]"]
  node_inventory["Inventory and stock"]
  node_purchases["Purchases and suppliers"]
  node_reports["Reports and costing<br/>[index.jsx]"]
  node_dashboard["Operations dashboard<br/>[index.jsx]"]
  node_settings["Settings and documents<br/>[index.jsx]"]
  node_assistant["AI assistant<br/>[index.jsx]"]
  node_telegram["Telegram notifications<br/>[notify.js]"]
end

subgraph group_platform["Shared state and platform"]
  node_store["Client state and actions<br/>[store.jsx]"]
  node_reducer["Domain reducer and models<br/>[reducer.js]"]
  node_api["API and live sync<br/>[index.js]"]
  node_database[("Tenant state and catalog<br/>[db.js]")]
end

node_staff(("Restaurant staff"))
node_guests(("Guests"))
node_ai_service{{"AI provider"}}
node_telegram_service{{"Telegram platform"}}

node_staff -->|"uses"| node_workspace
node_workspace -->|"authenticates"| node_auth
node_workspace -->|"shows"| node_tabs
node_workspace -->|"routes to"| node_floor
node_workspace -->|"routes to"| node_tickets
node_workspace -->|"routes to"| node_kitchen
node_workspace -->|"routes to"| node_dashboard
node_workspace -->|"routes to"| node_catalog
node_workspace -->|"routes to"| node_inventory
node_workspace -->|"routes to"| node_purchases
node_workspace -->|"routes to"| node_reports
node_workspace -->|"routes to"| node_settings
node_workspace -->|"routes to"| node_assistant
node_guests -->|"browses"| node_guestmenu
node_guests -->|"uses"| node_miniapp
node_floor -->|"dispatches actions"| node_store
node_tickets -.->|"updates tickets"| node_store
node_store -->|"applies actions"| node_reducer
node_reducer -->|"returns state"| node_store
node_kitchen -->|"reads shift state"| node_store
node_inventory -->|"shares shift state"| node_store
node_reports -->|"reads shift state"| node_store
node_dashboard -->|"reads shift state"| node_store
node_settings -->|"saves settings"| node_store
node_catalog -->|"reads catalog"| node_api
node_guestmenu -->|"reads menu"| node_api
node_miniapp -->|"claims tables"| node_api
node_store -->|"syncs actions"| node_api
node_api -->|"replays actions"| node_reducer
node_api -->|"loads and commits"| node_database
node_api -->|"broadcasts updates"| node_store
node_assistant -.->|"requests insights"| node_ai_service
node_api -->|"dispatches notifications"| node_telegram
node_telegram -.->|"sends messages"| node_telegram_service
node_purchases -.->|"records purchases"| node_store

click node_workspace "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/App.jsx"
click node_auth "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/auth.jsx"
click node_tabs "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/components/TabStrip.jsx"
click node_floor "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Floor/index.jsx"
click node_tickets "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Tickets/index.jsx"
click node_kitchen "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/KitchenScreen.jsx"
click node_guestmenu "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/GuestScreen.jsx"
click node_miniapp "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/MiniApp/sections/MiniAppTableController.jsx"
click node_catalog "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Catalog/index.jsx"
click node_inventory "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/InventoryScreen.jsx"
click node_purchases "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/PurchasesScreen.jsx"
click node_reports "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Reports/index.jsx"
click node_dashboard "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Dashboard/index.jsx"
click node_settings "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Settings/index.jsx"
click node_assistant "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Assistant/index.jsx"
click node_telegram "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/server/notify.js"
click node_store "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/store.jsx"
click node_reducer "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/reducer.js"
click node_api "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/server/index.js"
click node_database "https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/server/db.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_workspace,node_auth,node_tabs toneBlue
class node_floor,node_tickets,node_kitchen,node_guestmenu,node_miniapp toneAmber
class node_catalog,node_inventory,node_purchases,node_reports,node_dashboard,node_settings,node_assistant,node_telegram toneMint
class node_store,node_reducer,node_api,node_database toneRose
class node_staff,node_guests,node_ai_service,node_telegram_service toneIndigo
```

## Components

### Workspace and identity

- [Role-based workspace](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/App.jsx): `src/App.jsx`
- [Accounts and roles](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/auth.jsx): `src/lib/auth.jsx`
- [Workspace tabs](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/components/TabStrip.jsx): `src/components/TabStrip.jsx`

### Restaurant service

- [Floor and reservations](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Floor/index.jsx): `src/screens/Floor/index.jsx`
- [Tickets and payments](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Tickets/index.jsx): `src/screens/Tickets/index.jsx`
- [Kitchen display](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/KitchenScreen.jsx): `src/screens/KitchenScreen.jsx`
- [Guest QR menu](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/GuestScreen.jsx): `src/screens/GuestScreen.jsx`
- [Telegram mini app](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/MiniApp/sections/MiniAppTableController.jsx): `src/screens/MiniApp/sections/MiniAppTableController.jsx`

### Management and insights

- [Menu catalog](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Catalog/index.jsx): `src/screens/Catalog/index.jsx`
- [Inventory and stock](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/InventoryScreen.jsx): `src/screens/InventoryScreen.jsx`
- [Purchases and suppliers](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/PurchasesScreen.jsx): `src/screens/PurchasesScreen.jsx`
- [Reports and costing](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Reports/index.jsx): `src/screens/Reports/index.jsx`
- [Operations dashboard](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Dashboard/index.jsx): `src/screens/Dashboard/index.jsx`
- [Settings and documents](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Settings/index.jsx): `src/screens/Settings/index.jsx`
- [AI assistant](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/screens/Assistant/index.jsx): `src/screens/Assistant/index.jsx`
- [Telegram notifications](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/server/notify.js): `server/notify.js`

### Shared state and platform

- [Client state and actions](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/store.jsx): `src/lib/store.jsx`
- [Domain reducer and models](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/src/lib/reducer.js): `src/lib/reducer.js`
- [API and live sync](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/server/index.js): `server/index.js`
- [Tenant state and catalog](https://github.com/samchanpanha/smart-restaurant-management-system/blob/main/server/db.js): `server/db.js`

### Other components

- **Restaurant staff**
- **Guests**
- **AI provider**
- **Telegram platform**

## Connections

- Restaurant staff → Role-based workspace: uses (evidence: `README.md`)
- Role-based workspace → Accounts and roles: authenticates (evidence: `src/App.jsx`)
- Role-based workspace → Workspace tabs: shows (evidence: `src/App.jsx`)
- Role-based workspace → Floor and reservations: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Tickets and payments: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Kitchen display: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Operations dashboard: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Menu catalog: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Inventory and stock: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Purchases and suppliers: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Reports and costing: routes to (evidence: `src/App.jsx`)
- Role-based workspace → Settings and documents: routes to (evidence: `src/App.jsx`)
- Role-based workspace → AI assistant: routes to (evidence: `src/App.jsx`)
- Guests → Guest QR menu: browses (evidence: `README.md`)
- Guests → Telegram mini app: uses (evidence: `README.md`)
- Floor and reservations → Client state and actions: dispatches actions (evidence: `src/screens/Floor/index.jsx`)
- Tickets and payments → Client state and actions: updates tickets
- Client state and actions → Domain reducer and models: applies actions (evidence: `src/lib/store.jsx`)
- Domain reducer and models → Client state and actions: returns state (evidence: `src/lib/store.jsx`)
- Kitchen display → Client state and actions: reads shift state (evidence: `README.md`)
- Inventory and stock → Client state and actions: shares shift state (evidence: `README.md`)
- Reports and costing → Client state and actions: reads shift state (evidence: `README.md`)
- Operations dashboard → Client state and actions: reads shift state
- Settings and documents → Client state and actions: saves settings (evidence: `src/screens/Settings/index.jsx`)
- Menu catalog → API and live sync: reads catalog (evidence: `README.md`)
- Guest QR menu → API and live sync: reads menu (evidence: `README.md`)
- Telegram mini app → API and live sync: claims tables (evidence: `server/index.js`)
- Client state and actions → API and live sync: syncs actions (evidence: `README.md`)
- API and live sync → Domain reducer and models: replays actions (evidence: `server/index.js`)
- API and live sync → Tenant state and catalog: loads and commits (evidence: `server/index.js`)
- API and live sync → Client state and actions: broadcasts updates (evidence: `README.md`)
- AI assistant → AI provider: requests insights (evidence: `README.md`)
- API and live sync → Telegram notifications: dispatches notifications (evidence: `server/index.js`)
- Telegram notifications → Telegram platform: sends messages (evidence: `README.md`)
- Purchases and suppliers → Client state and actions: records purchases
