ADR 0003 — One afia-api JVM, domain-colocated packages
Status: accepted
Date: 2026-09-19
Context
Afia has one jar today. Five health modules will share auth, patients, and orders. Splitting now would force every booking to span processes.
The alternative (one service per Stitch project) was sketched and rejected: callers would orchestrate identity + booking + results.
Decision
Keep a modular monolith:
health.afia.app
identity
patient
clinician
diagnostics
admin
common
version
health
Controllers, services, and persistence for a context live in that package. No global controller/ or entity/ tree.
Persistence, when the first real feature lands: Postgres + Liquibase, ddl-auto=none. Not implemented in this ADR — only the rule.
Consequences
- One auth filter chain, one
EndpointUri, one deployable. - A future extract of
diagnosticsis possible once the package boundary is real. - The JVM will grow; that is accepted.