2 Architecture Constraints¶
Constraints are given, not chosen. They are not quality requirements — they produce the quality requirements in 10.1.4 to 10.1.6. Listing them separately keeps the ADRs honest: a decision that is merely a consequence of a constraint must not be presented as a trade-off that was weighed.
| ID | Constraint | Consequence |
|---|---|---|
| C1 | Regulatory: Swiss and EU data protection, plus the outsourcing rules applying to the customer as a supervised financial institution (to be confirmed per customer); C8 names the laws and the certifications | A customer may be unable to use a cloud deployment or an external inference provider at all — the product must not assume either; the regime is decided per installation, the PoC's is scoped to the EU (4.7) |
| C2 | The operator's technology stack and development workflow; delivery distributed across several countries | Module boundaries must be explicit and enforced by the build, not by convention; stack choices are not free |
| C3 | On-premise installation must be possible, with a customer-operated or otherwise exchangeable model | No cloud-provider-specific managed service on the critical path |
| C4 | Cloud service deployment must also be possible | The same artefact must run in both worlds; tenancy is settled in 4.6: not in the PoC; a later cloud offering would be one isolated installation per customer |
| C5 | Integration with existing systems: master data in the master-data system, platform services of the fee calculation and invoicing system (open: SPEC.md A-3), customer identity provider. The platform's gateway-service is no longer one of them: FeeCheck's own API gateway is its only public entry (ADR-0010 (docs/adr/adr-0010-api-gateway-and-api-contract.md)) |
Integration points are ports; identity is federated, not local |
| C6 | Service-based architecture with a shared central database (not independent per-service databases) | Buys operability and consistency, gives up independent deployability and per-service scaling — must be justified in an ADR against 10.1.4 to 10.1.6 (not yet written, 11.3 TD-6) |
| C7 | Effort budget: about 145 h for the concept, the review frontend, the service contracts and persistence with evaluation, about 40 h for operations and deployment, one developer | Technology surface is the dominant cost driver, not feature count |
| C8 | What C1 adds for data protection and information security: the EU GDPR, the Swiss Data Protection Act (DSG), the Swiss Banking Act (BankG) and country-specific EU rules such as Luxembourg's or Germany's; and the certification target — the product must be able to meet at least ISO/IEC 27001 and ISO/IEC 42001 | Drives many decisions — what may enter a prompt or a log, where data is processed, what is retained. The proof of concept processes synthetic data only. Personal and other sensitive data are listed in a catalogue linked with the general data catalogue, and a detailed policy follows; neither exists yet (OQ-8 in open.md) |
2.1 Load figures (as known)¶
The user figures are SPEC.md §8, assumption A-1.
| Figure | Value |
|---|---|
| Specialist reviewers (daily users) | 5–10 |
| Approvers (occasional users) | up to 1 000 |
| Estimated peak concurrency | fewer than 50 |
| Contract volume per customer | varies widely, small to large — to be quantified (OQ-3) |
| Settlement cycle | periodic; review window between settlement run and release to be fixed (OQ-2) |
These figures are the reason several classical qualities are budgets rather than drivers (10.1.8). A single backend instance covers this load with room to spare; nothing in the numbers forces a distributed design.
2.2 Technical — the stack¶
The stack, with the major versions that shape the architecture; the Status column says what is
built and what is planned. The exact versions are not repeated here:
the backend's build file (backend/app/build.gradle.kts) declares the backend's, and
its dependency lock (backend/app/gradle.lockfile) pins what they resolve to; the web app's
and the website's are pinned in the web app's package manifest (frontend/app/package.json)
and the website's (frontend/site/package.json), each with its pnpm lock file. The
compatibility chain Spring AI 2.0 ⇒ Spring Boot 4.0/4.1 ⇒ Spring Framework 7.0 and the Jackson 3
trap are in CLAUDE.md (CLAUDE.md), "Stack". A planned
dependency needs an ADR (ARC-Q6.1) and an on-premise equivalent
(7.1.3)
before it enters the build; the technology surface is itself a risk
(RISK-2).
| Area | Technology | Where it is fixed, or where it comes from | Status |
|---|---|---|---|
| Language | Java 25 (LTS), through the Gradle toolchain | the toolchain setting in the backend's build file | built |
| Build | Gradle 9 (Kotlin DSL), multi-project, wrapper committed | the committed Gradle wrapper and the root settings file | built |
| Framework | Spring Boot 4.1 on Spring Framework 7.0; Spring MVC; Spring Security 7 with the OAuth2 client (Google sign-in) | the Spring Boot Gradle plugin and its BOM | built |
| AI abstraction | Spring AI 2.0 — the Mistral and the Google GenAI (Vertex AI) chat starters and the MCP server (WebMVC); chat only — embedding, moderation, image and OCR are switched off or never wired | the Spring AI version in the build file; the application configuration (8.13) | built |
| JSON | Jackson 3, the version Spring Boot brings | Spring Boot's JSON starter | built |
| Modularity | Spring Modulith 2.1 — module verification, module docs, the actuator's modulith endpoint; jMolecules onion rings, enforced with ArchUnit 1.5 | the Spring Modulith, jMolecules and ArchUnit versions in the build file | built |
| Messaging | Spring Modulith events with the event publication registry as the outbox, the one event backbone; Spring Cloud Stream carries externalized events outbound through ZenWave's externalizer (MIT; copied into FeeCheck if it needs a change or stalls) and Spring Cloud GCP's Pub/Sub binder; inbound by push into the backend (8.16.3, 7.1.5). It replaces ADR-0009's "Pub/Sub as the one eventing technology, no outbox" | target architecture and persistence scope; ADR-0009 (docs/adr/adr-0009-async-intake-pubsub-bucket-firestore.md) |
planned |
| Async intake | Spring Cloud GCP 8 — the Pub/Sub and Cloud Storage starters behind the case's queue and document ports; off by default, on under the local-emulator and the Cloud Run case profiles (ADR-0009 (docs/adr/adr-0009-async-intake-pubsub-bucket-firestore.md), spec 264 (docs/specs/264-google-case-adapters.md), 8.13) |
the Spring Cloud GCP version in the build file; the emulator images in the Compose file (compose.yaml) |
built; the cloud resources planned |
| Case engine | Flowable's CMMN engine, open source, embedded in the backend inside the cases module; on H2 in memory in the offline build (8.18) |
spec 15 (docs/specs/15-workflow-module.md), checked against Flowable 8; the adopting ADR |
planned |
| Database | PostgreSQL 18 with the pgvector extension over JDBC, the schema migrated by Flyway when the backend starts; off by default, on under the local and the Cloud Run database profiles; on Google Cloud, Cloud SQL reached over its private IP through the Cloud SQL Java connector with IAM database authentication (ADR-0013 (docs/adr/adr-0013-postgresql-on-cloud-sql.md), 8.3) |
the image tag and digest in the Compose file; the Flyway, driver and Spring Cloud GCP versions in the build file | built |
| Persistence | Spring Data JDBC over the database above (ADR-0019 (docs/adr/adr-0019-spring-data-jdbc-for-the-relational-store.md)), with SQL that also runs on H2 in its PostgreSQL mode in the offline build, and later a pgvector vector store: one database for the case, the case engine's tables and the outbox (8.3) |
the operator's workflow and the persistence and vector search scope | built for the case, its pages and the outbox; the vector store and the case engine's tables planned |
| Document conversion | Docling: a self-hosted docling-serve container, reached through the docling-java client 0.x |
the image tag and digest in the Compose file; the docling-java version in the build file | built |
| Language detection | Apache OpenNLP 2 with its language-detection model | the OpenNLP version in the build file | built |
| Security | Spring Security with Google through OIDC in the backend (ADR-0008 (docs/adr/adr-0008-google-sign-in-and-backend-on-cloud-run.md)); the login moves to the API gateway with token relay to the backend as a resource server (ADR-0010 (docs/adr/adr-0010-api-gateway-and-api-contract.md), 8.8); federated identity, the identity provider chosen per installation (4.5) |
the operator's workflow, C5 | built in the backend; at the gateway planned |
| API gateway | Spring Cloud Gateway Server Web MVC, its own deployable and the only public entry (ADR-0010 (docs/adr/adr-0010-api-gateway-and-api-contract.md)) |
— | planned |
| API | OpenAPI, code-first: springdoc-openapi derives it from the controllers, the committed snapshot of the contract is checked in the build and MockMvc tests validate every tested exchange against it (spec 261 (docs/specs/261-openapi-contract.md)); the frontend client generated from it (Orval); no version in the path yet (ADR-0010 (docs/adr/adr-0010-api-gateway-and-api-contract.md), 8.9) |
the operator's workflow named contract-first; code-first was decided in ADR-0010 | built: the contract, its check and the Orval client |
| Web app and website | React 19, React Router 8 (SPA for the web app, pre-rendered for the website), Vite 8, TypeScript 7, Tailwind CSS 4; Vitest 5, Playwright; pnpm 12; the web app is built by ./gradlew build and served by the backend; its component and screen catalog is Storybook 10, every story a Vitest browser test with an axe check in the build (ADR-0017 (docs/adr/adr-0017-component-catalog-storybook.md)) |
the web app's and the website's package manifests and pnpm lock files | built |
| Frontend libraries | TanStack Query, react-hook-form, shadcn/ui; the web app stays one app with its shared components inside it, and a pnpm workspace with shared packages follows only when a second app needs them | the operator's workflow; the layout in design.md |
planned |
| Tests | JUnit Jupiter 6, AssertJ, ArchUnit | Spring Boot's test starter; the dependency lock | built |
| Quality gates | Error Prone, JaCoCo (90 % per class), PIT mutation testing (95 %), Spotless with google-java-format | the plugin block and the pinned tool versions | built |
| Hosting | Google Cloud Run in europe-west6 and Firebase Hosting for the PoC; chosen per installation (4.5, 7.1.2) |
the Google Cloud entry of the operations configuration (.claude/ops-doctor.json) |
built |
Where the build deliberately departs from the operator's workflow (C2 says stack choices are
not free; these are recorded rather than hidden): no Lombok (records and plain Java); coverage
floor 90 % per class instead of 80 %, plus mutation testing; Error Prone and Spotless instead of
SonarQube and Checkstyle; onion rings per component (2.4) instead of the DTO / mapper / service
package layout; Zod as a shared schema source does not apply to a Java backend (ADR-0003 open
point 5) — Orval generates Zod schemas from the OpenAPI snapshot when a screen needs them; the
API contract is code-first instead of contract-first
(ADR-0010 (docs/adr/adr-0010-api-gateway-and-api-contract.md)).
2.3 Organisational¶
| Topic | What holds |
|---|---|
| One owner | Architecture and quality decisions are the project owner's (1.3) |
| Budget | The effort budget of C7; scope is cut against it, not the other way round |
| Anonymisation | The end customer stays neutralised throughout ("a fund management company"). The settlement systems are named by their role (master-data system, fee calculation and invoicing system), not by product name (CLAUDE.md, "Workflow", data rule) |
| No test system with real data | The master-data system is replaced by a contract-equivalent mock. Test data is synthetic (SPEC.md §2, "Replaced for the project work"; CLAUDE.md, "What does not belong in this repository") |
2.4 Conventions¶
| Convention | Rule |
|---|---|
| Language | Everything in the repository is English — see the language rule of CLAUDE.md |
| Onion rings per component | Each component a package below the application's root package with its own domain, application and infrastructure rings, enforced by the build (8.15 Onion architecture) |
| Java | Records for carried data, constructor injection only, Javadoc on public types; the full list is in CLAUDE.md, "Coding conventions" |
| Frontend naming | One route module per screen (conventions.md §2); shared components in kebab-case files exporting PascalCase components, kept together in the web app's components directory (design.md §2.2); providers and hooks named by the same conventions |
| Styling | Exclusively through Tailwind classes and design tokens — no raw colours, no inline styles, and no own CSS files beyond the two Tailwind 4 needs: the entry sheet that imports it and the token file |
| Identifiers | The prefixes are registered in docs/specs/README.md (docs/specs/README.md) §2 and explained in the glossary |