- Spoonacular API (Search recipe): https://spoonacular.com/food-api/docs
- FoodDataCentral API (Nutrients recipe): https://fdc.nal.usda.gov/
- Perspective API (Checking post toxicity): https://perspectiveapi.com/
User account management:
- /user/login: Body {username: str, password: str, email: str} -> 200: {token: JWT token} or 400: empty
- /user/register: Body {username: str, password: str} -> 200: {data: true}
- /user/validate_token: Body {token: str} -> 200: {data: true}
Products management:
- /products/list: Body {} -> 200: {data: [{product: str, price: num, quantity: num, unit: str}, ...]}
- /products/info: Body {name, quantity (in g)} -> 200: {data: {nutrient_name: {quantity: num, unit: str}, ...}}
Recipe:
- /recipe/search: Body {query, diet, intolerance, direction: ("asc" or "desc")} -> 200: {data: [{image: url, summary: str, sourceUrl: url, pricePerServing: num, ...} of 5]}
- /recipe/add_normal: Body {username, ingredients: [str1, str2, ...], instructions, pricePerServing} -> 200: {data: true}
- /recipe/add_online: Body {username, image, sourceUrl, summary, pricePerServing} -> 200: {data: true}
- /recipe/retrieve: Body {username} -> {data: {online: [{image: url, summary: str, sourceUrl: url, pricePerServing: num}, ...], normal: [{ingredients: [str1, str2, ...], instructions}, ...]}}
My Fridge:
- /fridge/post: Body {username, ingredients: [str1, str2, ...], expiry_date: [Date1, Date2, ...], quantity: [int1, int2, ...], measures: [str1, tr2, ...]} -> 200: {data: true}
- /fridge/get: Body {username} -> 200: {data: {username: str, ingredients: [str1, str2, ...], expiry_date: [Date1, Date2, ...], quantity: [int1, int2, ...], measures: [str1, tr2, ...]}}
Chat:
- /chat/post: Body {username, post, likes} -> 200: {data: true/ false (if toxic)}
- /chat/retrieve_post: Body {} -> 200: {data: [{username, post, likes}, ... for 50 latest things]}
- /chat/recipe_post: Body {username, name, ingredients, instructions, likes} -> 200: {data: true/ false (if toxic)}
- /chat/retrieve_recipe: Body {} -> 200: {data: [{username, ingredients, instructions, likes}, ... for 50 latest things]} For updating likes: Just resend the post (1 and 3) with the new likes.