Skip to content

HarusHoChiHo/Restaurant_Food_Planning_System

Repository files navigation

Note

This project uses .Net Core as backend and PostgreSQL as database. We build these two components on Docker because it would be easier to run on different platforms. Therefore, both backend application and database will run on local network.

We will keep the credential in related setting files, for example, access password for database, JWT encrypt key, so we can simplify the steps to launch applications.

In the launching stage, backend application will start after the database gets ready and will insert default data into database.

Default Account for access system

Username: Harus Password: harus Role: Manager

Username: Kathy Password: kathy Role: Manager

Username: HarusStaff Password: harus_staff Role: Staff

Username: KathyStaff Password: kathy_staff Role: Staff

Those default data can be found in file RestaurantFoodPlanningSystem/EntityFrameworkCore/SeedData.cs

Updates after 9th Aug

  1. Fix bug of updating course name
  2. Update date validation
  3. Add pagination to Order page
  4. Add validation on menu date
  5. Modified Order API for pagination
  6. Add function to ask confirmation when user click deletion button
  7. Correct the validation on date of menu
  8. Update warning of deletion
  9. Fix bug of updating consumption
  10. Add validation on the name of menu item

Steps for setting up the project (Frontend - React)

Assuming the current directory is /RestaurantFoodPlanningSystem

  1. Nevigate to /rfps-web
  2. Run npm install in command prompt to install all necessary packages
  3. Run npm run dev in command prompt to start the web application
  4. Visit the website on http://localhost:3000

Steps for setting up the project (Backend - .NetCore & PostgreSQL)

Note

Before running this project, please delete the images, volumes, and containers, which are built from this project.

Since this project would build database with latest PostgreSQL image, the volumes referenced by older version of PostgreSQL image will not be compatible.

Assuming the current directory is /RestaurantFoodPlanningSystem

  1. Place docker-compose.yml in folder RestaurantFoodPlanningSystem
  2. Place appsettings.json and appsettings.Development.json in folder /RestaurantFoodPlanningSystem/RestaurantFoodPlanningSystem
  3. Once openning the project, the project require to restore package by using Nuget. In Intellij Rider, Go to Tools > Nuget > Nuget Restore.
  4. In Intellij Rider, adding Run/Debug configuration to run docker-compose.yml to start the database and API applicaiton.
  5. Then lauch application.

Details of this Project

Group Member

  • Chi Ho Ho (301324743)
  • Kang Yee Tang (301328548)

Project Description

Restaurant Food Planning System

Technologies

Front-end

  • React

Back-end

  • C#, .Net Core

Database

  • Postgres

Functionalities

Order Subsystem

  • Place Order: Allow customers to place order.
  • Cancel Order: Allow customers to cancel order.

Menu Management Subsystem

  • Create Menu: Managers can create a menu with different cuisine for different dates.
  • Update Menu: Allow managers to update the information of a menu, for example removing cuisine from menu.
  • Delete Menu: Allow managers to delete existing menus.
  • Read Menu: Allow customers to retrieve current menu based on the date.

Food Stock Management Subsystem

  • Insert Food: Allows restaurant manager to insert the records of food
  • Update Food: Allows restaurant manager to update the records of food
  • Delete Food: Allows restaurant manager to delete the records of food
  • Read Food: Allows restaurant manager to review the records of food

User Management Subsystem

  • Create Account: Allow users to sign-up.
  • Update Account: Allow users to update password.
  • Delete Account: Allow users to delete user account.
  • Read Account: Allow users to view existing account.

Authentication Subsystem

  • Authenticate users: Allow users to login into the system.

Database Design

Database Design

API Document

  • The API document can be viewed in the ways below:
    1. Swagger UI

    2. Postman

      • Importing "Postman_collection-RestaurantFoodPlanningSystem.json" into Postman.
    3. HTML file

      • Unzipping the html-api-documentation.zip and open the file "index.html."

API Endpoints

User

Method Route Request Body Path Variable
GET /api/User/{id} None id : integer
GET /api/User None None
POST /api/User/login
{
"name": "<string>",
"password": "<string>"
}
None
POST /api/User/register
{
"name": "<string>",
"password": "<string>"
}
None
POST /api/User/assign-role/{userId}/{roleId} None
userId : integer,
roleId : integer
POST /api/User/remove-role/{userId}/{roleId} None
userId : integer,
roleId : integer
DELETE /api/User/{id} None
id : integer

Role

Method Route Request Body Path Variable
POST /api/Role/creation
{
"name": "<string>",
"description": "<string>"
}
None
DELETE /api/Role/{id} None
id : integer
POST /api/Role/read
{
"name": "<string>",
"description": "<string>",
"id": "<integer>",
"createdDate": "<dateTime>"
}
None
POST /api/Role/update
{
"name": "<string>",
"description": "<string>",
"id": "<integer>"
}
None

Order

