oleggr / CandyDeliveryApi

REST API for candy delivery store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CandyDeliveryApi

REST API project for candy delivery store. Developed as entrance test for Yandex Backend School.

CI Linting

Content

Quickstart

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:

  1. Install requirements
  2. Run db container with: make db
  3. Run alembic migrations: make alembic
  4. Run app locally: make local

Up

Run tests

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.

Up

What's inside

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

Up

Routes

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

Up

Contacts

Up

About

REST API for candy delivery store


Languages

Language:Python 67.8%Language:HTML 30.1%Language:Makefile 1.1%Language:Mako 0.6%Language:Dockerfile 0.4%