How lollllz/ezycaf works
EzyCaf is a local-network restaurant ordering system: customers use table QR codes to order, kitchen staff update order progress, and cashiers record service and payment; admins configure branding and menus. The React client connects through a shared socket hook to the Node Hub, which coordinates order validation, security, SQLite state, and optional integrations. The README also documents guided setup, a client-only demo, and optional mobile-data customer access. Some server and client excerpts are partial; optional relay and sync links are shown only where documented or evidenced.
Main entry points: index.js Hub API and sockets · App.tsx Route shell · useSocket.ts Live client state · CustomerPage.tsx Customer ordering
Components 20
Restaurant screens
- Route shell
client/src/App.tsx - QR board
client/src/pages/HubPage.tsx - Customer ordering
client/src/pages/CustomerPage.tsx - Order tracking
client/src/components/CustomerOrders.tsx - Kitchen display
client/src/pages/KitchenPage.tsx - Cashier
client/src/pages/CashierPage.tsx - Menu and branding
client/src/pages/AdminPage.tsx - Setup guide
client/src/pages/SetupPage.tsx - Live client state
client/src/hooks/useSocket.ts - Demo state
client/src/lib/demo.ts
LAN hub
- Hub API and sockets
server/src/index.js - Order validation
server/src/order-service.js
Local state
- Restaurant database
server/src/db.js
Setup and access
- Staff access
server/src/staff-security.js - LAN addressing
server/src/network-access.js
Optional services
- Customer relay sync
server/src/customer-relay.js - Public customer service
relay/index.js - Supabase menu sync
server/src/supabase-sync.js
Other components
- Customer
- Cafe staff
Connections 30
- Customer → QR board: opens QR board
README.md - Customer → Customer ordering: scans table QR
README.md - Cafe staff → Kitchen display: updates orders
README.md - Cafe staff → Cashier: records payment
README.md - Cafe staff → Menu and branding: manages menu
README.md - Route shell → Live client state: uses live state
client/src/App.tsx - Route shell → QR board: routes to
client/src/App.tsx - Route shell → Customer ordering: routes to
client/src/App.tsx - Route shell → Kitchen display: routes to
client/src/App.tsx - Route shell → Cashier: routes to
client/src/App.tsx - Route shell → Setup guide: routes to
client/src/App.tsx - Route shell → Menu and branding: routes to
client/src/App.tsx - Route shell → Staff access: gates staff screens
client/src/App.tsx - Customer ordering → Live client state: creates orders
client/src/pages/CustomerPage.tsx - Customer ordering → Order tracking: renders receipts
client/src/pages/CustomerPage.tsx - Order tracking → Hub API and sockets: polls receipt status
client/src/components/CustomerOrders.tsx - Kitchen display → Live client state: reads and updates
client/src/pages/KitchenPage.tsx - Cashier → Live client state: reads and updates
client/src/pages/CashierPage.tsx - Menu and branding → Live client state: reads menu state
client/src/pages/AdminPage.tsx - Live client state → Demo state: uses demo mode
client/src/hooks/useSocket.ts - Live client state → Hub API and sockets: exchanges socket events
README.md - Hub API and sockets → Order validation: validates orders
server/src/index.js - Order validation → Restaurant database: reads and writes orders
server/src/order-service.js - Hub API and sockets → Restaurant database: reads and writes state
server/src/index.js - Hub API and sockets → Staff access: installs access routes
server/src/index.js - Hub API and sockets → LAN addressing: gets LAN address
server/src/index.js - Hub API and sockets → Supabase menu sync: syncs menu
server/src/index.js - Hub API and sockets → Customer relay sync: handles customer relay
server/src/index.js - Hub API and sockets → Public customer service: publishes customer access
- Public customer service → Restaurant database: stores snapshots and receipts
relay/index.js