Method Route Request Body Path Variable
GET /api/Order/cancel-order/{id}
None
id : integer
POST /api/Order/place-order
{
  "order": {
    "id": "<integer>",
    "isCanceled": "<boolean>"
   },
   "orderItems": [
     {
         "id": "<integer>",
         "orderId": "<integer>",
         "menuItemId": "<integer>"
      },
      {
         "id": "<integer>",
         "orderId": "<integer>",
         "menuItemId": "<integer>"
      }
   ]
}
None

DataManagement

  1. Unit
Method Route Request Body Path Variable
POST api/DataManagement/unit/creation
{
"id": "<integer>",
"name": "<string>"}
None
POST api/DataManagement/unit/update
{
"id": "<integer>",
"name": "<string>"}
None
POST api/DataManagement/unit/read
{
"id": "<integer>",
"name": "<string>"}
None
DELETE api/DataManagement/unit/{id}
None
id : integer
  1. Type
Method Route Request Body Path Variable
POST api/DataManagement/type/creation
{
"id": "<integer>",
"name": "<string>"}
None
POST api/DataManagement/type/update
{
"id": "<integer>",
"name": "<string>"}
None
POST api/DataManagement/type/read
{
"id": "<integer>",
"name": "<string>"}
None
DELETE api/DataManagement/type/{id}
None
id : integer
  1. FoodItem
Method Route Request Body Path Variable
POST api/DataManagement/food-item/creation
{
"id": "<integer>",
"name": "<string>" ,
"quantity": "<string>",
"unit_Id": "<string>",
"type_Id": "<string>"}
None
POST api/DataManagement/food-item/update
{
"id": "<integer>",
"name": "<string>" ,
"quantity": "<string>",
"unit_Id": "<string>",
"type_Id": "<string>"}
None
POST api/DataManagement/food-item/read
{
"id": "<integer>",
"name": "<string>" ,
"quantity": "<string>",
"unit_Id": "<string>",
"type_Id": "<string>"}
None
DELETE api/DataManagement/type/{id}
None
id : integer
  1. MenuItem
Method Route Request Body Path Variable
POST api/DataManagement/menu-item/creation
{
"id": "<integer>",
"name": "<string>"
}
None
POST api/DataManagement/menu-item/update
{
"id": "<integer>",
"name": "<string>"
}
None
POST api/DataManagement/menu-item/read
{
"id": "<integer>",
"name": "<string>"
}
None
DELETE api/DataManagement/food-item/{id}
None
id : integer
  1. Menu
Method Route Request Body Path Variable
POST api/DataManagement/menu/creation
{
"id": "<integer>",
"date": "<dateTime>" ,
"menuItem_Id": "<integer>"}
None
POST api/DataManagement/menu/update
{
"id": "<integer>",
"date": "<dateTime>" ,
"menuItem_Id": "<integer>"}
None
POST api/DataManagement/menu/read
{
"id": "<integer>",
"date": "<dateTime>" ,
"menuItem_Id": "<integer>"}
None
DELETE api/DataManagement/menu/{id}
None
id : integer
  1. MenuItemFoodItem
Method Route Request Body Path Variable
POST api/DataManagement/menu-item-food-item/creation
{
"menuItem_Id": "<integer>",
"foodItem_Id": "<integer>" ,
"consumption": "<integer>"}
None
POST api/DataManagement/menu-item-food-item/update
{
"menuItem_Id": "<integer>",
"foodItem_Id": "<integer>" ,
"consumption": "<integer>"}
None
POST api/DataManagement/menu-item-food-item/read
{
"menuItem_Id": "<integer>",
"foodItem_Id": "<integer>" ,
"consumption": "<integer>"}
None
DELETE api/DataManagement/menu-item-food-item
{
"menuItem_Id": "<integer>",
"foodItem_Id": "<integer>" ,
"consumption": "<integer>"}
None
  1. Order
Method Route Request Body Path Variable
POST api/DataManagement/order/creation
{
"id": "<integer>",
"isCanceled": "<integer>"
}
None
POST api/DataManagement/order/update
{
"id": "<integer>",
"isCanceled": "<integer>"
}
None
POST api/DataManagement/order/read
{
"id": "<integer>",
"isCanceled": "<integer>",
"pageNumber": "<integer>",
"limit": "<integer>"
}
None
DELETE api/DataManagement/order/{id}
None
id : integer
  1. OrderItem
Method Route Request Body Path Variable
POST api/DataManagement/order-item/creation
{
"id": "<integer>",
"orderId": "<integer>",
"menuItemId": "<integer>"
}
None
POST api/DataManagement/order-item/update
{
"id": "<integer>",
"orderId": "<integer>",
"menuItemId": "<integer>"
}
None
POST api/DataManagement/order-item/read
{
"id": "<integer>",
"orderId": "<integer>",
"menuItemId": "<integer>"
}
None
DELETE api/DataManagement/order-item/{id}
None
id : integer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages