The Rust backend behind the law editor, serving the frontend and corpus REST endpoints.
The editor API is a lightweight HTTP server that backs the law editor frontend. It serves the compiled frontend and provides REST endpoints for corpus access.
packages/editor-api/The editor API loads the regulation corpus (from local files or GitHub via the corpus library) and exposes it through a REST API. The editor frontend calls these endpoints to list laws, fetch and edit individual law YAML, manage annotations, run harvest jobs, and collaborate inside trajects.
The API surface has grown well beyond corpus reads. The main groups:
GET /api/corpus/laws, GET/PUT /api/corpus/laws/{law_id}, plus /outputs, /scenarios, /scenarios/{filename}, /annotations, and POST /api/corpus/reload./api/trajects and /api/trajects/{id}, member and invite management (/members, /invites/{email}, /leave), and traject-scoped corpus access under /api/trajects/{traject_ref}/corpus/..../api/harvest, /api/harvest/batch, /api/harvest/search, /api/harvest/status./api/sources, /api/favorites, /api/feature-flags, /api/user/settings, and /health.See packages/editor-api/src/main.rs for the authoritative route table.
| Variable | Default | Purpose |
|---|---|---|
STATIC_DIR | static | Path to compiled frontend |
CORPUS_REGISTRY_PATH | corpus-registry.yaml | Registry manifest location |
CORPUS_AUTH_FILE | corpus-auth.yaml | Path to authentication config |
DATABASE_URL (or DATABASE_SERVER_FULL), PIPELINE_API_URL, and CORPUS_REGISTRY_LOCAL_PATH are also read where the traject and harvest features need them.
In development, run the frontend dev server separately for hot reload (see Editor).
An exploration by Bureau Architectuur of the Dutch Ministry of the Interior into the possibilities of transparent, executable legislation.
Bureau Architectuur
Ministry of the Interior and Kingdom Relations