Skip to content

Latest commit

 

History

History
151 lines (114 loc) · 5.25 KB

README.md

File metadata and controls

151 lines (114 loc) · 5.25 KB

Restaurant Management System

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.

Repository Structure

.
├── 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

Usage Instructions

Installation

  1. Clone the repository
  2. Install dependencies:
    cd backend && npm install
    cd ../frontend && npm install
    

Running the Application

  1. Start the backend server:
    cd backend && npm run start:dev
    
  2. Start the frontend development server:
    cd frontend && npm run start:dev
    

API Endpoints

  • /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

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>

Testing

Run backend tests:

cd backend && npm run test

Run frontend tests:

cd frontend && npm run test

Data Flow

  1. User authentication: Users sign in through the frontend, which sends a request to the backend's authentication service.
  2. Menu management: Restaurant owners can create and update menus through the frontend, which sends requests to the backend's menu service.
  3. Order processing: Customers place orders through the frontend, which sends the order details to the backend's order service.
  4. 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]

Infrastructure

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)

Troubleshooting

  • 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.

Screenshot 2023-06-22 at 10 32 04 AM Screenshot 2023-06-22 at 10 49 25 AM Screenshot 2023-06-22 at 10 51 45 AM Screenshot 2023-06-22 at 10 53 26 AM Screenshot 2023-06-22 at 10 53 53 AM Screenshot 2023-06-22 at 10 54 29 AM Screenshot 2023-06-22 at 10 55 07 AM Screenshot 2023-07-25 at 9 21 50 PM