Modern, full-featured Point of Sales (POS) and Restaurant Management System built with Next.js, TypeScript, and MySQL.
- Admin: Full system access, menu management, reports, and analytics
- Waiter: Table management, order creation, customer service
- Kitchen: Order queue display, cooking workflow management
- Cashier: Payment processing, receipt generation
- Real-time Table Status: Live updates of table availability and occupancy
- Smart Order Management: From order creation to delivery tracking
- Kitchen Display System (KDS): Efficient order queue for kitchen staff
- Payment Processing: Cash payment with automatic change calculation
- Warning System: Automatic alerts for pending payments
- Inventory Management: Daily stock tracking and availability
- Receipt Generation: Professional receipt printing
- Responsive Design: Works on desktop, tablet, and mobile
- Dark Mode: Eye-friendly theme switching
- Real-time Updates: Automatic polling for live data
- Premium Aesthetics: Modern gradients, animations, and micro-interactions
- Shadcn UI Components: Beautiful, accessible component library
- Framework: Next.js 14+ (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Shadcn UI
- Icons: Lucide React
- State Management: TanStack Query (React Query)
- Forms: React Hook Form + Zod
- Notifications: Sonner
- Theme: next-themes
- Runtime: Node.js
- API: Next.js API Routes
- Database: MySQL
- ORM: mysql2 (with connection pooling)
- Validation: Zod
restaus-app/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ auth/ # Authentication endpoints
β β βββ tables/ # Table management
β β βββ menus/ # Menu management
β β βββ orders/ # Order management
β β βββ payments/ # Payment processing
β β βββ categories/ # Category endpoints
β βββ login/ # Login page
β βββ admin/ # Admin dashboard
β βββ waiter/ # Waiter interface
β βββ kitchen/ # Kitchen display
β βββ cashier/ # Cashier interface
βββ components/ # React components
β βββ ui/ # Shadcn UI components
β βββ providers/ # Context providers
βββ hooks/ # Custom React hooks
β βββ use-auth.ts # Authentication hook
β βββ use-tables.ts # Tables data hook
β βββ use-menus.ts # Menus data hook
β βββ use-orders.ts # Orders data hook
β βββ use-cart.ts # Shopping cart hook
β βββ use-payments.ts # Payments hook
βββ lib/ # Utility libraries
β βββ db.ts # Database connection
β βββ api-client.ts # API client utilities
β βββ api-response.ts # API response helpers
β βββ utils.ts # General utilities
βββ types/ # TypeScript type definitions
β βββ index.ts # All type definitions
βββ constants/ # Application constants
β βββ index.ts # Constants and configs
βββ sql/ # SQL scripts
β βββ query.sql # Database schema
β βββ seed.sql # Seed data
βββ docs/ # Documentation
β βββ plan.md # Project plan
β βββ major-task.md # Major tasks
β βββ minor-task.md # Minor tasks
β βββ PROGRESS.md # Implementation progress
βββ middleware.ts # Next.js middleware
- Node.js 18+ installed
- MySQL 8+ installed and running
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd restaus-app
-
Install dependencies
npm install
-
Setup Database
# Create database mysql -u root -p < sql/query.sql # Insert seed data mysql -u root -p < sql/seed.sql
-
Configure Environment Variables Create a
.env.localfile in the root directory:DB_HOST=localhost DB_USER=root DB_PASSWORD=your_password DB_NAME=restaus_db NEXT_PUBLIC_API_URL=http://localhost:3000/api
-
Run Development Server
npm run dev
-
Open Application Navigate to http://localhost:3000
| Role | Username | Password |
|---|---|---|
| Admin | admin | admin123 |
| Waiter | waiter | waiter123 |
| Kitchen | kitchen | kitchen123 |
| Cashier | cashier | cashier123 |
- Login with waiter credentials
- View table dashboard with real-time status
- Click available table to start new order
- Select menu items and add to cart
- Add special notes if needed
- Submit order to kitchen
- Login with kitchen credentials
- View incoming orders in queue
- Update item status: Pending β Cooking β Served
- Orders automatically move to cashier when all items served
- Login with cashier credentials
- View tables with delivered orders
- Process payment (cash)
- System calculates change automatically
- Print receipt
- Login with admin credentials
- Manage menus and categories
- Update daily inventory
- View sales reports and analytics
- Manage tables and users
1. Restaurant Opens β All tables set to "Available"
2. Customer Arrives β Waiter assigns table (Reserved)
3. Order Placed β Items sent to kitchen (Processing)
4. Cooking β Kitchen updates item status (Cooking)
5. Ready β All items marked as served (Delivered)
6. Warning β System alerts if payment pending > 5 min
7. Payment β Cashier processes payment (Completed)
8. Table Released β Status returns to "Available"
- Tables auto-refresh every 5 seconds
- Kitchen queue updates every 3 seconds
- Warning checks every 10 seconds
- Daily stock tracking
- Automatic stock reduction on order
- Out-of-stock items automatically disabled
- Alerts when order delivered but not paid
- Visual indicators on table dashboard
- Prioritizes tables needing payment
POST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/tables- Get all tablesPOST /api/tables- Create tableGET /api/tables/[id]- Get single tablePATCH /api/tables/[id]- Update table statusDELETE /api/tables/[id]- Delete table
GET /api/orders- Get all orders (with filters)POST /api/orders- Create new orderGET /api/orders/[id]- Get single orderPATCH /api/orders/[id]/status- Update order status
POST /api/payments- Process paymentGET /api/payments- Get payment history
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Built with β€οΈ for modern restaurant management
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.