# vtechshop/dine-pos architecture

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

- Interactive diagram: https://gitdiagram.com/vtechshop/dine-pos
- Repository: https://github.com/vtechshop/dine-pos

## Overview

Dine POS is a multi-client restaurant point-of-sale and operations platform: staff and customers enter through the web/mobile POS or QR menu, requests reach the backend, and orders are persisted and acted on. Around that core, the repository includes kitchen, inventory, payments, reporting/AI, administration, and SaaS-management capabilities. The source index and excerpts support several key links; unsampled integrations are represented only as unverified dashed relationships, and no README was provided.

Main entry points: [`backend/src/server.ts`](https://github.com/vtechshop/dine-pos/blob/main/backend/src/server.ts) (HTTP and sockets), [`backend/src/routes/orderRoutes.ts`](https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/orderRoutes.ts) (Order handling), [`backend/src/routes/superAdminRoutes.ts`](https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/superAdminRoutes.ts) (SaaS administration), [`backend/src/models/Order.ts`](https://github.com/vtechshop/dine-pos/blob/main/backend/src/models/Order.ts) (Order records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Restaurant Clients"]
  node_mobile["Mobile POS<br/>[AppNavigator.tsx]"]
  node_web["Web POS<br/>[App.tsx]"]
  node_qr["QR ordering<br/>[App.tsx]"]
  node_admin["Admin console<br/>[App.tsx]"]
  node_sync["Offline sync<br/>[syncEngine.ts]"]
  node_api["Mobile API<br/>[api.ts]"]
  node_hoteladmin["Hotel detail UI"]
end

subgraph group_backend["Backend Runtime"]
  node_server["HTTP and sockets<br/>[server.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
end

subgraph group_operations["Restaurant Operations"]
  node_orders["Order handling<br/>[orderRoutes.ts]"]
  node_orderdata[("Order records<br/>[Order.ts]")]
  node_catalog["Menu and catalog<br/>[catalogRoutes.ts]"]
  node_inventory["Stock operations<br/>[stockUtils.ts]"]
  node_kitchen["Kitchen workflow"]
  node_payments["Payments<br/>[GatewayFactory.ts]"]
end

subgraph group_intelligence["Insights &amp; AI"]
  node_reports["Reports and analytics"]
  node_alerts["Operational alerts<br/>[alertEngine.ts]"]
  node_forecast["Forecasting<br/>[forecastEngine.ts]"]
end

subgraph group_platform["Platform Services"]
  node_superadmin["SaaS administration"]
  node_hotel[("Hotel configuration<br/>[Hotel.ts]")]
  node_redis[("Redis services<br/>[redis.ts]")]
end

node_staff(("Restaurant staff"))
node_guest(("QR guest"))

node_staff -->|"uses"| node_mobile
node_staff -->|"uses"| node_web
node_guest -->|"scans and orders"| node_qr
node_mobile -.->|"queues work"| node_sync
node_sync -->|"submits orders"| node_api
node_api -.->|"sends requests"| node_server
node_web -.->|"sends requests"| node_server
node_qr -.->|"sends requests"| node_server
node_admin -.->|"sends requests"| node_server
node_server -->|"mounts routes"| node_orders
node_server -.->|"configures middleware"| node_auth
node_server -->|"connects and closes"| node_redis
node_orders -->|"reads and writes"| node_orderdata
node_orders -->|"adjusts stock"| node_inventory
node_server -.->|"mounts routes"| node_catalog
node_server -.->|"mounts routes"| node_kitchen
node_orders -.->|"uses payment flow"| node_payments
node_server -.->|"mounts routes"| node_superadmin
node_superadmin -->|"manages hotels"| node_hotel
node_alerts -->|"checks delays"| node_orderdata
node_forecast -->|"uses snapshots"| node_orderdata
node_server -.->|"exposes analytics"| node_reports
node_hoteladmin -.->|"manages hotels"| node_superadmin

click node_mobile "https://github.com/vtechshop/dine-pos/blob/main/mobile/src/navigation/AppNavigator.tsx"
click node_web "https://github.com/vtechshop/dine-pos/blob/main/web/src/App.tsx"
click node_qr "https://github.com/vtechshop/dine-pos/blob/main/qr/src/App.tsx"
click node_admin "https://github.com/vtechshop/dine-pos/blob/main/admin/src/App.tsx"
click node_sync "https://github.com/vtechshop/dine-pos/blob/main/mobile/src/sync/syncEngine.ts"
click node_api "https://github.com/vtechshop/dine-pos/blob/main/mobile/src/services/api.ts"
click node_server "https://github.com/vtechshop/dine-pos/blob/main/backend/src/server.ts"
click node_auth "https://github.com/vtechshop/dine-pos/blob/main/backend/src/middleware/auth.ts"
click node_orders "https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/orderRoutes.ts"
click node_orderdata "https://github.com/vtechshop/dine-pos/blob/main/backend/src/models/Order.ts"
click node_catalog "https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/catalogRoutes.ts"
click node_inventory "https://github.com/vtechshop/dine-pos/blob/main/backend/src/utils/stockUtils.ts"
click node_kitchen "https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/kitchenStationRoutes.ts"
click node_payments "https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/payment/GatewayFactory.ts"
click node_reports "https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/executiveDashboard.ts"
click node_alerts "https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/alertEngine.ts"
click node_forecast "https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/forecastEngine.ts"
click node_superadmin "https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/superAdminRoutes.ts"
click node_hotel "https://github.com/vtechshop/dine-pos/blob/main/backend/src/models/Hotel.ts"
click node_redis "https://github.com/vtechshop/dine-pos/blob/main/backend/src/config/redis.ts"
click node_hoteladmin "https://github.com/vtechshop/dine-pos/tree/main/web/src/pages/super-admin"

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_mobile,node_web,node_qr,node_admin,node_sync,node_api,node_hoteladmin toneBlue
class node_server,node_auth toneAmber
class node_orders,node_orderdata,node_catalog,node_inventory,node_kitchen,node_payments toneMint
class node_reports,node_alerts,node_forecast toneRose
class node_superadmin,node_hotel,node_redis,node_staff,node_guest toneIndigo
```

## Components

### Restaurant Clients

- [Mobile POS](https://github.com/vtechshop/dine-pos/blob/main/mobile/src/navigation/AppNavigator.tsx): `mobile/src/navigation/AppNavigator.tsx`
- [Web POS](https://github.com/vtechshop/dine-pos/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [QR ordering](https://github.com/vtechshop/dine-pos/blob/main/qr/src/App.tsx): `qr/src/App.tsx`
- [Admin console](https://github.com/vtechshop/dine-pos/blob/main/admin/src/App.tsx): `admin/src/App.tsx`
- [Offline sync](https://github.com/vtechshop/dine-pos/blob/main/mobile/src/sync/syncEngine.ts): `mobile/src/sync/syncEngine.ts`
- [Mobile API](https://github.com/vtechshop/dine-pos/blob/main/mobile/src/services/api.ts): `mobile/src/services/api.ts`
- [Hotel detail UI](https://github.com/vtechshop/dine-pos/tree/main/web/src/pages/super-admin): `web/src/pages/super-admin`

### Backend Runtime

- [HTTP and sockets](https://github.com/vtechshop/dine-pos/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Authentication](https://github.com/vtechshop/dine-pos/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`

### Restaurant Operations

- [Order handling](https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/orderRoutes.ts): `backend/src/routes/orderRoutes.ts`
- [Order records](https://github.com/vtechshop/dine-pos/blob/main/backend/src/models/Order.ts): `backend/src/models/Order.ts`
- [Menu and catalog](https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/catalogRoutes.ts): `backend/src/routes/catalogRoutes.ts`
- [Stock operations](https://github.com/vtechshop/dine-pos/blob/main/backend/src/utils/stockUtils.ts): `backend/src/utils/stockUtils.ts`
- [Kitchen workflow](https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/kitchenStationRoutes.ts): `backend/src/routes/kitchenStationRoutes.ts`
- [Payments](https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/payment/GatewayFactory.ts): `backend/src/services/payment/GatewayFactory.ts`

### Insights & AI

- [Reports and analytics](https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/executiveDashboard.ts): `backend/src/services/executiveDashboard.ts`
- [Operational alerts](https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/alertEngine.ts): `backend/src/services/alertEngine.ts`
- [Forecasting](https://github.com/vtechshop/dine-pos/blob/main/backend/src/services/forecastEngine.ts): `backend/src/services/forecastEngine.ts`

### Platform Services

- [SaaS administration](https://github.com/vtechshop/dine-pos/blob/main/backend/src/routes/superAdminRoutes.ts): `backend/src/routes/superAdminRoutes.ts`
- [Hotel configuration](https://github.com/vtechshop/dine-pos/blob/main/backend/src/models/Hotel.ts): `backend/src/models/Hotel.ts`
- [Redis services](https://github.com/vtechshop/dine-pos/blob/main/backend/src/config/redis.ts): `backend/src/config/redis.ts`

### Other components

- **Restaurant staff**
- **QR guest**

## Connections

- Restaurant staff → Mobile POS: uses
- Restaurant staff → Web POS: uses
- QR guest → QR ordering: scans and orders (evidence: `qr/src/App.tsx`)
- Mobile POS → Offline sync: queues work
- Offline sync → Mobile API: submits orders (evidence: `mobile/src/sync/syncEngine.ts`)
- Mobile API → HTTP and sockets: sends requests
- Web POS → HTTP and sockets: sends requests
- QR ordering → HTTP and sockets: sends requests
- Admin console → HTTP and sockets: sends requests
- HTTP and sockets → Order handling: mounts routes (evidence: `backend/src/server.ts`)
- HTTP and sockets → Authentication: configures middleware
- HTTP and sockets → Redis services: connects and closes (evidence: `backend/src/server.ts`)
- Order handling → Order records: reads and writes (evidence: `backend/src/routes/orderRoutes.ts`)
- Order handling → Stock operations: adjusts stock (evidence: `backend/src/routes/orderRoutes.ts`)
- HTTP and sockets → Menu and catalog: mounts routes
- HTTP and sockets → Kitchen workflow: mounts routes (evidence: `backend/src/server.ts`)
- Order handling → Payments: uses payment flow
- HTTP and sockets → SaaS administration: mounts routes (evidence: `backend/src/server.ts`)
- SaaS administration → Hotel configuration: manages hotels (evidence: `backend/src/routes/superAdminRoutes.ts`)
- Operational alerts → Order records: checks delays (evidence: `backend/src/services/alertEngine.ts`)
- Forecasting → Order records: uses snapshots (evidence: `backend/src/services/forecastEngine.ts`)
- HTTP and sockets → Reports and analytics: exposes analytics
- Hotel detail UI → SaaS administration: manages hotels
