Skip to content

How to Set Up Local Development

Configure the example application development environment.

Prerequisites

  • Docker and Docker Compose
  • Make
  • Python 3.11+
  • Terraform (for OIDC setup)
  • uv (Python package manager)

Quick Setup

cd integration-tests
make setup-full

This starts all services and configures OIDC automatically.

Manual Setup

1. Start Infrastructure

make build
make up

Wait ~15 seconds for services to initialize.

2. Run Database Migrations

make db-upgrade

3. Configure OIDC

make tf-init
make tf-apply

4. Verify Services

make check-health

Service URLs

Service URL Description
Webapp http://localhost:8000 Application
Authentik http://authentik-server:9000 OIDC admin
Topaz http://localhost:8282 Authorization API
Mock Location http://localhost:8001 Geographic API

Development Workflow

Make Changes to Webapp

# Edit code in webapp/app/
# Rebuild and restart
docker-compose build webapp
docker-compose up -d webapp

Modify Policies

# Edit files in policies/
# Restart Topaz
docker-compose restart topaz

View Logs

make logs-webapp
make logs-topaz
make logs-authentik

Run Tests

# Unit tests
cd webapp
uv run pytest tests/ -v

# Integration tests
cd integration-tests
uv run pytest tests/ -v

Useful Commands

# Restart all
make restart

# Clean restart
make clean && make setup-full

# Database shell
make db-shell

# Authentik admin password
make auth-password

See Also