This project is a comprehensive restaurant management system with a NestJS backend and React frontend, designed to streamline restaurant operations and enhance customer experience.
The system provides functionality for managing menus, orders, restaurants, and customers. It includes features such as user authentication, role-based access control, and real-time order processing.
.
├── backend/
│ ├── src/
│ │ ├── addon/
│ │ ├── application/
│ │ ├── audit/
│ │ ├── cart/
│ │ ├── category/
│ │ ├── domain/
│ │ ├── infrastructure/
│ │ ├── item/
│ │ ├── location/
│ │ ├── menu/
│ │ ├── order/
│ │ ├── order_manager/
│ │ ├── order_notes/
│ │ ├── order_processing_queue/
│ │ ├── order_statuses/
│ │ ├── restaurant/
│ │ ├── shared/
│ │ ├── singleclient/
│ │ └── utils/
│ ├── test/
│ ├── nest-cli.json
│ ├── ormconfig.ts
│ ├── package.json
│ └── tsconfig.json
└── frontend/
├── src/
│ ├── apis/
│ ├── application/
│ ├── components/
│ ├── contexts/
│ ├── data/
│ ├── hooks/
│ ├── interfaces/
│ ├── models/
│ ├── pages/
│ ├── reducers/
│ └── utility/
├── package.json
└── tsconfig.json
- Clone the repository
- Install dependencies:
cd backend && npm install cd ../frontend && npm install
- Start the backend server:
cd backend && npm run start:dev
- Start the frontend development server:
cd frontend && npm run start:dev
/api/restaurants
: CRUD operations for restaurants/api/menus
: CRUD operations for menus/api/items
: CRUD operations for menu items/api/orders
: CRUD operations for orders/api/singleclients
: User management and authentication
The system uses JWT for authentication. To access protected routes, include the JWT token in the Authorization header of your requests:
Authorization: Bearer <your_jwt_token>
Run backend tests:
cd backend && npm run test
Run frontend tests:
cd frontend && npm run test
- User authentication: Users sign in through the frontend, which sends a request to the backend's authentication service.
- Menu management: Restaurant owners can create and update menus through the frontend, which sends requests to the backend's menu service.
- Order processing: Customers place orders through the frontend, which sends the order details to the backend's order service.
- Order status updates: The backend processes orders and updates their status, which is then reflected in the frontend in real-time.
[Frontend] <--> [API Gateway] <--> [Backend Services (Auth, Menu, Order, etc.)] <--> [Database]
The backend application uses NestJS and is structured with the following key components:
- AuthModule: Handles user authentication and authorization
- DocumentDatabaseModule: Configures the MongoDB connection
- Various repository interfaces and implementations for data access
Key resources:
- MongoDB database (configured in DocumentDatabaseModule)
- JWT for authentication (configured in AuthModule)
- If you encounter CORS issues, ensure that the backend's CORS settings match your frontend's domain.
- For database connection issues, verify that the
DATABASE_URL
environment variable is correctly set. - If authentication fails, check that the JWT secret keys are properly configured in both the backend and frontend.