API for October CodeBattle Hackathon.
API docs: http://51.250.44.9/api/v1/docs
Starlite, SQLAlchemy, Alembic, Postgres, Redis, Traefik
Docker containers:
- server
- db
- redis
- traefik
docker-compose files:
docker-compose.yml
- for local development.tests/functional/docker-compose.yml
- for functional tests.
To run docker containers, you need to create a .env
file in the root directory.
.env
example:
cp .env.example .env
Locally:
docker-compose build
docker-compose up
Sync environment with requirements.txt
/ requirements.dev.txt
(will install/update missing packages, remove redundant ones):
make sync-requirements
Compile requirements.*.txt files (have to re-compile after changes in requirements.*.in):
make compile-requirements
Use requirements.local.in
for local dependencies; always specify constraints files (-c ...)
Example:
# requirements.local.txt
-c requirements.txt
ipython
Run unit tests (export environment variables from .env
file):
export $(echo $(cat .env | sed 's/#.*//g'| xargs) | envsubst) && make test
To run functional tests, you need to create .env
in ./tests/functional directory
.env
example:
cd ./tests/functional && cp .env.example .env
Run functional tests:
cd ./tests/functional && docker-compose up test
Makefile recipe:
make dtf
Before pushing a commit run all linters:
make lint
pre-commit installation:
pre-commit install
OpenAPI 3 documentation:
${PROJECT_BASE_URL}/api/v1/docs
- Swagger${PROJECT_BASE_URL}/api/v1/docs/redoc
- ReDoc${PROJECT_BASE_URL}/api/v1/docs/openapi.json
- OpenAPI json