- web framework - aiohttp
- database - PostgreSQL 11
- db connection - aiopg, SQLAlchemy(core)
- data serialization - Marshmallow
- testing - pytest
- docker, docker-compose
Available endpoints:
- /pets GET, POST - List all pets, create new
- ?type=type
- ?shelterId=uuid
- /pets/{uuid} GET, PATCH, DELETE - Retrieve, update or delete pet
- /shelters GET, POST - List all shelters, create new
- ?city=city
- /shelters/{uuid} GET - Retrieve shelter details
- /shelters/{uuid}/pets GET - List pets from shelter
- ?type=type
Run app by docker compose locally(on Linux):
- Open terminal
- Copy git repository
- Go to the project directory:
$ cd pet_api
- Build images:
$ docker-compose build
- Run containers:
$ docker-compose up -d
- Create a database:
$ docker-compose exec a_app python db.py
- Load sample data:
$ docker-compose exec a_app python db_data.py
- Run tests:
$ docker-compose exec a_app pytest
- The server should be running on: localhost:8080