Open source system for Danish public debt collection (Offentlig Gældsinddrivelse).
OpenDebt is a modern, microservices-based debt collection system designed for Danish public institutions. It handles:
- ~600 debt types from ~1,200 public institutions
- Debt registration and readiness validation (indrivelsesparathed)
- Case management and workflow
- Payment processing
- Offsetting (modregning)
- Wage garnishment (loenindeholdelse)
- Letter management via Digital Post
Creditor Portal Caseworker Portal Citizen Portal DUPLA / M2M
(Fordringshaver) (Sagsbehandler) (Borger) Gateway
| | | |
+------------------+------------------+-------------------+
|
+------------+------------+
| Keycloak (JWT) |
+------------+------------+
|
+----------------+----------------+-------+---------+---------------+
| | | | |
+---+---+ +-----+-----+ +----+------+ +------+----+
| Case | | Debt | | Payment | | Creditor |
|Service| | Service | | Service | | Service |
+-------+ +-----------+ +-----+-----+ +-----------+
|
+------+------+
| immudb |
| (tamper- |
| evidence) |
+-------------+
Drools rules are packaged in ufst-rules-lib and evaluated in-process by consumer services per
ADR-0035. There is no standalone rules-engine runtime service.
| Service | Port | Description |
|---|---|---|
| person-registry | 8090 | GDPR data store — single source of truth for all PII (CPR/CVR encrypted) |
| case-service | 8081 | Case management and workflow (Flowable BPMN) |
| debt-service | 8082 | Debt registration, lifecycle management, readiness validation, offsetting/modregning (ADR-0027, P058) |
| payment-service | 8083 | Payment processing, double-entry bookkeeping, tamper-evidence ledger |
| letter-service | 8084 | Letter generation, Digital Post |
| creditor-portal | 8085 | Portal for fordringshavere |
| citizen-portal | 8086 | Portal for borgere |
| wage-garnishment-service | 8088 | Loenindeholdelse processing |
| integration-gateway | 8089 | DUPLA, SKB CREMUL/DEBMUL, legacy SOAP (OIO/SKAT) |
| creditor-service | 8092 | Creditor master data, channel binding, access resolution |
| caseworker-portal | 8093 | Portal for sagsbehandlere |
| ufst-rules-lib | JAR | Business rules — shared in-process Drools library consumed by runtime services (ADR-0035) |
| immudb | 3322 (gRPC) | Tamper-evidence ledger — cryptographic integrity for financial postings (ADR-0029) |
All personal data (CPR, CVR, names, addresses) is isolated in the Person Registry. Other services store only technical UUIDs:
Person Registry (PII) Other Services (NO PII)
+------------------+ +------------------+
| person_id (UUID) | <-------- | debtor_person_id |
| CPR (encrypted) | | (UUID only) |
| Name (encrypted) | | |
| Address (enc.) | | |
+------------------+ +------------------+
- Runtime: Java 21, Spring Boot 3.5
- Database: PostgreSQL 16 (enterprise grade with audit/history)
- Tamper-evidence ledger: immudb 1.10 + immudb4j 1.0.1 (cryptographic integrity, ADR-0029)
- Rules Engine: Drools 9.x via
ufst-rules-lib(shared in-process library, ADR-0035) - Workflow: Flowable 7.x (BPMN 2.0 case management)
- Build: Maven with Spotless, JaCoCo, OWASP
- API: OpenAPI 3.1, REST
- Auth: OAuth2/OIDC via Keycloak
- Deployment: Kubernetes (Horizontale Driftsplatform)
- Java 21 or later
- Maven 3.9+
- Docker (for local development)
# Build all modules
mvn clean install
# Skip tests
mvn clean install -DskipTests
# Format code
mvn spotless:apply# Start infrastructure (PostgreSQL + Keycloak)
docker compose up -d postgres keycloak
# Run a service
cd opendebt-case-service
mvn spring-boot:rundocker compose up -d# Fast demo (no auth on portals/backends, immudb tamper-evidence enabled)
.\start-demo.ps1
# Security demo (Keycloak login + role-based access)
.\start-demo.ps1 -SecurityDemo
# Only caseworker flow with security
.\start-demo.ps1 -SecurityDemo -Only caseworkerSeeded demo users:
caseworker/caseworker123(role:CASEWORKER)creditor/creditor123(role:CREDITOR)admin/admin123(role:ADMIN)
Keycloak admin console: http://localhost:8080/admin/ (admin / admin)
When the demo starts, payment-service automatically seeds 14 ledger pairs (28 immudb entries) to demonstrate the tamper-evidence layer. Inspect the ledger using:
cd docs/spike
python immudb-view.py # generates immudb-report.html and opens it in browserThe immudb web console is accessible at http://localhost:8094 (shows Document Store; KV ledger is accessed via the viewer script above).
Use the PowerShell helper to run one stack (app or observability) or both with one command.
# Start app + observability
.\compose-stack.ps1
# Start app only
.\compose-stack.ps1 -Stack app
# Start observability only
.\compose-stack.ps1 -Stack obs
# Start infra only (postgres + keycloak + observability)
.\compose-stack.ps1 -Stack infra
# Stop both stacks
.\compose-stack.ps1 -Action down
# Stop infra-only containers (keeps app containers untouched)
.\compose-stack.ps1 -Action down -Stack infra
# Follow logs for one service
.\compose-stack.ps1 -Action logs -Service postgresWhen the observability stack is running, Grafana provisions both the baseline overview dashboard and the RBAC authorization dashboard from config/grafana/provisioning/dashboards/. RBAC alert templates are provisioned from config/grafana/provisioning/alerting/.
# Fast demo mode (no auth on portals/backends)
.\start-demo.ps1
# Security demo mode (Keycloak login + role-based access)
.\start-demo.ps1 -SecurityDemo
# Only creditor flow with Keycloak security
.\start-demo.ps1 -SecurityDemo -Only creditorIn security demo mode, use these seeded users:
caseworker/caseworker123(role:CASEWORKER)creditor/creditor123(role:CREDITOR)admin/admin123(role:ADMIN)
Keycloak admin console: http://localhost:8080/admin/ with admin / admin.
Each service exposes OpenAPI documentation:
- Case Service: http://localhost:8081/case-service/swagger-ui.html
- Debt Service: http://localhost:8082/debt-service/swagger-ui.html
- Payment Service: http://localhost:8083/payment-service/swagger-ui.html
Key architectural decisions are documented in architecture/adr/:
- ADR-0002: Microservices Architecture
- ADR-0003: Java/Spring Boot Stack
- ADR-0007: No Direct Database Connections
- ADR-0010: Faellesoffentlige Arkitekturprincipper
- ADR-0018: Double-Entry Bookkeeping
- ADR-0029: immudb for Financial Ledger Integrity
- ADR-0032: Catala Formal Compliance Verification Layer
OpenDebt complies with:
- Faellesoffentlige Arkitekturprincipper - Danish public sector architecture principles
- GDPR - Privacy by design
- DUPLA - UFST data exchange platform standards
High-risk G.A. Inddrivelse rules are formally encoded in Catala
before implementation. Catala source files under catala/ act as an executable oracle that
validates Gherkin scenarios against the juridisk vejledning text. See
ADR-0032 for the full rationale and tier
classification.
Completed spikes:
| Spike | Legal section | Report |
|---|---|---|
| P054 | G.A.1.4.3–1.4.4 — Opskrivning/nedskrivning | catala/SPIKE-REPORT.md |
| P069 | G.A.2.3.2.1 — Dækningsrækkefølge (GIL § 4) | catala/SPIKE-REPORT-069.md |
See agents.md for development guidelines.
Apache License 2.0 - see LICENSE for details