This README document outlines the steps necessary to install and run the Fast Food Delivery App. It includes instructions for setting up the database, running the application, inserting sample data, and creating user roles.
- SQL Server 2022
- Visual Studio 2022
- Node.js installed (for running the front-end)
- Open the solution in Visual Studio and locate the
appsettings.json
file. - Modify the
server
,uid
, andpwd
fields to reflect your SQL Server credentials.
- Navigate to
Tools > NuGet Package Manager > Package Manager Console
. - In the Default Project dropdown, select the Business Layer.
- Run
update-database
to create thefastfooddeliverydb_prn231
database in SQL Server.
- For front-end developers, run the program and navigate to https://localhost:7173/swagger/index.html to view the Swagger UI with all API links.
- To run the React application, navigate to the main React folder (add specific folder path here) and open a command prompt at this location.
- Run
npm run dev
. Ensure the application is running on localhost successfully; a default browser will automatically open.
-
Register a customer account to start ordering. Navigate through the Swagger UI to insert sample data.
-
Follow the documented steps to create food items and categories, and register as a customer:
- Create several categories (contains food items), click Execute if the response body code 200 means creation was successful.
- Display data in dbo.Category to get CategoryId which has been automatically generated, so we can continue creating food items.
- Create a food item within a category as shown in the picture; if going well, the response body code 200.
- Create several categories and execute the creation. Check the response body for a code 200 to confirm successful creation.
- Display data in
dbo.Category
to retrieve theCategoryId
. Use this ID to create food items.
-
Admin Account:
- Register as a customer.
- Query
dbo.AspNetRoles
for the Admin role ID. - Overwrite the Admin role ID into
dbo.AspNetUserRoles
for the user account created in step 1.
-
Shipper Account:
- Log in as an Admin.
- Navigate to the Shipper Account Management section to add a new shipper.
Here are some views of the application's user interface:
- Case 1: When an order's status is Paid and the DeliveryStatus is Processing, the admin can assign a shipper. Once assigned and confirmed by the shipper, the DeliveryStatus changes to Delivered.
- Case 2: If a shipper rejects the order, the status changes to Cancelled.
- Ensure the SQL Server connection details are correct.
- Keep the command prompt running while using the application.
- Set your desktop's date and time to UTC+7 (Bangkok, Hanoi, Jakarta) to match the application's timezone settings.
- SQL Server 2022
- Visual Studio Code 2022