Skip to content
Snippets Groups Projects
Andrea Callia D'Iddio's avatar
Andrea Callia D'Iddio authored
Replace Lorenzo with Andrea as main contact as the system now supports new categories of projects apart from the ones Lorenzo is responsible for.
1efe055b
History

Project Allocator

pipeline status

Project Requirements

  • Python 3.10 and Flask
  • Gunicorn - web server ("in front" of the API)
  • Postgres SQL - databases

Running the app

Via docker-compose:

docker compose up -f dev.docker-compose.yml [--build]
docker exec $(docker ps -qf "name=allocator" | head -n1) flask db upgrade
docker exec $(docker ps -qf "name=allocator" | head -n1) flask populate_dev

Alternatively, if you want to run the app locally (recommended for debugging):

# Terminal panel 1
docker run --rm --name project-allocator -p 2000:5432 -e POSTGRES_DB=project-allocator -e POSTGRES_USER=user -e POSTGRES_PASSWORD=pass postgres

# Terminal panel 2
export DB_OVERRIDE=postgresql://user:pass@localhost:2000/project-allocator
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
flask db upgrade
flask populate_dev
flask run

Then browse to URL http://localhost:5000.

Running the tests

Via docker-compose, after upping:

docker exec $(docker ps -qf "name=allocator" | head -n1) pytest

Alternatively, if you want to run the test locally (Mac specific):

brew services start postgres
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pytest