A full-stack, AI-powered restaurant management platform. Customers scan a QR code at their table to browse visually rich menus, chat with an AI assistant for recommendations, place orders, and pay — entirely from their smartphones. Staff manage operations, orders, and capacity in real-time through a comprehensive admin dashboard.
- Multi-intent DAG Executor: Radically optimized AI reasoning. Parses complex orders/queries into parallel task graphs instead of slow sequential loops.
- Human-in-the-Loop (HITL): Safe pausing for sensitive actions (e.g., canceling orders, altering data).
- Conversational Ordering: Customers can ask for recommendations, check allergens, and place direct orders via chat.
- RAG-powered Knowledge: Integrates ChromaDB vector embeddings for semantic menu searching.
- Frictionless: Unique QR codes per table load the digital menu instantly.
- Rich Menu: Visual items with tags, robust descriptions, and allergen warnings.
- Cart & Checkout: Real-time cart management, order tracking, and seamless checkout.
- Menu & Table Mapping: Full CRUD capabilities for dishes, categories, and table capacities.
- Live Order Board: Real-time Kanban-style tracking (Pending → Processing → Delivered → Paid).
- Employee Roles: Role-based access control (RBAC) for Owners, Managers, and Staff.
- Marketing Tools: Built-in Coupon system (percentage/fixed) and internal Blog.
- WebSockets: Instantaneous order dispatching to the kitchen screen.
- Push Notifications: Firebase Cloud Messaging (FCM) integration for mobile alerts.
- Staff Chat: Internal messaging with attachments, read receipts, and reactions.
- Multi-language: Supports English, Vietnamese, and Russian via
next-intl. - Flexible Payments: Cash or online integration (YooKassa).
| Domain | Technology |
|---|---|
| Frontend | Next.js 15 (App Router), React 18, TypeScript, TailwindCSS, Shadcn/UI |
| Backend | Node.js, Fastify, TypeScript |
| Database | SQLite + Prisma ORM |
| AI Processing | Vercel AI SDK v6, OpenAI GPT-4o, ChromaDB (Vector Search) |
| State & Fetch | Zustand, TanStack Query (React Query) |
| Real-time | Socket.IO, Firebase Cloud Messaging (FCM) |
| Testing | Vitest, React Testing Library, Playwright (E2E) |
| Infra/Deploy | PM2, Nginx, GitHub Actions (CI/CD) |
QR-code-order/
├── client/ # Next.js frontend application
│ ├── src/ # Source code (app, components, lib, queries)
│ ├── messages/ # i18n locale dictionaries
│ └── public/ # Static assets
├── server/ # Fastify backend API
│ ├── src/ # Source code (controllers, routes, services)
│ └── prisma/ # Database schema and seeders
├── docs/ # Architecture & Deployment Documentation
├── nginx.conf # Sample Nginx reverse proxy configuration
└── ecosystem.config.js # PM2 cluster configuration
Please ensure you have the following installed:
- Node.js (v20 or higher recommended)
- Git
- OpenAI API Key (for AI Assistant features)
- ChromaDB running locally for vector similarity search.
git clone https://github.com/quangtuanitmo18/QR-code-order.git
cd QR-code-ordercd server
cp .env.example .env
npm installConfigure your .env:
DATABASE_URL="file:./dev.db"
ACCESS_TOKEN_SECRET="your_jwt_access_secret"
REFRESH_TOKEN_SECRET="your_jwt_refresh_secret"
OPENAI_API_KEY="sk-..."
CHROMA_URL="http://localhost:8000"Initialize Database & AI Vectors:
npx prisma generate
npx prisma db push
npx prisma db seed
npx tsx src/scripts/seed-chroma.tscd ../client
cp .env.example .env
npm installConfigure your .env:
NEXT_PUBLIC_API_ENDPOINT="http://localhost:4000"
NEXT_PUBLIC_URL="http://localhost:3000"Start both servers in separate terminal instances:
# Terminal 1 - Server
cd server && npm run dev
# Terminal 2 - Client
cd client && npm run dev- Frontend App: http://localhost:3000
- Backend API: http://localhost:4000
- Admin Dashboard: http://localhost:3000/manage/dashboard
Default Demo Credentials:
| Role | Password | |
|---|---|---|
| Admin | admin@example.com |
password123 |
| Employee | alice@example.com |
password123 |
The project maintains high reliability through automated testing.
# Server Unit & Integration tests
cd server && npm test
# Client Unit tests
cd client && npm test
# Client End-to-End (E2E) tests
cd client && npm run test:e2eQuang Tuan — @quangtuanitmo18