This APi provides all the routes needed to implements a platform where Madam sauce Customers at GenesysTechHub can place order for their meal and it will be delivered to their offices. This project was designed with expressjs, nodejs and Mongodb
The Sign up Route handles the user registration. here is a sample Json snippet.
{
"firstName": "Joshua",
"lastName": "Mba",
"phone": "07063516620",
"sex": "male",
"email": "joshua.mba.g20@gmail.com",
"password": "12345678",
"confirmPassword": "12345678"
}
The Login Route handles the User Login. An example of json snippet to pass.
{
"email": "joshua@gmail.com",
"password": "12345678"
}
The user update route handles the profile update of the user. This route requires user authorization. This means user must login before he can update details.
PS: User authorization and Admin role validation are passed as Middlewares form the ./Middlewares/auth.js directory
This is route is only accessible for users with admin Role.
This route gets a specific user details.
This route deletes a User record but requires an Admin Authorization
This route get all the Meals added by the admin. This is visible to all type of users
This route is for adding new meal to the Meal list. Only an admin can access this route. A simple json file to pass:
{
"name": "Rice and Beans",
"description": "This food comes with 2 meat and a bottle of Eba",
"price": "750",
"photo": "https://spoonacular.com/cdn/ingredients_100x100/apple.jpg"
}
This route get all details about a meal. just pass mealid as a params
This route deletes a particular meal. Just pass mealid as a params
This route edits a particular meal. Just pass mealid as a params and the MEal update as a payload
You will need the Meal id, quantity and the officeRoomNumber (The office of the Genesys Staff that placed order)
{
"mealId" : "5f893c3bec48542e24c1e566",
"quantity" : 15,
"officeRoomNumber": "genesys office 123"
}
This route is for users to cancel their Meal order. Just pass the order id as a payload. Example:
{
"orderId" : "5f893c3bec48542e24c1e566"
}
This route is for users to complete their Meal order once it is delivered. Just pass the order id as a payload. Example:
{
"orderId" : "5f893c3bec48542e24c1e566"
}
This route is for admin to delete an Order record. Just pass the order id as a params.
This route is for users to View their order records
This route is for admin to check all order record in the DB
Leave a Reply