widal001 / meal-planner-api Goto Github PK
View Code? Open in Web Editor NEWAPI for the meal-planner-frontend
License: MIT License
API for the meal-planner-frontend
License: MIT License
Set up a FastAPI application for the meal planner app
make api-dev
API consumers should be able to access API endpoints that allow them to:
When API consumers call the POST /meal_plans/
endpoint with the following payload:
{
"start_date": "2023-11-02",
"end_date": "2023-11-08",
"meal_count": 9
}
Then a new meal plan is created and returned with the following response:
{
"id": "74675d10-ff0d-4753-8559-6d03f710ad33",
"start_date": "2023-11-02",
"end_date": "2023-11-08",
"meal_count": 9,
"collaborators": [
{"number": "908-578-4622"}
]
}
When API consumers call the PUT /meal_plans/{meal_plan_id}/recipes/{recipe_id}/save
endpoint.
Then it adds a recipe to the meal plan's list of saved recipes and returns an empty response with status code 204 No content
When API consumers call the PUT /meal_plans/{meal_plan_id}/recipes/{recipe_id}/reject
endpoint.
Then it adds a recipe to the meal plan's list of rejected recipes and returns an empty response with status code 204 No content
API consumers can get a list of recipes for their meal plan.
When: API consumers call GET /meals/
they get the following response:
{
"items": [
{
"title": "Sweet potato, black bean, and kale tacos",
"description": "<Description of the recipe>",
"ingredients": [
{"name": "sweet potatoes", "quantity": 2, "unit": "count"},
{"name": "black beans", "quantity": 1.5, "unit": "cup"},
{"name": "tortillas", "quantity": 6, "unit": "count"},
],
"tags": ["vegetarian", "dinner"],
},
{
"title": "Kale pasta",
"description": "<Description of the recipe>",
"ingredients": [
{"name": "pasta", "quantity": 0.5, "unit": "pound"},
{"name": "kale", "quantity": 0.5, "unit": "pound"},
{"name": "olive oil", "quantity": 0.25, "unit": "cup"},
],
"tags": ["vegetarian", "lunch"],
},
],
"total": 30,
"size": 10,
"page": 1,
"pages": 3
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.