How msbillings/restaurant-billing works
This repository implements a restaurant POS and billing product, with a separate super-admin portal for managing customer accounts, licenses, and tenant clusters. The main workflow runs from staff POS actions or customer menu/order submissions through backend routes and order processing into tenant-isolated restaurant data, with billing, kitchen/table operations, and notifications. The frontend also supports offline queueing and synchronization. The tree documents broader inventory, analytics, CRM, loyalty, and integrations; excerpts confirm only selected wiring, so uncertain connections are omitted.
Main entry points: publicRoutes.js Public ordering routes · orderController.js Order processing · server.js API server · clientController.js Client management
Components 26
Restaurant POS
- POS interface
Frontend/src/App.jsx - Billing screens
Frontend/src/components/BillingPage.jsx - Customer ordering
Frontend/src/components/CustomerMenu.jsx - Offline sync
Frontend/src/utils/syncEngine.js - Offline cache
Frontend/src/db/offlineDb.js
Restaurant Backend
- API server
Backend/server.js - Public ordering routes
Backend/routes/publicRoutes.js - Order processing
Backend/controllers/orderController.js - Billing records
Backend/models/Bill.js - Floor operations
Backend/controllers/floorController.js - Inventory operations
Backend/controllers/inventoryController.js - Tax calculation
Backend/utils/billHelpers.js - Kitchen printing
Backend/services/printerService.js - Live notifications
Backend/utils/notificationHelper.js - Restaurant features
Backend/controllers - WhatsApp service
Backend/services/whatsappService.js
Tenant Platform
- Tenant resolution
Backend/utils/tenantManager.js - Restaurant data
Backend/models/Bill.js
Super Admin
- Admin portal
SuperAdminFrontend/src/App.jsx - Admin server
SuperAdminServer/server.js - Client management
SuperAdminServer/controllers/clientController.js - License records
SuperAdminServer/models/License.js - Tenant cluster access
SuperAdminServer/utils/clusterManager.js - Tenant user accounts
Other components
- Restaurant staff
- Online customers
Connections 27
- Restaurant staff → POS interface: uses
- POS interface → Billing screens: opens
- Billing screens → API server: requests
- Online customers → Customer ordering: orders through
- Customer ordering → API server: submits orders
- API server → Public ordering routes: dispatches
- Public ordering routes → Billing records: creates bill
- Public ordering routes → Floor operations: updates status
- Public ordering routes → Kitchen printing: prints KOT
- Public ordering routes → Live notifications: emits alerts
- API server → Order processing: dispatches
- Order processing → Billing records: reads and writes
- Order processing → Tax calculation: gets tax rate
- Order processing → Inventory operations: deducts stock
- Order processing → Floor operations: updates table
- Order processing → Restaurant data: persists via tenant model
- Public ordering routes → Tenant resolution: resolves models
- Tenant resolution → Restaurant data: selects tenant data
- Offline sync → API server: replays queued requests
- Offline sync → Offline cache: reads and updates queue
- Offline sync → Offline cache: caches menu data
- POS interface → Restaurant features: presents product areas
- Admin portal → Admin server: manages platform
- Admin server → Client management: dispatches
- Client management → License records: creates licenses
- Client management → Tenant cluster access: opens tenant database
- Client management → Tenant user accounts: provisions accounts