- Python 3.11 or higher
- Docker Desktop
- Clone the repo
- Run
./run.sh
to build the docker containers and start the app - or, Run debug mode: run
./debug.sh
or theDebug Docker
debug configuration in VSCode- See Running Locally for more details
After the repo has been cloned, either of the following methods can be used to build the project locally. Both methods will start the app and database docker containers. On startup, db migrations are run and the db is seeded with mock data. The app will be started with the --reload
flag, which will watch for changes to the code and restart the app when changes are detected.
Script will build the docker containers and start the app. From the root of the project run:
./run.sh
Script will build the docker containers and start the app in debug mode. From the root of the project run:
./debug.sh
In VSCode, you can then attach to the running app by selecting the Attach_Debugger
debug configuration.
In VSCode, select the Debug Docker
launch configuration and start the debugger. This will build the docker containers and attaches debugger to the app container.
Note
Detaching the debugger will stop and remove the containers.
To run the unit and integration tests in the containers:
./run-pytests.sh
To run the Postman tests in the containers:
./run-postman.sh
To test various job queue scenarios:
python app/producer.py
The jobs will be added to the queue and processed by the app worker, logging the results of the jobs to the console.
Note
- Some jobs require the
tressure_vault_api
and/ormagic_signon_api
containers to be running for the jobs to be processed. - In
producer.py
, use ctrl+c to stop the script or any long running tasks.
On startup the app will check for any pending migrations and run them. If you need to create a new migration, run the following command:
./migrate.sh --make "<migration_name>"
--up
- Run all pending migrations--down
- Rollback the last migration--down <number>
- Rollback the last<number>
of migrations
Note
- The app must be running for migrations to be run.
- After using --make, inspect generated migration files to confirm accurate changes.