sauce-kitchen

Site APi for Madam Sauce Resturant

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

USER ROUTE

Sign Up Route {url}/user/signup

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"
}

User Login Route {url}/user/login

The Login Route handles the User Login. An example of json snippet to pass.
{
"email": "joshua@gmail.com",
"password": "12345678"
}

User Update Route {url}/user/edit/:id

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

Get All user Route {url}/user/all

This is route is only accessible for users with admin Role.

Get Specific User Route {url}/user/:id

This route gets a specific user details.

Delete User Route{url}/user/delete/:id

This route deletes a User record but requires an Admin Authorization

MEAL ROUTE

Get all the Meal {url}/meal/all

This route get all the Meals added by the admin. This is visible to all type of users

Add Meal {url}/meal/add

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"
}

Get details of a Meal {url}/meal/:id

This route get all details about a meal. just pass mealid as a params

Delete a Particular Meal {url}/meal/delete/:id

This route deletes a particular meal. Just pass mealid as a params

Edit a Particular Meal {url}/meal/delete/:id

This route edits a particular meal. Just pass mealid as a params and the MEal update as a payload

ORDER ROUTE

Make Order {url}/order/make

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"


}

Cancel Order {url}/order/cancel

This route is for users to cancel their Meal order. Just pass the order id as a payload. Example:
{
"orderId" : "5f893c3bec48542e24c1e566"
}

Complete Order {url}/order/complete

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"
}

Delete Order {url}/order/delete/:id

This route is for admin to delete an Order record. Just pass the order id as a params.

Check A user Order record {url}/order/my

This route is for users to View their order records

All Order {url}/order/all

This route is for admin to check all order record in the DB

Visit original content creator repository

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *