# rashid-rg/restaurant-pos architecture

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

- Interactive diagram: https://gitdiagram.com/rashid-rg/restaurant-pos
- Repository: https://github.com/rashid-rg/restaurant-pos

## Overview

GastroFlow is restaurant operations software: a staff POS and administration workspace, a customer ordering app, a driver delivery app, and a shared Express API. The main customer journey runs from restaurant/menu discovery through cart checkout to order tracking; staff handle sales, kitchen, inventory, and delivery operations, while drivers update assigned deliveries and submit proof. The graph includes documented SaaS, billing, and inventory capabilities. Several backend routes and frontend views were not sampled, so their inclusion and links rely on the README and source index rather than inspection of their implementation.

Main entry points: [`server.js`](https://github.com/rashid-rg/restaurant-pos/blob/main/server.js) (Express API), [`src/App.jsx`](https://github.com/rashid-rg/restaurant-pos/blob/main/src/App.jsx) (Staff Workspace), [`apps/customer-web/src/App.jsx`](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/App.jsx) (Customer App), [`apps/customer-web/src/views/CartCheckoutView.jsx`](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/CartCheckoutView.jsx) (Order Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Ordering"]
  node_customer_app["Customer App<br/>[App.jsx]"]
  node_restaurants["Restaurant Discovery"]
  node_menu["Menu Browsing<br/>[MenuView.jsx]"]
  node_cart["Cart State<br/>[CartContext.jsx]"]
  node_checkout["Order Checkout"]
  node_customer_auth["Customer Accounts"]
  node_tracking["Order Tracking"]
end

subgraph group_staff["Staff Workspace"]
  node_staff_app["Staff Workspace<br/>[App.jsx]"]
  node_pos["Point Of Sale<br/>[POSView.jsx]"]
  node_pos_state["POS State<br/>[POSContext.jsx]"]
  node_dashboard["Operations Dashboard<br/>[Dashboard.jsx]"]
  node_kitchen["Kitchen Tickets<br/>[KDSView.jsx]"]
  node_inventory["Inventory Operations"]
  node_billing_admin["SaaS Administration<br/>[PlatformAdmin.jsx]"]
end

subgraph group_delivery["Delivery Operations"]
  node_driver_app["Driver App<br/>[App.jsx]"]
  node_delivery_proof["Delivery Proof"]
end

subgraph group_backend["Shared API And Services"]
  node_api["Express API<br/>[server.js]"]
  node_inventory_routes["Inventory Routes"]
  node_manual_payments["Manual Payments<br/>[manual-payments.js]"]
  node_service_exceptions["Order Amendments"]
  node_tenders["Tender Utilities<br/>[tenders.js]"]
end

subgraph group_storage["Persistence"]
  node_pos_db[("Local POS Store<br/>[db.js]")]
  node_libsql[("Remote libSQL Store<br/>[libsql-store.js]")]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_customer_app
node_customer_app -->|"routes to"| node_restaurants
node_customer_app -->|"routes to"| node_menu
node_customer_app -->|"routes to"| node_checkout
node_customer_app -->|"routes to"| node_tracking
node_menu -.->|"adds items"| node_cart
node_checkout -->|"reads cart"| node_cart
node_checkout -->|"uses account"| node_customer_auth
node_checkout -.->|"submits orders"| node_api
node_customer_auth -->|"requests account"| node_api
node_tracking -.->|"requests status"| node_api
node_staff_app -->|"routes to"| node_pos
node_staff_app -->|"routes to"| node_dashboard
node_staff_app -->|"routes to"| node_kitchen
node_staff_app -.->|"routes to"| node_inventory
node_staff_app -->|"routes to"| node_billing_admin
node_pos -->|"uses state"| node_pos_state
node_pos_state -->|"reads and writes"| node_pos_db
node_driver_app -.->|"updates deliveries"| node_api
node_driver_app -->|"opens proof"| node_delivery_proof
node_api -->|"registers routes"| node_inventory_routes
node_api -->|"registers routes"| node_manual_payments
node_api -->|"registers routes"| node_service_exceptions
node_service_exceptions -->|"uses amounts"| node_tenders
node_inventory_routes -->|"uses amounts"| node_tenders
node_api -->|"selects remote store"| node_libsql

click node_customer_app "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/App.jsx"
click node_restaurants "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/RestaurantsView.jsx"
click node_menu "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/MenuView.jsx"
click node_cart "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/context/CartContext.jsx"
click node_checkout "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/CartCheckoutView.jsx"
click node_customer_auth "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/context/CustomerAuthContext.jsx"
click node_tracking "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/OrderTrackingView.jsx"
click node_staff_app "https://github.com/rashid-rg/restaurant-pos/blob/main/src/App.jsx"
click node_pos "https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/POSView.jsx"
click node_pos_state "https://github.com/rashid-rg/restaurant-pos/blob/main/src/context/POSContext.jsx"
click node_dashboard "https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/Dashboard.jsx"
click node_kitchen "https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/KDSView.jsx"
click node_inventory "https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/InventoryOperations.jsx"
click node_billing_admin "https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/PlatformAdmin.jsx"
click node_driver_app "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/driver-web/src/App.jsx"
click node_delivery_proof "https://github.com/rashid-rg/restaurant-pos/blob/main/apps/driver-web/src/ProofOfDeliveryModal.jsx"
click node_api "https://github.com/rashid-rg/restaurant-pos/blob/main/server.js"
click node_inventory_routes "https://github.com/rashid-rg/restaurant-pos/blob/main/routes/inventory-operations.js"
click node_manual_payments "https://github.com/rashid-rg/restaurant-pos/blob/main/routes/manual-payments.js"
click node_service_exceptions "https://github.com/rashid-rg/restaurant-pos/blob/main/routes/service-exceptions.js"
click node_tenders "https://github.com/rashid-rg/restaurant-pos/blob/main/lib/tenders.js"
click node_pos_db "https://github.com/rashid-rg/restaurant-pos/blob/main/src/database/db.js"
click node_libsql "https://github.com/rashid-rg/restaurant-pos/blob/main/lib/libsql-store.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_customer_app,node_restaurants,node_menu,node_cart,node_checkout,node_customer_auth,node_tracking toneBlue
class node_staff_app,node_pos,node_pos_state,node_dashboard,node_kitchen,node_inventory,node_billing_admin toneAmber
class node_driver_app,node_delivery_proof toneMint
class node_api,node_inventory_routes,node_manual_payments,node_service_exceptions,node_tenders toneRose
class node_pos_db,node_libsql,node_customer toneIndigo
```

## Components

### Customer Ordering

- [Customer App](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/App.jsx): `apps/customer-web/src/App.jsx`
- [Restaurant Discovery](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/RestaurantsView.jsx): `apps/customer-web/src/views/RestaurantsView.jsx`
- [Menu Browsing](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/MenuView.jsx): `apps/customer-web/src/views/MenuView.jsx`
- [Cart State](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/context/CartContext.jsx): `apps/customer-web/src/context/CartContext.jsx`
- [Order Checkout](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/CartCheckoutView.jsx): `apps/customer-web/src/views/CartCheckoutView.jsx`
- [Customer Accounts](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/context/CustomerAuthContext.jsx): `apps/customer-web/src/context/CustomerAuthContext.jsx`
- [Order Tracking](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/customer-web/src/views/OrderTrackingView.jsx): `apps/customer-web/src/views/OrderTrackingView.jsx`

### Staff Workspace

- [Staff Workspace](https://github.com/rashid-rg/restaurant-pos/blob/main/src/App.jsx): `src/App.jsx`
- [Point Of Sale](https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/POSView.jsx): `src/components/POSView.jsx`
- [POS State](https://github.com/rashid-rg/restaurant-pos/blob/main/src/context/POSContext.jsx): `src/context/POSContext.jsx`
- [Operations Dashboard](https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/Dashboard.jsx): `src/components/Dashboard.jsx`
- [Kitchen Tickets](https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/KDSView.jsx): `src/components/KDSView.jsx`
- [Inventory Operations](https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/InventoryOperations.jsx): `src/components/InventoryOperations.jsx`
- [SaaS Administration](https://github.com/rashid-rg/restaurant-pos/blob/main/src/components/PlatformAdmin.jsx): `src/components/PlatformAdmin.jsx`

### Delivery Operations

- [Driver App](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/driver-web/src/App.jsx): `apps/driver-web/src/App.jsx`
- [Delivery Proof](https://github.com/rashid-rg/restaurant-pos/blob/main/apps/driver-web/src/ProofOfDeliveryModal.jsx): `apps/driver-web/src/ProofOfDeliveryModal.jsx`

### Shared API And Services

- [Express API](https://github.com/rashid-rg/restaurant-pos/blob/main/server.js): `server.js`
- [Inventory Routes](https://github.com/rashid-rg/restaurant-pos/blob/main/routes/inventory-operations.js): `routes/inventory-operations.js`
- [Manual Payments](https://github.com/rashid-rg/restaurant-pos/blob/main/routes/manual-payments.js): `routes/manual-payments.js`
- [Order Amendments](https://github.com/rashid-rg/restaurant-pos/blob/main/routes/service-exceptions.js): `routes/service-exceptions.js`
- [Tender Utilities](https://github.com/rashid-rg/restaurant-pos/blob/main/lib/tenders.js): `lib/tenders.js`

### Persistence

- [Local POS Store](https://github.com/rashid-rg/restaurant-pos/blob/main/src/database/db.js): `src/database/db.js`
- [Remote libSQL Store](https://github.com/rashid-rg/restaurant-pos/blob/main/lib/libsql-store.js): `lib/libsql-store.js`

### Other components

- **Customer**

## Connections

- Customer → Customer App: uses (evidence: `README.md`)
- Customer App → Restaurant Discovery: routes to (evidence: `apps/customer-web/src/App.jsx`)
- Customer App → Menu Browsing: routes to (evidence: `apps/customer-web/src/App.jsx`)
- Customer App → Order Checkout: routes to (evidence: `apps/customer-web/src/App.jsx`)
- Customer App → Order Tracking: routes to (evidence: `apps/customer-web/src/App.jsx`)
- Menu Browsing → Cart State: adds items
- Order Checkout → Cart State: reads cart (evidence: `apps/customer-web/src/views/CartCheckoutView.jsx`)
- Order Checkout → Customer Accounts: uses account (evidence: `apps/customer-web/src/views/CartCheckoutView.jsx`)
- Order Checkout → Express API: submits orders
- Customer Accounts → Express API: requests account (evidence: `apps/customer-web/src/context/CustomerAuthContext.jsx`)
- Order Tracking → Express API: requests status
- Staff Workspace → Point Of Sale: routes to (evidence: `src/App.jsx`)
- Staff Workspace → Operations Dashboard: routes to (evidence: `src/App.jsx`)
- Staff Workspace → Kitchen Tickets: routes to (evidence: `src/App.jsx`)
- Staff Workspace → Inventory Operations: routes to
- Staff Workspace → SaaS Administration: routes to (evidence: `src/App.jsx`)
- Point Of Sale → POS State: uses state (evidence: `src/components/POSView.jsx`)
- POS State → Local POS Store: reads and writes (evidence: `src/context/POSContext.jsx`)
- Driver App → Express API: updates deliveries
- Driver App → Delivery Proof: opens proof (evidence: `apps/driver-web/src/App.jsx`)
- Express API → Inventory Routes: registers routes (evidence: `server.js`)
- Express API → Manual Payments: registers routes (evidence: `server.js`)
- Express API → Order Amendments: registers routes (evidence: `server.js`)
- Order Amendments → Tender Utilities: uses amounts (evidence: `routes/service-exceptions.js`)
- Inventory Routes → Tender Utilities: uses amounts (evidence: `routes/inventory-operations.js`)
- Express API → Remote libSQL Store: selects remote store (evidence: `server.js`)
