This project provides a basic Flask web interface for viewing clinical trial compliance information. It also includes supporting scripts and database services.
- Flask application located in
web/
. - PostgreSQL for application data.
- Flyway for database migrations.
- NixOS must be downloaded onto the system
-
Run in Terminal (MacOS):
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)
-
- UV must be downloaded onto the system
-
Run in your CLI with Homebrew:
brew install uv
-
Alternatively, you may use the following:
curl -LsSf https://astral.sh/uv/install.sh | sh
-
nix develop
This command will download all dependencies and set up the development environment.
Running the command below will delete files autogenerated by the nix develop
command. It will also kill the PostgreSQL server.
source scripts/flake/clean.sh
Not required; ran using nix develop
For convenience a helper script is included to load mock organizations, users, trials and compliance information into PostgreSQL.
python scripts/init_mock_data.py
Not required; ran using nix develop
After the services are running and mock data is loaded you can start the development server:
flask run --host 0.0.0.0 --port 6525
For development convenience, you can enable automatic user authentication:
# For local development
export ENVIRONMENT=dev
flask run --host 0.0.0.0 --port 6525
# For preview deployments (single PR testing)
export ENVIRONMENT=preview
flask run --host 0.0.0.0 --port 6525
When ENVIRONMENT=dev
or ENVIRONMENT=preview
is set, you'll be automatically logged in as user1@example.com
when visiting any protected route. This eliminates the need for manual login during development and testing.
Environment Flow: preview
(single PR) → dev
(main branch) → prod
(tagged release)
You can create an account directly in the application and reset your password when needed.
- Visit
/register
to sign up for a new account. - Use
/reset
to generate a password reset link.
This application supports both local development databases and Google Cloud SQL for production deployments.
- Set up Cloud SQL instance and configure GitHub secrets
- Deploy application using existing GitHub Actions
- Initialize database with mock data using the "Initialize Cloud Database" GitHub Action
- Verify setup by accessing your Cloud Run service
For detailed setup instructions, see Cloud Database Setup Guide.
- Automatic connection handling (local vs Cloud SQL)
- One-time data population with safety mechanisms
- GitHub Actions integration for automated deployment
- Population status tracking to prevent duplicate data
- Force repopulation when needed for testing
scripts/init_cloud_data.py
- Safely populate cloud database with mock datascripts/check_db_status.py
- Check database population status- Use GitHub Actions workflow "Initialize Cloud Database" for automated setup