When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
This documentation is dedicated for contributors who would like to add new vulnerable features to the project.
The project is developed with the following frameworks and technologies:
- Python 3.10
- Docker as a platform for containerisation
- FastAPI as easy to learn and fast to code web framework
- PostgreSQL 15.4 as a database
- Pytest for code testing
- pre-commit for maintaining hooks for code style and tests
Configuring a development environment is a straightforward process assuming that Python>=3.10, pip and Docker are already installed:
-
Install
psycopg2prerequisites as described in the official documentation. For "*nix" distributions, the following command can be used:sudo apt install python3-dev libpq-dev
-
Clone the repository and change directory to the project root:
git clone https://github.com/theowni/Damn-Vulnerable-RESTaurant-API-Game.git cd Damn-Vulnerable-RESTaurant-API-Game -
Install Poetry:
pip3 install poetry
-
Install project dependencies and spawn shell within the created environment:
poetry install poetry shell
-
Setup pre-commit:
pre-commit install
-
Validate that tests are passing locally:
pytest . -
Develop vulnerable API endpoints by following already existing files structure.
docker compose build
docker compose run web pytest .Changes in database models need to be reflected in migrations via Alembic. Migrations can be created via:
docker compose build
docker compose run web alembic revision --autogenerate -m 'changes description'