This repository contains the solution to the T10 Challenge.
To follow the steps bellow, you should have installed Docker and docker-compose.
To run locally as production, execute the command bellow
docker-compose -f docker-compose-prod.yml up --build
To execute the bellow database operations, set the DATABASE_URL envvar
# default prod database string connection, change this based on your settings
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/t10_challenge?sslmode=disable
Apply the database migrations
docker run --rm -v $(pwd)/migrations:/migrations --network host migrate/migrate:v4.11.0 -path=/migrations -database ${DATABASE_URL} -verbose up
Populate the database with some users
docker run --rm -v $(pwd)/users.sql:/tmp/users.sql --network host postgres:12-alpine psql -Atx ${DATABASE_URL} -f "/tmp/users.sql"
The file "t10-challenge.postman_collection.json" contains a Postman Collection to interact with the challenge solution.