Skip to content
CAI
Software that uses CAICheck a score

ShowMeYourCodeYouTube/cqrs-and-event-sourcing-in-kotlin

69.3

Adequate · 22 September 2026

1k

lines of production code

Kotlin

primary language

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a demonstration of modern software architecture patterns, specifically Command Query Responsibility Segregation (CQRS) and Event Sourcing, implemented in Kotlin with Spring Boot. It provides separate command and query models for managing product data, utilizing distinct repositories for write and read operations. The codebase includes both in-memory and persistent implementations, accompanied by integration tests to validate the behavior of these architectural components.

Features

Add CQS demo with in-memory product management

A new CQS demo module has been added, providing an in-memory product repository and a REST API for managing product availability and listing products. The demo includes command and query handlers for adding products, changing availability, and retrieving product data, all exposed via Spring Boot controllers.

cqs/src/main · high confidence

Added product domain models and events for CQRS and CQS patterns

New domain classes were added to support Command-Command-Query-Read-Model (CQRS) and Command-Query-Separation (CQS) architectures. This includes the \Product\ entity with event handling logic, \ProductInformation\ data class, and specific domain events (\ProductCreatedEvent\, \ProductUpdatedEvent\) for the event-sourcing side. Additionally, command and query models (\ProductCommand\, \ProductQuery\) and a basic \Product\ data class for the CQS demo were introduced to separate write and read models.

cqrs-parent · high confidence

Introduce CQRS and Event Sourcing architecture

The application now implements a CQRS (Command Query Responsibility Segregation) and Event Sourcing architecture. This introduces new REST endpoints for adding products, changing product availability, and querying product data, all handled through dedicated command and query handlers. The system persists state by storing domain events in an event store and projecting them into read models via an event bus, enabling a clear separation between write and read operations.

cqrs-and-event-sourcing · high confidence

Introduce CQRS demo with separate command and query models

The application now implements a CQRS (Command Query Responsibility Segregation) architecture for product management. Users can add products and change their availability via dedicated command handlers, while product data is projected into separate query models for efficient retrieval. The demo exposes REST endpoints for adding products, updating availability, and querying product details, backed by distinct MongoDB (commands) and JPA (queries) repositories.

cqrs/src/main/kotlin · high confidence

Behavioural changes

Updated Maven Wrapper to v3.2.0 with enhanced security and shell compatibility

The project's Maven Wrapper has been upgraded from version 0.5.6 to 3.2.0. This update improves shell script compatibility and introduces SHA-256 validation for the wrapper JAR to ensure integrity. Additionally, the script now supports sourcing mavenrc files from /usr/local/etc/ and /etc/ on Unix-like systems, and uses the $USERPROFILE directory for Windows batch scripts.

(repo-wide) · high confidence

Updated Maven wrapper to version 3.2.0

The Maven wrapper configuration has been updated to use Maven 3.9.3 and the Maven wrapper JAR 3.2.0, replacing the previous versions (3.8.3 and 0.5.6). This change updates the build tooling used to bootstrap the project, which may affect build behavior or compatibility with existing scripts.

.mvn · high confidence

Test coverage

Added integration tests for the CQS demo controller; Removed CQRS demo application test.

Dependencies

Upgrade to Spring Boot 3.1.2 and Kotlin 1.9.0

The project's parent POM has been upgraded to Spring Boot 3.1.2 (from 2.5.6) and Kotlin 1.9.0 (from 1.5.31). This change also introduces a multi-module Maven structure with separate modules for CQS, CQRS, and Event Sourcing, and adds a new 'coverage-report' module to aggregate JaCoCo test coverage data.

(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

Score

  • CAI 76 → 69 (-6.5)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 98 (-2.4)
  • Architecture 74 (new)
  • Maturity 62 → 62 (+0.0)
  • Readiness 76 → 78 (+1.7)
  • Security 100 → 100 (+0.0)
  • Domain Modelling 100 → 70 (-30.3)

Resolved (8)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • No exposed public API
  • Scanner failed to run — not a clean result
  • Test reliability not included
  • change coupling unreadable for .kt — no production change history could be paired for this repository's own source
  • early-stage repository — too few commits for a meaningful bus factor
  • early-stage repository — too little history to judge knowledge freshness

New (12)

  • Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no project overview (README.md)
  • Duplicated block (10 lines × 2) (cqrs-and-event-sourcing/src/main/kotlin/com/showmeyourcode/cqrseventsourcing/demo/config/H2ServerManual.kt)
  • Duplicated block (19 lines × 3) (cqrs-and-event-sourcing/src/main/kotlin/com/showmeyourcode/cqrseventsourcing/demo/controller/ProductController.kt)
  • Duplicated block (7 lines × 3) (cqrs-and-event-sourcing/src/main/kotlin/com/showmeyourcode/cqrseventsourcing/demo/domain/CommandHandlerProvider.kt)
  • Duplicated block (7 lines × 3) (cqrs-and-event-sourcing/src/main/kotlin/com/showmeyourcode/cqrseventsourcing/demo/domain/QueryHandlerProvider.kt)
  • No ADRs found
  • Scanner failed to run — not a clean result
  • Scanner failed to run — not a clean result
  • TodoComment (cqrs-and-event-sourcing/src/test/kotlin/com/showmeyourcode/cqrseventsourcing/demo/ProductControllerTest.kt)
  • TodoComment (cqrs/src/test/kotlin/com/showmeyourcode/cqrs/demo/ProductControllerTest.kt)

Architecture

  • Containers 0 added · 0 removed · contexts 3 added · 1 removed · edges 0 added · 0 removed

Added bounded contexts (3)

  • cqrs
  • cqrs-and-event-sourcing
  • cqs

Removed bounded contexts (1)

  • cqrs-parent

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

Survey your own repository

ShowMeYourCodeYouTube/cqrs-and-event-sourcing-in-kotlin 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 e8cb0a080f4c769c215e5ff07265aa54339be644 — 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-821afab8930d.