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).
- Language: Python
- Web Framework: Django
- REST API Framework: Django REST Framework (DRF)
- Database: PostgreSQL
- API Documentation: Swagger
- Containerization: Docker
- Continuous Integration: GitHub Actions
- Linter: Flake8
- Code Formatter: Black & isort
-
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
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.
docker-compose run --rm app sh -c "flake8"
docker-compose run --rm app sh -c "black ."
docker-compose run --rm app sh -c "isort ."
docker-compose run --rm app sh -c "python manage.py test"
docker-compose run --rm app sh -c "python manage.py makemigrations"
docker-compose run --rm app sh -c "python manage.py migrate"
docker-compose run --rm app sh -c "python manage.py createsuperuser"
If you see something that can be improved, you can open an issue or create a pull request.