Repository for the main project of the Software Engineering 2 (2024) course at Politecnico di Torino.
In order to get the system up and running you need to:
- Create a
.env.prod
file in the root directory of the repository, like the following:
SECRET=kirunaProdSecret
POSTGRES_USER=admin
POSTGRES_PASSWORD=admin
POSTGRES_DB=kiruna-db
POSTGRES_SERVICE=db
POSTGRES_PORT=5432
- Execute the following command, always from the root:
docker compose -f docker-compose.prod.yml --env-file .env.prod up
This will start all the containers and, in a few seconds, it will be possible to access the website at the address http://localhost:8080
.
In order to stop the containers (without losing data), execute:
docker compose -f docker-compose.prod.yml --env-file .env.prod down
If you want to both stop the services and erase all data, append the -v
flag:
docker compose -f docker-compose.prod.yml --env-file .env.prod down -v
There are two default users:
- John, a
Urban Planner
(email:john@kiruna.com
, password:12345
) - Kevin, a
Resident
(email:kevin@kiruna.com
, password:12345
)
- Create a
.env
file in the root directory of the repository, like the following:
SECRET=kirunasecret
POSTGRES_USER=kiruna
POSTGRES_PASSWORD=explorer
POSTGRES_DB=kiruna-db
POSTGRES_PORT=5432
PGADMIN_EMAIL=kiruna@explorer.com
PGADMIN_PASSWORD=kiruna
-
Start the containers with
docker compose up -d
. -
Connect to pgAdmin web interface at the
localhost:5050
address. -
Add a new connection to the DB (inside the hostname field insert
db
). -
To stop the containers, run
docker compose down
; if you also want to delete the local database data, executedocker compose down -v
.
- Create a
.env.test
file in the root directory of the repository, like the following:
SECRET=kirunasecret
POSTGRES_USER=kiruna
POSTGRES_PASSWORD=explorer
POSTGRES_DB=kiruna-db
POSTGRES_PORT=5435
-
Start the database test container with
docker compose -f docker-compose.test.yml --env-file .env.test up -d
. -
Run the tests with:
npm run test
.if the database schema inside the container is not updated, stop the container with the command below and execute:
docker compose -f docker-compose.test.yml --env-file .env.test up -d --build
. -
To stop and delete the database test container, run
docker compose -f docker-compose.test.yml down -v
.