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
- Fix bug of updating course name
- Update date validation
- Add pagination to Order page
- Add validation on menu date
- Modified Order API for pagination
- Add function to ask confirmation when user click deletion button
- Correct the validation on date of menu
- Update warning of deletion
- Fix bug of updating consumption
- Add validation on the name of menu item
Assuming the current directory is /RestaurantFoodPlanningSystem
- Nevigate to /rfps-web
- Run
npm install
in command prompt to install all necessary packages - Run
npm run dev
in command prompt to start the web application - Visit the website on http://localhost:3000
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
- Place docker-compose.yml in folder RestaurantFoodPlanningSystem
- Place appsettings.json and appsettings.Development.json in folder /RestaurantFoodPlanningSystem/RestaurantFoodPlanningSystem
- Once openning the project, the project require to restore package by using Nuget. In Intellij Rider, Go to Tools > Nuget > Nuget Restore.
- In Intellij Rider, adding Run/Debug configuration to run docker-compose.yml to start the database and API applicaiton.
- Then lauch application.
- Chi Ho Ho (301324743)
- Kang Yee Tang (301328548)
Restaurant Food Planning System
- React
- C#, .Net Core
- Postgres
- Place Order: Allow customers to place order.
- Cancel Order: Allow customers to cancel order.
- 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.
- 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
- 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.
- Authenticate users: Allow users to login into the system.
- The API document can be viewed in the ways below:
-
Swagger UI
- After launching the application, the document can be accessed by visiting the URL above.
- URL: http://localhost:8081/swagger/index.html
-
Postman
- Importing "Postman_collection-RestaurantFoodPlanningSystem.json" into Postman.
-
HTML file
- Unzipping the html-api-documentation.zip and open the file "index.html."
-
Method | Route | Request Body | Path Variable |
---|---|---|---|
GET | /api/User/{id} | None | id : integer |
GET | /api/User | None | None |
POST | /api/User/login | { |
None |
POST | /api/User/register | { |
None |
POST | /api/User/assign-role/{userId}/{roleId} | None | userId : integer, |
POST | /api/User/remove-role/{userId}/{roleId} | None | userId : integer, |
DELETE | /api/User/{id} | None | id : integer |
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | /api/Role/creation | { |
None |
DELETE | /api/Role/{id} | None | id : integer |
POST | /api/Role/read | { |
None |
POST | /api/Role/update | { |
None |
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 |
- Unit
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/unit/creation | { |
None |
POST | api/DataManagement/unit/update | { |
None |
POST | api/DataManagement/unit/read | { |
None |
DELETE | api/DataManagement/unit/{id} | None |
id : integer |
- Type
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/type/creation | { |
None |
POST | api/DataManagement/type/update | { |
None |
POST | api/DataManagement/type/read | { |
None |
DELETE | api/DataManagement/type/{id} | None |
id : integer |
- FoodItem
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/food-item/creation | { |
None |
POST | api/DataManagement/food-item/update | { |
None |
POST | api/DataManagement/food-item/read | { |
None |
DELETE | api/DataManagement/type/{id} | None |
id : integer |
- MenuItem
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/menu-item/creation | { |
None |
POST | api/DataManagement/menu-item/update | { |
None |
POST | api/DataManagement/menu-item/read | { |
None |
DELETE | api/DataManagement/food-item/{id} | None |
id : integer |
- Menu
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/menu/creation | { |
None |
POST | api/DataManagement/menu/update | { |
None |
POST | api/DataManagement/menu/read | { |
None |
DELETE | api/DataManagement/menu/{id} | None |
id : integer |
- MenuItemFoodItem
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/menu-item-food-item/creation | { |
None |
POST | api/DataManagement/menu-item-food-item/update | { |
None |
POST | api/DataManagement/menu-item-food-item/read | { |
None |
DELETE | api/DataManagement/menu-item-food-item | { |
None |
- Order
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/order/creation | { |
None |
POST | api/DataManagement/order/update | { |
None |
POST | api/DataManagement/order/read | { |
None |
DELETE | api/DataManagement/order/{id} | None |
id : integer |
- OrderItem
Method | Route | Request Body | Path Variable |
---|---|---|---|
POST | api/DataManagement/order-item/creation | { |
None |
POST | api/DataManagement/order-item/update | { |
None |
POST | api/DataManagement/order-item/read | { |
None |
DELETE | api/DataManagement/order-item/{id} | None |
id : integer |