---
# System prepended metadata

title: Home Taste Endpoints

---

<h3>
    Version 1 of Our Application
</h3>

> **Currently, we have two roles in our application**
>     1- Cookers
> 2- Users(customers)
<hr>

> ## For both users and cookers

<h3>Authentication: /auth</h3> 

* POST **/register**:  Creates a new user account using Email,Google and Facebook 
* POST **/login**:  Authenticates a user and generates an access token.
* POST **/logout**: Invalidates the access token and logs out the user.
<hr>

> ## For users

<h3>User Profile: /users</h3>

* GET **/:userId/profile**: Retrieves user profile information by ID.
* GET **/:userId/orders**: Retrieves past orders for a specific user.
<hr>

<h3>Food Choices: /foods</h3>

* GET **/foods**: Retrieves a list of food choices.
* GET **/foods/:foodId**: Retrieves the details of a specific food item by ID.
<hr>

<h3>Cart: /cart</h3>

* GET **/cart**: Retrieves the user's cart.
* POST **/cart**: Adds an item to the user's cart.
* PUT **/cart/:itemId**: Updates the quantity of an item in the user's cart.
* DELETE **/cart/:itemId**: Removes an item from the user's cart.
* DELETE **/cart**: Clears the user's cart.
<hr>



<h3>Reviews and Ratings:</h3>

* GET **/foods/:foodId/reviews**: Retrieves reviews for a specific food item by ID.
* POST **/foods/:foodId/reviews**: Creates a new review for a specific food item.
<hr>

<h3>Filters:</h3>

* GET **/foods?location=:location**: Retrieves a list of food choices by location.
* GET **/foods?allergies=:allergies**: Retrieves a list of food choices based on specific allergies.
* GET **/foods?location=:location&allergies=:allergies**:
Retrieves a list of food choices based on a specific location AND specific allergies
* GET **/foods?preferences=:preferences:** Retrieves a list of food choices based on user preferences.
* GET **/foods?preferences=:preferences&location=:location&allergies=:allergies**:
Retrieves a list of food choices based upon a user preferences AND a specific location AND specific allergies.
<hr>




> ## For cookers
> 
<h3>Cooker Dishes: /cookers</h3>

* GET **/cookers/:cookerId/dishes**: Retrieves the list of dishes associated with a specific cooker by ID.
* POST **/cookers/:cookerId/dishes**: Creates a new dish for a specific cooker by ID.
* PUT **/cookers/:cookerId/dishes/dishId**: Updates a new dish for a specific cooker by ID.
* DELETE **/cookers/:cookerId/dishes/dishId**: Deletes a new dish for a specific cooker by ID.
<hr>




| Endpoint | Authentication | Authorization |
| -------- | -------- | -------- |
/auth/register	|No|	No
/auth/login	|No|	No
/auth/logout	|Yes	|No
/users/:userId/profile	|Yes	|Yes
/users/:userId/profile-picture	|Yes	|Yes
/users/:userId/orders|Yes	|Yes
/foods	|No	|No
/cookers/:cookerId/dishes	|Yes	|Yes
/foods/:foodId	|No	|No
/cart	|Yes	|Yes
/foods/:foodId/reviews	|Yes	|Yes
/foods?location=:location	|No	|No
/foods?allergies=:allergies	|No	|No
/foods?preferences=:preferences	|No	|No
/cookers/:cookerId/profile	|Yes	|Yes






