/recipe-app-api

🍳 An attempt to learn REST API, API Documentation, Docker, GitHub Actions, Clean Code, & TDD by making a recipe app API in Django REST Framework

Primary LanguagePython


recipe-app-api

🍳 A recipe API built with Django REST Framework 🍳


Checks

Table of Contents

Description

This is a recipe API built with Django REST Framework (DRF). It's built to learn more about REST API, API Documentation, Docker, GitHub Actions, Clean Code, & Test-Driven Development (TDD).

Tech Stack

Run Locally

  • Make sure you have Docker installed on your computer.

  • Clone the repo.

    git clone https://github.com/nadiannis/recipe-app-api.git
    cd recipe-app-api
  • Build the Docker image.

    docker-compose build
  • Create & start the containers.

    docker-compose up

    You should now be able to access the app through a browser. Check out the app at http://127.0.0.1:8000.

  • Stop & remove the containers.

    If you want to stop the app, you can stop & remove the containers by executing this command.

    docker-compose down

Run a Command on a Service

You can start a container to execute a one-time command with docker-compose run --rm <service-name> sh -c "<command>".

These are several commands you can execute in the app container.

Lint the Code

docker-compose run --rm app sh -c "flake8"

Format the Code

docker-compose run --rm app sh -c "black ."

Sort Python Imports

docker-compose run --rm app sh -c "isort ."

Run the Test Suite

docker-compose run --rm app sh -c "python manage.py test"

Make Migrations

docker-compose run --rm app sh -c "python manage.py makemigrations"

Apply All Migrations

docker-compose run --rm app sh -c "python manage.py migrate"

Create a Superuser

docker-compose run --rm app sh -c "python manage.py createsuperuser"

Contributing

If you see something that can be improved, you can open an issue or create a pull request.