Some Links:
API |
Client |
Marketing |
Documentation |
End Points |
Data Model |
- Node 🏴☠️
- Express.js 🏳️
{
id: INT
username: STRING
password: STRING
email: STRING
name: TEXT
}
{
id: INT
user_id: INT
title: STRING
source: STRING
category: STRING
image: STRING
}
{
id: INT
name: STRING
}
{
id: INT (not string, image hasn't been updated)
recipe_id: INT
step_number: INT
step: TEXT(700)
}
{
id: INT
recipe_id: INT
ingredients_id: INT
quantity: floating number
}
Method | End point | Description |
---|---|---|
POST | /auth/register |
Registers a user. |
POST | /auth/login |
Logs the user in and returns a token. |
GET | /auth/users |
returns a list of users usernames and name. |
GET | /auth/users/:id |
returns a user by their ID. |
{ //Bellow is the response you get from logging in succesfully
"message": "Welcome to our API",
"token": "this will be a hashed value auto generated"
}
{
//Bellow is the data you get back from the GET for users
"username": "TestUser1",
"name": "John Doe"
}
Method | End point | Description |
---|---|---|
POST | /recipes/addrecipe |
Adds a new Recipe. |
POST | /recipes/:id/addingredient/ |
Adds an ingredient to a Recipe with the quantity amount for a specific recipe.id. |
PUT | /recipes/updaterecipe/:id |
Update an existing recipe by the recipe ID. |
DELETE | /recipes/:id |
Deletes an existing recipe by the recipe ID. |
GET | /recipes/:id |
returns a recipe by the given ID + instructions |
GET | /recipes/:id/instructions |
returns a list of instructions for a specific recipe |
GET | /recipes |
returns a list of recipes. |
GET | /recipes/ingredients/:id/ |
returns the ingredient ID, Ingredient name, and the recipe information of which that ingredient is used in. |
Add Recipe
{
"user_id":"3", //user that made the recipe (required)
"title":"test recipe", //name of your desired recipe (required)
"source":"testingsource", //source (required)
"category":"lunch" //desired category (required)
"image": "string formate" // may change default from null (if left empty) to a generic SFR Logo/image
}
Add Ingredient
{
"name":"name of your ingredient",
"quantity" : "numeric value you desire"
}
Update Recipe by ID (all fields required except image, which can be left empty)
{
"user_id":"3",
"title":"test recipe updated",
"source":"testingsource",
"category":"lunch"
}