Skip to content

A REST API which supports Creating, Reading, Updating and Deleting breakfasts

License

Notifications You must be signed in to change notification settings

amantinband/buber-breakfast

Repository files navigation

drawing

GitHub Stars GitHub license



Give it a star ⭐!

Loving it? Show your support by giving this project a star!

Overview

In the tutorial, we build a CRUD REST API from scratch using .NET 6. As you would expect, the backend system supports Creating, Reading, Updating and Deleting breakfasts.

Service Architecture

drawing

Technologies

drawing

Architecture

drawing

Usage

Simply git clone https://github.com/amantinband/buber-breakfast and dotnet run --project BuberBreakfast.

API Definition

Create Breakfast

Create Breakfast Request

POST /breakfasts
{
    "name": "Vegan Sunshine",
    "description": "Vegan everything! Join us for a healthy breakfast..",
    "startDateTime": "2022-04-08T08:00:00",
    "endDateTime": "2022-04-08T11:00:00",
    "savory": [
        "Oatmeal",
        "Avocado Toast",
        "Omelette",
        "Salad"
    ],
    "Sweet": [
        "Cookie"
    ]
}

Create Breakfast Response

201 Created
Location: {{host}}/Breakfasts/{{id}}
{
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Vegan Sunshine",
    "description": "Vegan everything! Join us for a healthy breakfast..",
    "startDateTime": "2022-04-08T08:00:00",
    "endDateTime": "2022-04-08T11:00:00",
    "lastModifiedDateTime": "2022-04-06T12:00:00",
    "savory": [
        "Oatmeal",
        "Avocado Toast",
        "Omelette",
        "Salad"
    ],
    "Sweet": [
        "Cookie"
    ]
}

Get Breakfast

Get Breakfast Request

GET /breakfasts/{{id}}

Get Breakfast Response

200 Ok
{
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Vegan Sunshine",
    "description": "Vegan everything! Join us for a healthy breakfast..",
    "startDateTime": "2022-04-08T08:00:00",
    "endDateTime": "2022-04-08T11:00:00",
    "lastModifiedDateTime": "2022-04-06T12:00:00",
    "savory": [
        "Oatmeal",
        "Avocado Toast",
        "Omelette",
        "Salad"
    ],
    "Sweet": [
        "Cookie"
    ]
}

Update Breakfast

Update Breakfast Request

PUT /breakfasts/{{id}}
{
    "name": "Vegan Sunshine",
    "description": "Vegan everything! Join us for a healthy breakfast..",
    "startDateTime": "2022-04-08T08:00:00",
    "endDateTime": "2022-04-08T11:00:00",
    "savory": [
        "Oatmeal",
        "Avocado Toast",
        "Omelette",
        "Salad"
    ],
    "Sweet": [
        "Cookie"
    ]
}

Update Breakfast Response

204 No Content

or

201 Created
Location: {{host}}/Breakfasts/{{id}}

Delete Breakfast

Delete Breakfast Request

DELETE /breakfasts/{{id}}

Delete Breakfast Response

204 No Content

Credits

  • ErrorOr - A simple, fluent discriminated union of an error or a result.

VSCode Extensions

  • VSCode Rest Client - REST Client allows you to send HTTP request and view the response in Visual Studio Code directly.

  • VSCode Markdown Preview Enhanced - Markdown Preview Enhanced is an extension that provides you with many useful functionalities for previewing markdown files.

Disclaimer

This is an educational project. The source code is licensed under the MIT license.

License

This project is licensed under the terms of the MIT license.

About

A REST API which supports Creating, Reading, Updating and Deleting breakfasts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages