REST API project for candy delivery store. Developed as entrance test for Yandex Backend School.
You must have docker and docker-compose tools installed to run the application. Simply you can just run following command.
# Full project
docker-compose up -d --build
Also you can run parts of application separately. It's useful for debugging.
# Only app container
docker-compose run -d --service-ports app
# Only database container
docker-compose run -d --service-ports db
Or using make commands:
- Install requirements
- Run db container with:
make db
- Run alembic migrations:
make alembic
- Run app locally:
make local
For testing used pytest library. Simply run the pytest
command to run all the tests of the project.
Also tests runs automatically on each push or pull request to this repo with help of github actions.
All web routes of the app available on /docs path.
Project structure presented below:
app
├── api - web related modules
├── db - db related modules
│ ├── migrations - generated alembic migrations
│ └── models - db models
│ └── schema.py - description of db structure
└── main.py - FastAPI application: creation and configuration
POST /couriers Add one or several couriers
PATCH /couriers/{courier_id} Update info about courier
GET /couriers/{courier_id} Get info about courier
POST /orders Add one or several couriers
POST /orders/assign Assign all available orders to courier
POST /orders/complete Mark order as completed
- Telegram - @grit4in