Skip to content
SEUNGWOO CHOI edited this page Oct 18, 2026 · 8 revisions

API development

English · 한국어

Applies to Miroven-API 0.1.0, independently of client v1.0.0. Paths/commands on this page are relative to the API checkout unless stated otherwise. Requires Python 3.12, PostgreSQL, SMTP, Node.js/npm for contract tooling, and Docker Compose with a Linux engine for container development.

Development stack

Copy .env.example to .env only if no .env exists, then:

docker compose up -d --build --wait

API: http://localhost:8000, interactive reference: /docs, Mailpit: http://localhost:8025. Migrations precede API/worker startup. Stop with docker compose down, preserving volumes. The default Compose/Mailpit stack is development-only.

For the client too, place Miroven/ beside Miroven-API/ and run:

docker compose -f compose.yaml -f compose.web.yaml up -d --build --wait

App: http://localhost:8080. See client development for browser integration checks.

Checks and generated contracts

uv sync --locked
uv run pytest -q
uv run ruff check app scripts tests migrations
uv run ruff format --check app scripts tests migrations
uv run python scripts/export_openapi.py --check
npm ci
npm run typecheck

Database tests clear tables. Set TEST_DATABASE_URL to a dedicated database ending in _test; without it, database tests are skipped. Never point it at production or ordinary development data. CI is .github/workflows/ci.yml.

When the contract changes, export it with uv run python scripts/export_openapi.py, run npm run generate, then copy/check it from Miroven/web/ with npm run api:generate and npm run api:check. The API checkout's contracts/openapi.json defines exact request/response types; contracts/api.d.ts and the client's copied types are generated artifacts.

For direct Python execution, configure DB/SMTP in .env, then run migrations, the API, and the worker (the worker in a separate terminal):

uv run alembic upgrade head
uv run python -m app.server
uv run python -m app.worker

See deployment, operations, and validation boundaries. Keep API and client format versions distinct.

Clone this wiki locally