Skip to content

Architecture / Decision records / ADR-HIS-039

ADR-HIS-039 Code layout of the repository

Status Accepted
Decided 2026-11-24 by the Enterprise Architecture Board
Record Drafted 2026-11-24; approved 2026-11-24 by the Enterprise Architecture Board
Where the rule lives The agent instruction file CLAUDE.md at the repository root; architecture, sections 5.2 and 10.3

Context

ADR-HIS-033 puts the code in this repository, beside docs/. The session plan runs many agent sessions side by side, each on its own branch, and session rule 10 requires that they never change the same file. Build sessions are cut by the deployable units of architecture section 5.2, screen sessions by screen, contract sessions by domain. A single build file or lockfile at the repository root would be changed by almost every session and would conflict on every merge.

The technology stack selects Java 21 with Spring Boot for domain services and TypeScript for frontends and backend-for-frontend services (row 5), but no build tool or package manager. A lockfile per unit needs both.

Options considered

  • One build at the root (a Gradle multi-project build or a single pnpm workspace) over all code
  • One independent build per deployable unit, web workspace and contract folder, each with its own manifest and lockfile
  • One repository per deployable unit

For the build tools: Gradle or Maven for the Java units, and pnpm or npm for the TypeScript packages.

Decision

One independent build per folder, in one repository:

Folder Holds Changed by
services/<unit>/ One folder per application deployable unit of section 5.2 (25), named <domain code>-<unit> in lowercase, for example services/adm-patient-administration/ Build sessions on that unit
services/_template/ The service template FN-S03
platform/<unit>/ One folder per Domain 2 platform unit (10): infrastructure as code, manifests and scripts Sessions on that unit; FN-S05 for platform/delivery-pipeline/
platform/dev-environment/ The local integration environment FN-S02
contracts/<domain>/ The API and event contracts and stubs of one domain (10) Contract sessions of that domain
contracts/common/ Shared contract types and the contract tooling FN-S04
web/shell/, web/design-system/ The staff application shell and the design system FN-S06
web/domains/<domain>/ One workspace per domain (10), one folder per screen inside it Screen sessions, each only in its screen folders
e2e/harness/, e2e/scenarios/<slice>/ The scenario runner, and the scenario tests of each slice FN-S07; the contract and integrate sessions of the slice
docs/ Specifications, plan, decision records (docs/architecture/decisions/) and session handovers (docs/implementation_plan/delivery/handovers/) As the session plan allows

Build tools: Java units build with Gradle (Kotlin DSL) through the Gradle wrapper in their own folder, with Gradle dependency locking (gradle.lockfile) enabled. TypeScript packages use pnpm, each folder its own project with its own pnpm-lock.yaml, installed with --frozen-lockfile. Tool versions are pinned in each folder. Folder, package, database and image names follow section 4 of CLAUDE.md, with care.cema.his as the root of the Java packages.

The Enterprise Architecture Board confirmed three choices when it approved this record on 2026-11-24: Gradle rather than Maven, pnpm rather than npm, and care.cema.his as the root of the Java packages.

Nothing at the repository root is edited by a build, contract, screen or integrate session; the root files (CLAUDE.md, .gitignore, mkdocs.yml, requirements-docs.txt, .github/) are changed by foundation sessions or through a pull request of their own.

Rationale

A folder per unit matches how the plan cuts work, so the build check that keeps two sessions off one unit also keeps them off one set of files. Separate repositories would split a change to a requirement from the code that meets it, which ADR-HIS-033 rules out. Gradle has dependency locking built in, which Maven lacks, and the main healthcare libraries are on the JVM either way. pnpm gives a strict, content-addressed lockfile and fast installs from a shared store when many checkouts sit on one server.

Consequences

  • Each unit's build, test and lockfile changes stay in its folder. A dependency shared by several units is upgraded in each, by the sessions or fix sessions that own them.
  • How a domain workspace consumes the shell and design-system packages without a root workspace is settled by FN-S06, which records the screen layout as its own decision record.
  • The pipeline of FN-S05 decides which jobs run from the folders a change touches.
  • Gradle, the Gradle wrapper and pnpm are entered in the software bill of materials (DEP-004) by the pipeline of FN-S05, and pass the dependency rules of the technology stack, section 3, when adopted.
  • Unit folder names are fixed here; renaming a unit in section 5.2 does not rename its folder without a new record.