FeeCheck — architecture description (arc42)¶
The architecture of FeeCheck, one file per arc42 chapter. It links rather than repeats: the product
requirements are in SPEC.md (SPEC.md), the decisions in docs/adr/ (docs/adr/), the domain
model in 8.11, the entity model in 8.19 and the business data model in docs/model/feecheck/data-model.md (docs/model/feecheck/data-model.md). Open architecture questions are
collected in one place, open.md; a chapter section that cannot be answered yet says only
TBD.
Binding for humans and for AI-assisted generation. Every architectural decision records which quality requirement it was measured against; the crosscutting concepts state what generated code must not do.
Where a chapter and the code or the backend's build file disagree, the code wins.
Start here¶
What FeeCheck is. It compares the terms agreed in a distribution partner contract against the master data a settlement system pays from, and puts every deviation in front of a person before payment (1.1).
What runs today. One backend with the web app built into it: an uploaded contract PDF opens a case, the intake converts it into page-anchored markdown, and the extraction reads the two contract partners and the contract ID, each with a confidence derived from a citation check. It runs locally and on Google Cloud Run. Reconciliation, review and release are planned. The containers are in 5.1, the modules in 5.2.1.
Reading order for a developer. 1 Introduction and Goals → 3.1 Business Context → 5 Building Block View → 6.1 The FeeCheck case, then 6.2.1 and 6.2.2, the runtime of what is built → 7.1 Deployment → 8.15 Onion architecture and 8.16 Modules. Terms and identifiers are in the glossary.
Chapters¶
- Introduction and Goals
- Architecture Constraints
- Context and Scope
- Solution Strategy
- Building Block View
- Runtime View
- Deployment View
- Cross-cutting Concepts
- Architecture Decisions
- Quality Requirements
- Risks and Technical Debts
- Glossary
Layout¶
The description follows the arc42 template release 2026.10.19, template version
9.1-EN, variant withhelp-gitHubMarkdownMP (GitHub Markdown, one file per chapter). The variant with
help was chosen so that every question the template asks was answered or recorded as open, not
skipped; each help block was removed once its section had been answered. One file per chapter
because a reader of one section opens one short file, and parallel pull requests no longer collide
on a single 1,100-line one. The headings carry the template's wording and its numbering
(## 3.1 Business Context); FeeCheck's own subsections are numbered below them.
about-arc42.md and images/arc42-logo.png are the
template's own, copied as they ship — about-arc42.md keeps the template's empty first heading, the one
exception to "no empty heading". The arc42 template is © Dr. Peter Hruschka, Dr. Gernot Starke
and contributors, licensed under CC BY-SA 4.0.
Other pages in this folder, on the docs site and in the repository alike:
| Page | Place |
|---|---|
concepts/ (docs/architecture/concepts/) |
one page per cross-cutting concept; chapter 8 numbers them and summarises each |
blocks/ (docs/architecture/blocks/) |
one page per building block of 5.1 with its detailed view; 5.2 summarises each and links it |
open.md |
every open architecture question, with where it comes from |
old-sections.md |
where each section of the former single-file description went, for references that still name an old section number |
In the repository only, not on the docs site:
| File | Place | Why not published |
|---|---|---|
CLAUDE.md (docs/architecture/CLAUDE.md) |
how the chapters are written — headings, sources, TBD, diagram style, tables |
instructions for the writers, not architecture |
owasp-llm06-2025-excessive-agency.md (docs/architecture/owasp-llm06-2025-excessive-agency.md) |
a fixed copy of OWASP's LLM06:2025 Excessive Agency, the reference for the guardrails concept | third-party text; the original is on owasp.org |
Diagrams¶
Every diagram is Mermaid inside its chapter, and the chapter is its source. The notation follows what a diagram shows: C4 for the overviews, UML for building blocks (with stereotypes such as «module»), interactions, lifecycles and domain models, and CMMN for the FeeCheck case. The C4 overviews are flowcharts in C4's shapes, because Mermaid's own C4 syntax overlaps edge labels.
Reading the diagrams. Colour shows the build state: green is built, blue with a dashed border is planned, and grey is an external system; people are light orange. A dotted arrow is a connection that exists only once its planned end is built. The diagrams of chapter 6 draw the FeeCheck case in CMMN's shapes as far as Mermaid offers them; their one legend is 8.18.1. Every other diagram has its legend right below it, and each has a table with the details of its elements — the diagram itself carries only names.
| Diagram | Level | Section | |
|---|---|---|---|
| 1 | System context | C4 level 1 | 3.1.1 |
| 2 | The backend's planned components | UML component, stereotypes | blocks/full-product-scope.md |
| 3 | Stage Contract intake — tasks and domain events | CMMN stage | 6.2 |
| 5 | Child case Fee reconciliation — tasks and domain events | CMMN case | 6.3 |
| 6 | Layer view — verification core, packs and adapters | structure, ADR-0001 | 8.10 |
| 7 | The FeeCheck case — collapsed stages, case file, milestones, child case | CMMN case, spec 15 | 6.1 |
| 7.1 | Case lifecycle — the business states | UML state machine | 6.1.1 |
| 7.2 | Stage work by event — request, reply, deadline | CMMN pattern | 6.1.2 |
| 8 | Container view — the API gateway | C4 level 2, ADR-0010 | 7.1.2.1 |
| 9 | Sign-in and an API call through the gateway | sequence, ADR-0010 | 6.4 |
| 10.1 | Async intake — containers | containers, ADR-0009 | 7.1.2.2 |
| 10.2 | Convert document — the conversion job | sequence, ADR-0009 | 6.2.1 |
| 11 | Local deployment — one machine | deployment | 7.1.1 |
| 12 | Google Cloud deployment | deployment | 7.1.2 |
| 13 | Whitebox overall system — the containers | C4 level 2 | 5.1 |
| 14 | White box Backend — the modules | UML component, stereotypes | 5.2.1 |
| 16 | Onion rings of one component | structure | 8.15.3 |
| 18 | Ports and adapters in the rings — intake's converter | structure | 8.15.4 |
| 19 | Convert document — conversion in the upload's call | sequence, spec 7 | 6.2.1 |
| 20 | Extract attributes — the agent loop | sequence, ADR-0012 | 6.2.2 |
| 21 | The event backbone — modules, case engine, outbox, broker | UML component, stereotypes | 8.16.3 |
| 22 | The case and its records — overview | entity-relationship | 8.19.1 |
| 24 | Intake — the document, its gates and rendition | entity-relationship | 8.19.2 |
| 25 | Review, decision and audit | entity-relationship | 8.19.3 |
| 26 | Assistance | entity-relationship | 8.19.4 |
| 27 | Attributes, values and verification | entity-relationship | 8.19.5 |
| 28 | The case's aggregates | UML class, DDD stereotypes | 8.11.3 |
| 29 | The case's tables | entity-relationship | 8.19.6 |
| 30 | Context map — the bounded contexts and their relationships | DDD context map | 8.11.2 |
| 31 | The intake's and the extraction's value objects | UML class, DDD stereotypes | 8.11.4 |
| 32 | The review's and the assistance's aggregates | UML class, DDD stereotypes | 8.11.5 |
| 33 | Domain events between the bounded contexts | event flow | 8.11.6 |