Development Setup¶
Set up Opencomplai for local development. The project is a Python monorepo managed with uv, with a Node.js service (gateway-api) managed with pnpm, and an optional Docker Compose stack for integration work.
Windows developers
Development setup is primarily tested on macOS/Linux. Windows support via WSL2 is recommended for the full dev workflow (especially bootstrap.sh and shell scripts under scripts/).
Prerequisites¶
| Tool | Version | Install |
|---|---|---|
| Python | 3.11+ | python.org |
| uv | Latest | pip install uv or docs.astral.sh/uv |
| Node.js | 20 LTS | nodejs.org |
| pnpm | 9+ | npm install -g pnpm |
| Docker | 24+ | docs.docker.com |
| pre-commit | Latest | pip install pre-commit |
| Git | 2.20+ | git-scm.com |
1. Clone the repository¶
2. One-command bootstrap¶
This script:
- Verifies tool versions (
scripts/doctor.py). - Creates
uvvirtual environments and installs all Python packages in editable mode. - Installs Node.js dependencies with
pnpm. - Installs
pre-commithooks.
If any step fails, re-run after fixing the reported issue.
3. Manual setup (if bootstrap fails)¶
Python packages¶
Node.js (gateway-api)¶
pre-commit hooks¶
4. Run the test suite¶
Python¶
Node.js (gateway-api)¶
5. Run linters¶
6. Optional: start the full Docker Compose stack¶
For integration work involving multiple services:
See Deployment Quickstart for details.
Repository layout¶
Text Only
opencomplai/
├── packages/
│ ├── core/ # Risk assessment engine — Python, Pydantic v2
│ ├── cli/ # CLI tool — Typer + Rich
│ └── sdk-python/ # Python SDK — wraps core
├── services/
│ ├── gateway-api/ # REST API — Node.js + TypeScript + Fastify
│ ├── risk-engine/ # Risk classification — Python + FastAPI
│ ├── evidence-vault/ # Merkle ledger + CAS — Python + FastAPI + PostgreSQL
│ ├── doc-generator/ # Annex IV dossier generator — Python + FastAPI
│ └── egress-proxy/ # Allowlisted egress enforcer — Python + FastAPI
├── infra/
│ ├── docker/ # Dockerfiles
│ ├── compose/ # Docker Compose + .env.example
│ └── migrations/ # Alembic migrations
├── docs/ # MkDocs documentation
├── scripts/ # bootstrap.sh, doctor.py
└── .github/workflows/ # CI (ci-python.yml, ci-node.yml, ci-docker.yml)
Troubleshooting¶
uv not found¶
pnpm not found¶
Pre-commit hook fails¶
Docker Compose services not healthy¶
Common cause: POSTGRES_PASSWORD not set in infra/compose/.env.