Smart Restaurant is a full-stack restaurant management platform built as a monorepo. It includes a customer-facing ordering experience, an admin dashboard for restaurant operations, and a NestJS backend that connects everything through REST APIs, real-time updates, authentication, and MySQL persistence.
The project is designed to support the main workflows of a modern restaurant: QR-based table access, digital menu browsing, order placement, kitchen and waiter coordination, payment processing, and operational reporting.
customer-frontend: a Next.js app for guests to browse the menu, place orders, track order status, review items, and pay online.admin-frontend: a Next.js dashboard for restaurant staff to manage tables, menu data, waiters, kitchen staff, reports, and role-based operations.backend: a NestJS API with TypeORM, MySQL, JWT auth, Google login support, email flows, Socket.IO updates, and VNPay integration.database: SQL migration and seed scripts for bootstrapping the MySQL database.
- QR-based table access for dine-in customers
- Customer sign-up, login, email verification, password reset, and Google OAuth
- Digital menu browsing with categories, item details, modifiers, and search
- Cart, order creation, order history, and order tracking
- Real-time order status updates with WebSocket / Socket.IO
- Table management with QR generation and waiter assignment
- Menu, category, modifier group, and photo management
- Waiter and kitchen staff workflows inside the admin system
- Super admin and role/permission-based access control
- Sales and operational reporting
- VNPay sandbox payment flow
- Backend: NestJS, TypeScript, TypeORM, MySQL, Socket.IO
- Frontend: Next.js, React, TypeScript, Tailwind CSS
- Auth: JWT, refresh token flow, Google OAuth
- Email: Nodemailer with Gmail SMTP fallback behavior
- Payments: VNPay
- Package management: Yarn workspaces
smart-restaurant-admin/
├── admin-frontend/ # Admin dashboard for restaurant staff
├── backend/ # NestJS API and business logic
├── customer-frontend/ # Customer ordering application
├── database/ # SQL migrations and seed data
├── DESIGN_SYSTEM.md # Shared UI and design notes
└── README.md
- Node.js 20+
- Yarn 4+
- MySQL 8+
yarn installFollow the SQL setup guide in database/README.md, or use the quick start below:
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS smart_restaurant CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -u root -p smart_restaurant < database/migrations/001_initial_schema.sql
mysql -u root -p smart_restaurant < database/seeds/001_initial_data.sqlCreate backend/.env from backend/.env.example and add at least:
PORT=3001
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=smart_restaurant
ADMIN_FRONTEND_URL=http://localhost:3000
CUSTOMER_FRONTEND_URL=http://localhost:4000
JWT_SECRET=your_jwt_secretOptional integrations used by the codebase:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_CUSTOMER_CALLBACK_URLGMAIL_USERGMAIL_APP_PASSWORDVNPAY_TMN_CODEVNPAY_HASH_SECRET
For the frontend apps, set:
NEXT_PUBLIC_API_URL=http://localhost:3001The customer frontend also uses:
NEXT_PUBLIC_CUSTOMER_FRONTEND_URL=http://localhost:4000Start the backend:
yarn workspace backend start:devStart the admin frontend on port 3000:
yarn workspace admin-frontend devStart the customer frontend on port 4000:
yarn workspace customer-frontend dev --port 4000Recommended local URLs:
- Admin dashboard:
http://localhost:3000 - Backend API:
http://localhost:3001 - Customer app:
http://localhost:4000
The backend is organized into focused modules for the core restaurant flows:
- authentication for customers and admins
- tables and QR token generation
- menu, categories, items, photos, and modifiers
- orders, kitchen handling, waiter actions, and reports
- profile management, reviews, email, and super admin operations
- A customer scans a table QR code.
- The customer is routed into the ordering app with a table token.
- The customer logs in or continues the flow, browses the menu, and places an order.
- Staff monitor and process orders from the admin dashboard.
- Order progress is pushed to the customer in real time.
- The customer can pay and review their dining experience.
- The workspace is configured around Yarn workspaces, so Yarn is the recommended package manager.
- Current sub-project
READMEfiles still contain framework boilerplate. The rootREADMEis the main project overview. - Some integrations such as Gmail SMTP, Google OAuth, and VNPay require additional credentials before they are fully usable.
This repository is licensed under the MIT License. See LICENSE for details.