A full-stack Restaurant Management System built with the MERN stack, featuring a modern Point of Sale interface, order management, menu management, and table management.
- Interactive menu with categories
- Real-time cart management
- Support for dine-in, takeaway, and delivery orders
- Table selection for dine-in orders
- Customer information management
- Daily sales statistics
- Order analytics
- Revenue tracking
- Recent orders overview
- Quick actions
- Real-time order tracking
- Order status updates (Pending β Preparing β Ready β Completed)
- Payment status management
- Order filtering and search
- Detailed order views
- Category management
- Menu item CRUD operations
- Vegetarian/Non-vegetarian indicators
- Price and availability management
- Preparation time tracking
- Table status tracking (Available, Occupied, Reserved, Maintenance)
- Capacity management
- Location-based organization (Indoor, Outdoor, Private)
- Role-based access control (Admin, Manager, Cashier, Waiter)
- Secure authentication with JWT
- User-specific permissions
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- bcryptjs - Password hashing
- CORS - Cross-origin resource sharing
- React 18 - UI library
- TypeScript - Type safety
- Material-UI (MUI) - UI components
- React Router - Navigation
- TanStack Query - Data fetching and caching
- React Toastify - Notifications
- Date-fns - Date formatting
- Node.js (v16 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd restaurant-pos-system
-
Setup Backend
cd backend npm install -
Setup Frontend
cd ../frontend npm install --legacy-peer-deps -
Environment Configuration
Create a
.envfile in the backend directory:NODE_ENV=development PORT=5000 MONGODB_URI=mongodb://localhost:27017/restaurant_pos JWT_SECRET=your_jwt_secret_key_here JWT_EXPIRE=30d
-
Start MongoDB Make sure MongoDB is running on your system.
-
Seed the Database
cd backend npm run seed -
Start the Application
Start the backend server:
cd backend npm run devStart the frontend (in a new terminal):
cd frontend npm start -
Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
After running the seed script, you can log in with:
| Role | Password | |
|---|---|---|
| Admin | admin@restaurant.com | password123 |
| Manager | manager@restaurant.com | password123 |
| Cashier | cashier@restaurant.com | password123 |
| Waiter | waiter@restaurant.com | password123 |
POST /api/auth/login- User loginPOST /api/auth/register- User registrationGET /api/auth/me- Get current user
GET /api/categories- Get all categoriesPOST /api/categories- Create category (Manager/Admin)PUT /api/categories/:id- Update category (Manager/Admin)DELETE /api/categories/:id- Delete category (Manager/Admin)
GET /api/menu-items- Get all menu itemsGET /api/menu-items/:id- Get single menu itemPOST /api/menu-items- Create menu item (Manager/Admin)PUT /api/menu-items/:id- Update menu item (Manager/Admin)DELETE /api/menu-items/:id- Delete menu item (Manager/Admin)
GET /api/tables- Get all tablesGET /api/tables/available- Get available tablesPOST /api/tables- Create table (Manager/Admin)PUT /api/tables/:id- Update table (Manager/Admin)PATCH /api/tables/:id/status- Update table statusDELETE /api/tables/:id- Delete table (Manager/Admin)
GET /api/orders- Get all ordersGET /api/orders/today- Get today's ordersGET /api/orders/stats- Get order statisticsPOST /api/orders- Create new orderPUT /api/orders/:id- Update orderPATCH /api/orders/:id/status- Update order statusPATCH /api/orders/:id/payment- Update payment status
restaurant-pos-system/
βββ backend/
β βββ config/
β β βββ database.js
β βββ controllers/
β β βββ authController.js
β β βββ categoryController.js
β β βββ menuItemController.js
β β βββ orderController.js
β β βββ tableController.js
β βββ middleware/
β β βββ auth.js
β β βββ error.js
β βββ models/
β β βββ Category.js
β β βββ MenuItem.js
β β βββ Order.js
β β βββ Table.js
β β βββ User.js
β βββ routes/
β β βββ auth.js
β β βββ categories.js
β β βββ menuItems.js
β β βββ orders.js
β β βββ tables.js
β βββ .env
β βββ package.json
β βββ seeder.js
β βββ server.js
βββ frontend/
β βββ public/
β βββ src/
β β βββ components/
β β β βββ layout/
β β β βββ ProtectedRoute.tsx
β β βββ context/
β β β βββ AuthContext.tsx
β β β βββ CartContext.tsx
β β βββ pages/
β β β βββ Dashboard.tsx
β β β βββ Login.tsx
β β β βββ Orders.tsx
β β β βββ POS.tsx
β β βββ services/
β β β βββ api.ts
β β β βββ authService.ts
β β β βββ menuService.ts
β β β βββ orderService.ts
β β βββ types/
β β β βββ index.ts
β β βββ App.tsx
β β βββ index.tsx
β βββ package.json
βββ README.md
- View daily statistics and metrics
- Monitor recent orders
- Quick access to key features
- Browse menu items by category
- Add items to cart with quantities
- Select order type (dine-in, takeaway, delivery)
- For dine-in: select available table
- For delivery: enter customer details
- Process orders with automatic calculations
- View all orders with filtering options
- Update order status as items are prepared
- Manage payment status
- View detailed order information
- Create and manage categories
- Add, edit, and remove menu items
- Set prices and preparation times
- Mark items as available/unavailable
- Add and configure tables
- Update table status
- Organize by location (indoor/outdoor/private)
- JWT-based authentication
- Password hashing with bcrypt
- Role-based authorization
- Protected API endpoints
- Input validation and sanitization
- React Query for efficient data caching
- Optimistic updates for better UX
- Lazy loading and code splitting
- Responsive design for all devices
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License.
For support, email mbasit467@gmail.com or create an issue in the repository.