Skip to content

Development Guide

Day-to-day commands and workflows for developing Open CIS.

Running Development Servers

cd api
source .venv/bin/activate
uvicorn src.main:app --reload --port 8000
cd web
pnpm dev

Testing

Python API Tests

cd api && pytest

Frontend Tests

cd web && pnpm test          # Run once
cd web && pnpm test:watch    # Watch mode

Code Quality

Python

cd api && ruff check .       # Lint
cd api && mypy src/          # Type check

Frontend

cd web && pnpm lint          # ESLint
cd web && pnpm typecheck     # TypeScript check

Database Operations

After Prisma Schema Changes

cd api
prisma generate
prisma migrate dev

Browse Database

cd api && prisma studio

Create Migration Without Applying

cd api && prisma migrate dev --create-only --name migration_name

Docker & Infrastructure

Check Container Status

docker compose ps

View Logs

docker compose logs -f ehrbase
docker compose logs -f ehrbase-db
docker compose logs -f app-db

Rebuild a Service

docker compose up -d --build ehrbase

EHRBase Operations

Check Status

curl http://localhost:8080/ehrbase/rest/status

List Templates

curl http://localhost:8080/ehrbase/rest/definition/template/adl1.4

Create an EHR Manually

curl -X POST http://localhost:8080/ehrbase/rest/ehr \
  -H "Content-Type: application/json" \
  -H "Prefer: return=representation"

Coding Standards

Language Standard
Python Type hints required everywhere (enforced by mypy), all functions async
TypeScript Strict mode enabled, no implicit any
HTTP Use httpx.AsyncClient for async requests (never requests)
Database Prisma client is async-only (interface = "asyncio")