Spice Garden — Restaurant Management System
Complete Multi-Branch Restaurant Platform with POS, QR Ordering & AI
Demo Credentials
Owner
owner@spicegarden.com
123456
Manager
manager@spicegarden.com
123456
Cashier
cashier@spicegarden.com
123456
Kitchen
kitchen@spicegarden.com
123456
Waiter
waiter@spicegarden.com
123456
Project Overview
A complete, modern platform for running one or many restaurant branches from a single dashboard. The system unifies point-of-sale ordering, QR-code table ordering with live guest tracking, kitchen display, inventory that updates itself, a flexible salary & payroll engine, payments with split billing, discounts/charges control, analytics, fraud monitoring, an AI assistant, and automatic email alerts. Five role-based portals (Owner, Manager, Cashier, Kitchen, Waiter) ensure each user sees exactly what they need — from full system control to a focused kitchen board or order hub.
Technology Stack
Frontend
Backend
Database & Auth
AI & Integrations
User Portals & Roles
Owner
Full system control — settings (currency/tax/service charge), branches, staff, payroll, coupons, audit logs, fraud watch, AI copilot, and all operational pages.
- Configure restaurant-wide settings: currency, tax rate, service charge, order prefix
- Manage multi-branch hierarchy with self-referencing parent branches
- Full payroll control: generate run sheets, record payments, manage salary structures
- Fraud Watch with staff risk scoring from cancellation, cash share, and price-edit patterns
- Audit log viewer for tracking all sensitive actions across the system
- AI Copilot for natural-language queries over live restaurant data
- Access all 16+ sidebar pages including branches, coupons, and notifications
Manager
Day-to-day operations — orders, menu, tables, kitchen, inventory, suppliers, staff, attendance, payroll, and performance monitoring.
- Full order lifecycle management with POS, kitchen display, and payment recording
- Menu management: categories, items, recipe setup, and availability control
- Inventory tracking with low-stock alerts, supplier management, and purchase orders
- Staff roster with salary structure editing, attendance marking, and payroll generation
- Performance dashboard with branch-wide attendance overview and staff rankings
- Demand forecast with ingredient needs prediction and draft PO generation
- Access to 15 sidebar pages including AI copilot and notifications
Cashier
Payment-focused portal — order tracking, payment recording with Cash/Card/Online methods, payment history, and performance view.
- Order hub with Active/Ready/History tabs, search, due badges, and elapsed timers
- Payment recording: Cash, Card, or Online with pre-filled amounts and quick Full/Half chips
- Partial payment support — final payment auto-completes order and frees the table
- Payment history with method filtering, transaction stats, and order link-outs
- Personal performance page with attendance and earnings summary
Kitchen Staff
Focused kitchen board — view new orders, update preparation status, and track ready tickets with elapsed-time highlighting.
- 3-column board: New → Preparing → Ready with ticket counts
- One-tap actions: Start Preparing, Mark Ready
- Elapsed-time highlighting for tickets over 15 minutes
- Ready tickets stay visible for 60 minutes after completion
- Personal performance page with attendance summary
Waiter
Order-focused portal — create and track orders, view personal performance. Guests can also order via QR codes at their tables.
- Order hub with full POS capabilities for creating orders
- Live order tracking with status updates from kitchen
- Table assignment with visual occupied/available indicators
- QR-code guest ordering: phone-based menu browsing and live order timeline
- Personal performance page with attendance and shift summary
AI-Powered Features
AI Copilot
Owner or Manager types a question in the AI Assistant chatA natural-language assistant for Owner and Manager roles that queries live restaurant data using function-calling. Ask questions about stock levels, sales summaries, popular items, or staff performance — and get instant, data-backed answers.
Output: Conversational answer with data from live restaurant database
AI Waiter (Guest-Side)
Guest scans QR code at their table and types a messageGuests scanning a QR code can chat with an AI assistant that understands natural-language food orders like '2 biryani and a coke'. The AI responds with suggestions and add-to-cart actions — no login required.
Output: Food order suggestions with add-to-cart capability
Demand Forecast
Manager navigates to the Forecast pagePredicts ingredient needs based on sales history, configurable horizon days, and safety buffer. Flags at-risk ingredients first, suggests order quantities, and generates draft purchase orders grouped by supplier for one-click procurement.
Output: Sorted needs-attention table with draft POs per supplier
Fraud Watch
Automated analysis based on order and payment dataAutomatically scores staff risk based on cancellation frequency, cash payment share, and price-edit patterns. Surfaces suspicious activity for owner review with detailed breakdowns per staff member.
Output: Risk scores and flagged activities per staff member
Database Architecture
24 models organized across 7 domains
Restaurant & Branches
Multi-branch restaurant hierarchy — each restaurant has settings (currency, tax, service charge) and branches with self-referencing parent relationships.
Users & Auth
User accounts with email verification, password reset tokens, and per-branch role assignments. Refresh tokens stored as SHA-256 hashes.
Orders & Payments
Flexible ordering engine with per-order charges (discount/service-charge/tax, each % or flat), partial payments, and coupon validation.
Menu & Tables
Menu items with categories, pricing, availability, and optional images. Tables with QR codes for guest ordering and status tracking (AVAILABLE/OCCUPIED/RESERVED).
Kitchen & Inventory
Stock items per branch with thresholds and supplier links. Recipe items link menu dishes to ingredients with quantities. Purchases increase stock automatically.
Staff & Payroll
Per-staff profiles with position, salary, and branch assignment. Flexible salary components (EARNING/DEDUCTION). Monthly payroll snapshots with attendance-aware calculations — LEAVE is paid, only ABSENT cuts pay.
Platform Services
In-app notifications (ORDER/PAYMENT/INVENTORY/SYSTEM types) and audit trail logging sensitive actions with actor, time, and details.
Security & Authentication
JWT Authentication
Access tokens (15m) + rotating refresh tokens (7d) with bcrypt password hashing. Refresh tokens stored as SHA-256 hashes, revoked on logout/reset/suspend.
Role-Based Access Control
Three-layer guard architecture: AuthGuard (token check), PageGuard (route permissions per role), and RoleGuard (component-level). Sidebar items and page access are dynamically filtered by role.
Tenant Isolation
All queries are scoped by JWT-derived restaurantId — never from client input. Ensures one restaurant's data is never accessible to another.
Rate Limiting
Global 100 req/min; tighter limits on public routes — menu 30/min, order 10/min, AI waiter 5/min, guest status 30/min.
Input Validation
Strict DTOs with class-validator + global ValidationPipe (whitelist + forbidNonWhitelisted + transform) on every endpoint. Prisma parameterization prevents SQL injection.
Guest Order Isolation
Order status is readable only through the same table's QR token — an orderId from one table's QR is unreadable from another table's QR. Rate-limited to 30/min per guest.
Audit Trail
Sensitive actions (user creation/deletion, role changes, settings updates) are logged with actor ID, timestamp, IP, and action details.
PDF Document Generation
Order Invoice
Itemized bill with items, quantities, prices, discount/charges breakdown, service charge, tax, total, paid amount, and balance due
Thermal Receipt (80mm)
Compact receipt layout with restaurant branding, items, totals, and payment details — designed for thermal printer output
Payroll Payslip
Base salary, allowances, deductions, absence deduction (absent days × daily rate), net amount, and payment history
Deployment & Infrastructure
platform
Backend: Render (free tier) · Frontend: Vercel
database
Supabase PostgreSQL (managed)
storage
Supabase Storage (optional)
cron
Weekly digest email — Monday 08:00 (revenue/orders WoW %, top items, low stock summary)
Nodemailer SMTP (console fallback when SMTP not configured)
ai
OpenAI SDK — function-calling for AI Copilot + AI Waiter