Giter VIP home page Giter VIP logo

meal-planner-api's Issues

[Task]: Set up FastAPI

Summary

Set up a FastAPI application for the meal planner app

Acceptance criteria

  • Developers can start the api locally by running make api-dev

API consumers can create a new meal plan and save recipes to it

Summary

API consumers should be able to access API endpoints that allow them to:

  • Create a new meal plan
  • Save recipes to that meal plan

Acceptance criteria

Creating an meal plan

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

Saving a meal to a meal plan

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

Rejecting a meal from a meal plan

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 meals

Summary

API consumers can get a list of recipes for their meal plan.

Acceptance criteria

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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.