- Python >= 3.9
- Docker >= 20.10
- docker-compose >= 1.29
- Make
- (useful in BE development) poetry >= 1.1.5
- Create a
.envfile in the main project directory:SECRET_KEY=CHANGE_ME DEBUG=True POSTGRES_DB=koop POSTGRES_USER=koop POSTGRES_PASSWORD=CHANGE_ME POSTGRES_HOST=db POSTGRES_PORT=5432
- Before first running the project:
docker-compose build
- Start the project:
docker-compose up
We use:
- black for Python code formatting,
- prettier for front-end code formatting,
- ESlint for enforcing JS code quality rules.
All these are added as pre-commit hooks. Before you start committing, install pre-commit in your local environment and activate the hooks.
pre-commit is one of the dev-dependencies of the project, so if you use poetry for local development, just run:
poetry installThen activate the hooks:
pre-commit installAlthough it is not enforced by a pre-commit hook, it is strongly recommended to use type annotations and often run mypy over the backend code (the containers have to be running for the make command to work):
make mypy
# or, when you're in the `backend/` directory:
make -C .. mypyWe use Django's unit test framework, at least for now. The following command
executes ./manage.py test in the backend container (so the containers have
to be running):
make test
# or, when you're in the `backend/` directory:
make -C .. test