Skip to content
CAI
Software that uses CAICheck a score

andreschaffer/event-sourcing-cqrs-examples

64.2

Adequate · 22 September 2026

1.4k

lines of production code

Java

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an event-sourced banking service built on Dropwizard that manages client and account lifecycles through a domain model of aggregates and events. It exposes REST endpoints for enrolling clients and performing account operations like deposits and withdrawals, while maintaining in-memory read-model projections for transaction history and client account balances. The architecture relies on an asynchronous event bus and optimistic locking to handle state changes and concurrent access.

Features

Initial domain model for banking aggregates and events

This change introduces the core domain model for the bank service, establishing the foundational building blocks for event-sourced aggregates. It adds abstract base classes for Aggregates and Events, utilizing Java's \java.time\ for timestamps, along with supporting infrastructure like \EventStore\, \Specification\, and \ValueObject\. Concrete domain entities for \Account\ and \Client\ are implemented, defining their lifecycle events (such as account opening, deposits, withdrawals, and client enrollment) and business rules, including validation for email addresses and sufficient funds checks.

src/main/java/bankservice/domain · high confidence

Initial release of HTTP API endpoints and in-memory event store

This change introduces the incoming HTTP adapter layer for the banking service, exposing REST endpoints for managing clients (enroll, update, retrieve) and accounts (open, retrieve, deposit, withdraw) via JSON resources. It also adds the outgoing in-memory event store implementation, which persists domain events using a concurrent map and enforces optimistic locking to prevent concurrent modification conflicts.

src/main/java/bankservice/port · high confidence

Initial release of account and client management services

This change introduces the core service layer for managing bank accounts and clients, including the \AccountService\ and \ClientService\ implementations. These services handle domain operations such as opening accounts, depositing/withdrawing funds, enrolling clients, and updating client details. To ensure data consistency in concurrent environments, the services utilize a new \Retrier\ component that automatically retries operations on \OptimisticLockingException\ up to three times. The implementation relies on an event-sourcing pattern, persisting state changes via an \EventStore\ and publishing events through an \EventBus\ (for accounts).

src/main/java/bankservice/service · high confidence

Initial release of the Bank Service application

This change introduces the initial open-source version of the Bank Service, bootstrapped on Dropwizard. The application registers core REST resources for managing accounts, deposits, withdrawals, and clients, alongside read-model projections for account transactions and client accounts. It utilizes an in-memory event store and an asynchronous event bus to handle domain events, with exception mappers for optimistic locking and account not found scenarios, and enables hypermedia support via Declarative Linking.

src/main/java/bankservice/bootstrap · high confidence

New read-model projections for client accounts and account transactions

This change introduces two new read-model projections within the banking service to support efficient querying of account data. The \clientaccounts\ projection maintains a denormalized view of client accounts, tracking balances and client associations via an \AccountsListener\ that reacts to domain events (account opening, deposits, withdrawals) and exposes them through a REST endpoint at \/clients/{id}/accounts\. The \accounttransactions\ projection tracks individual transaction history per account, storing deposit and withdrawal details in a \TransactionsRepository\ and exposing them via \/accounts/{id}/transactions\. Both projections use in-memory repositories for initial implementation and rely on Java's \java.time\ API for timestamp handling.

src/main/java/bankservice/projection · high confidence

Test coverage

Initial test suite for domain models, services, and integration endpoints

Added comprehensive test coverage for the banking service, including unit tests for domain aggregates (Aggregate, Account, Client, EmailSpecification), service logic (AccountService retry behavior, Retrier), and infrastructure adapters (InMemoryEventStore, InMemoryTransactionsRepository, InMemoryAccountsRepository). Integration tests verify the full HTTP API lifecycle for clients, accounts, deposits, withdrawals, and transactions, along with exception mapping and health checks.

src/test · high confidence

Dependencies

Initial Maven project setup with Java 19 and Dropwizard 4

This change introduces the initial \pom.xml\ for the \bank-service\ project, establishing the build configuration and dependency landscape. The project targets Java 19 and utilizes Dropwizard 4.0.10 for the application framework, along with Jersey 3.1.11 and Jakarta EE 2.1.1 APIs. Development and testing rely on JUnit 6.1.3, Mockito 5.23.0, and Guava 33.5.0-jre, while static analysis is enforced via Error Prone 2.42.0 and Checkstyle 3.6.0. The build also configures specific JVM arguments to open \java.math\ and \java.time\ modules for reflection.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 62 → 64 (+2.0)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 99 (-0.6)
  • Architecture 69 → 69 (+0.0)
  • Maturity 57 → 57 (+0.0)
  • Readiness 58 → 62 (+4.1)
  • Security 68 → 85 (+17.7)
  • Domain Modelling 100 → 89 (-10.6)

Resolved (11)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • Scanner failed to run — not a clean result
  • Test reliability not included
  • The README does not explain how to start or run the application. (README.md)
  • dormant codebase — no living knowledge left to concentrate

New (15)

  • Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (12 lines × 2) (src/main/java/bankservice/service/account/DepositAccountCommand.java)
  • Duplicated block (13 lines × 2) (src/main/java/bankservice/domain/model/account/AccountDepositedEvent.java)
  • Duplicated block (13 lines × 2) (src/main/java/bankservice/domain/model/client/ClientEnrolledEvent.java)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No assertions: retriesGetUpToMaxAttemptsWithoutSharedStateBetweenCalls (src/test/java/bankservice/service/RetrierTest.java)
  • No assertions: returnClientAccounts (src/test/java/bankservice/it/ClientAccountsIT.java)
  • Scanner failed to run — not a clean result
  • Scanner failed to run — not a clean result

Changes since last survey

  • 10 commits — 10 feature/other, 0 fixes

By area

  • (repo) — 5 commits
  • (root) — 5 commits

Notable commits

  • change: Bump mvn-test-plugins.version from 3.5.6 to 3.6.0
  • change: Bump org.apache.maven.plugins:maven-compiler-plugin
  • change: Bump org.checkerframework:checker-qual from 4.2.1 to 4.2.2
  • change: Bump org.checkerframework:checker-qual from 4.2.2 to 4.2.3
  • change: Bump org.junit.jupiter:junit-jupiter from 6.1.2 to 6.1.3
  • change: Merge pull request #535 from andreschaffer/dependabot/maven/org.checkerframework-checker-qual-4.2.2
  • change: Merge pull request #536 from andreschaffer/dependabot/maven/org.junit.jupiter-junit-jupiter-6.1.3
  • change: Merge pull request #539 from andreschaffer/dependabot/maven/org.apache.maven.plugins-maven-compiler-plugin-3.16.0
  • change: Merge pull request #540 from andreschaffer/dependabot/maven/mvn-test-plugins.version-3.6.0
  • change: Merge pull request #541 from andreschaffer/dependabot/maven/org.checkerframework-checker-qual-4.2.3

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

andreschaffer/event-sourcing-cqrs-examples was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 22 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a3733c0e1ed2310e3a2234e974efbab734861c17 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-90d5d2fe38ee.