denis.sajnar/cqrs-microservices
72.9
Strong · 10 November 2026
5.7k
lines of production code
Kotlin
with Python
9
measurements over time
What this system is
This system is a CQRS-based order management platform split into command and query services, handling order creation, updates, and deletions while maintaining a separate read model. It ensures reliable event-driven communication between services using a transactional outbox pattern, RabbitMQ, and idempotent inbox processing. The architecture enforces strict hexagonal boundaries and provides a REST API with versioning and standardized error handling, backed by MongoDB for event sourcing and PostgreSQL for read queries.
Features
Enforced hexagonal architecture rules and added request correlation logging
The architecture module now includes automated tests using Konsist to enforce strict hexagonal architecture boundaries, ensuring that domain, ports, use cases, and adapters do not violate their intended dependencies. Additionally, the observability module introduces a CorrelationIdFilter that injects a unique ID into request logs via MDC, improving traceability across services, and an HttpExchangeLoggingFilter that logs HTTP exchanges with sensitive data redaction.
(repo-wide) · high confidence
Introduce command-side domain model and use cases for order management
The order-command-service core module now contains the foundational domain model and application use cases for the order write side. This includes the \OrderAggregate\ which manages order state and enforces invariants (such as preventing updates to shipped orders), command objects (\CreateOrderCommand\, \UpdateOrderCommand\, \DeleteOrderCommand\) with validation logic, and error types like \ConcurrentModification\ and \OrderInvariantViolated\. The module also introduces the \UseCase\ annotation to mark application services, implements the \Orders\ and \OrderHistory\ use case interfaces, and adds a new \OutboxDispatch\ use case to handle reliable event publication via an outbox pattern. Additionally, it defines a unified \Page\ and \Pagination\ vocabulary for consistent result set handling across the service.
order-command-service/core · high confidence
New CI and developer tooling scripts for deprecation checks, coverage reporting, and git hooks
Added three new scripts to the repository: \check-deprecations.py\ validates application configuration against the pinned Spring Boot version to fail the build on deprecated properties; \coverage-summary.sh\ parses JaCoCo XML reports to output a standardized coverage line for GitLab; and \setup-hooks.sh\ configures local Git to use the \.githooks\ directory for pre-commit validation.
scripts · high confidence
Order Command Service REST API and MongoDB persistence
The order command service now exposes a REST API for creating, updating, and deleting orders, alongside monitoring endpoints for the event log and outbox queue. The API uses SpringDoc OpenAPI for documentation and enforces strict validation on request bodies, returning standard HTTP status codes (201, 400, 404, 409, 422) for various error conditions. Internally, the service persists order events and outbox records in MongoDB, utilizing unique compound indexes to guarantee version consistency and prevent duplicate events. The outbox implementation supports atomic claiming and publishing of events to ensure reliable delivery, with transaction support enabled for MongoDB operations.
(repo-wide) · high confidence
Order command service introduces outbox pattern, API versioning, and comprehensive integration tests
The order command service now implements an outbox pattern to ensure reliable event delivery, with a scheduled dispatcher that purges records after seven days and configuration for RabbitMQ publisher confirms and returns. API versioning has moved from the URL path to the X-API-Version header, with version 1 as the default and unsupported versions rejected with a 400 error. The service includes integration tests covering the outbox atomicity, event log uniqueness, error contracts using RFC 9457 problem details, and API versioning behavior, along with test containers for MongoDB and RabbitMQ.
order-command-service/app/src · high confidence
Order query service initial release with CQRS read model and API versioning
The order-query-service is introduced as a new Spring Boot application that maintains a PostgreSQL-backed read model by consuming events from RabbitMQ. It features an inbox mechanism for idempotent event processing, automatic projection scheduling, and dead-letter queue handling for unprocessable messages. The API is versioned via the X-API-Version header, and the service exposes a Scalar-based API reference at /docs. The service is configured to run with virtual threads and integrates with Docker Compose for local development infrastructure.
order-query-service/app · high confidence
Repository initialization with CQRS architecture and CI/CD pipeline
The repository has been initialized with a CQRS-based order management system split into command and query services, featuring event sourcing, a transactional outbox/inbox pattern, and hexagonal architecture enforced by Gradle module dependencies. The project includes a comprehensive GitLab CI/CD pipeline that enforces Conventional Commits, runs security scans with Trivy and Semgrep, validates YAML and shell scripts, and checks code coverage. Documentation includes a detailed context definition, architecture decision records (ADRs), and contributing guidelines. The system uses MongoDB for event storage, PostgreSQL for the read model, and RabbitMQ for inter-service communication, with local development supported via Docker Compose.
(repo-wide) · high confidence
Behavioural changes
API versioning moves to a header and error responses are standardized
The web module now identifies its API version via the X-API-Version header instead of the URL path, allowing clients to use the same endpoints across versions. Additionally, error handling has been unified into a single ProblemDetailHandler that returns RFC 9457 compliant JSON for all validation and internal errors, ensuring consistent error shapes across both read and write services.
web · high confidence
Enforce Conventional Commits and Kotlin Linting locally
The repository now includes local Git hooks to improve code quality before pushing. The commit-msg hook enforces Conventional Commit formatting on the commit subject, requiring a type (such as feat, fix, or refactor) and an optional scope. The pre-push hook automatically runs Kotlin linting and static analysis (lintKotlin and detekt) via Gradle whenever Kotlin files are changed in the push, while skipping the check if no Kotlin code is modified or if the working tree is dirty.
.githooks · high confidence
Gradle wrapper upgraded to version 9.7.1 with enhanced stability settings
The Gradle wrapper has been updated from version 8.14.3 to 9.7.1, introducing a new distribution SHA-256 checksum for integrity verification. Additionally, the network timeout has been increased from 10,000ms to 30,000ms, and retry logic has been enabled with 3 retries and a 1,000ms back-off period to improve build reliability under unstable network conditions.
gradle · high confidence
Stabilized build logic with dependency locking and parallel-safe test execution
The build-logic module now enforces reproducible builds via new Gradle dependency lockfiles and introduces a DockerLock service to serialize Testcontainers usage, preventing race conditions and worker crashes during parallel test execution. Additionally, the conventions enforce strict Java deprecation and removal warnings, align Kotlin analyzer versions to avoid compiler mismatches, and apply security patches for Tomcat and RabbitMQ to ensure the pipeline fails on critical vulnerabilities.
build-logic · high confidence
Dependencies
Dependency locking enabled for REST, MongoDB, and RabbitMQ adapters
The order-command-service adapters now use Gradle dependency locking to ensure reproducible builds. New lockfiles have been added for the REST input adapter, the MongoDB output adapter, and the RabbitMQ output adapter, pinning specific versions for all compile, runtime, and test dependencies in those modules.
order-command-service/adapter · high confidence
Dependency locking enabled for RabbitMQ, REST, and PostgreSQL adapters
The build system now enforces deterministic dependency resolution for the order-query-service adapters by adding Gradle dependency lockfiles for the RabbitMQ input, REST input, and PostgreSQL output modules. This ensures that all transitive dependencies (including Spring Boot 4.1.1, Kotlin 2.4.20, and Hibernate 7.4.5) are pinned to specific versions, preventing unexpected changes in the runtime environment.
order-query-service/adapter · high confidence
Initial Gradle build configuration and dependency management
The project introduces a comprehensive Gradle build structure, including a version catalog (\libs.versions.toml\) that defines dependencies such as Spring Boot 4.1.1, Kotlin 2.4.20, and Jackson 3. The build enforces strict dependency locking via \gradle.lockfile\ to ensure reproducible builds and secure scanning by Trivy, and it configures unique module coordinates to prevent resolution conflicts. Additionally, the setup includes convention plugins in \build-logic\, architecture validation using Konsist, and JaCoCo coverage aggregation across the multi-module services.
(dependencies) · high confidence
Introduction of Gradle dependency locking
The order-command-service now uses Gradle dependency locking to ensure reproducible builds. A new gradle.lockfile has been added to the repository, capturing the exact versions of all production, test, and development dependencies (such as Jackson 2.21.5, Kotlin 2.4.20, and Netty 4.2.17) to prevent unexpected version drift during builds.
order-command-service/app · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 71 → 73 (+1.7)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 99 → 100 (+1.3)
- Architecture 86 → 83 (-2.3)
- Maturity 76 → 89 (+12.7)
- Readiness 76 → 87 (+11.2)
- Security 74 → 73 (-1.6)
- Domain Modelling 65 → 65 (+0.0)
Resolved (10)
- Checkable ADR rule enforced only by prose: Hexagonal modules, with the dependency direction held by the Gradle graph (docs/adr/0003-hexagonal-modules-with-the-dependency-direction-in-the-gradle-graph.md)
- Disclosure policy has no reporting contact
- Leaked secret: hardcoded-credential (compose.yaml)
- Leaked secret: hardcoded-credential (compose.yaml)
- Leaked secret: hardcoded-credential (compose.yaml)
- Leaked secret: hardcoded-credential (compose.yaml)
- Leaked secret: hardcoded-credential (compose.yaml)
- check-deprecations.load_deprecations (cognitive 38) (scripts/check-deprecations.py)
- check-deprecations.main (cognitive 41) (scripts/check-deprecations.py)
- check-deprecations.main (cyclomatic 21) (scripts/check-deprecations.py)
New (2)
- Disclosure policy has no reporting contact (SECURITY.md)
- High interface indirection
Architecture
- Containers 0 added · 0 removed · contexts 2 added · 2 removed · edges 3 added · 3 removed
Added bounded contexts (2)
- order-command-service/core
- order-query-service/core
Removed bounded contexts (2)
- order-command-service/core
- order-query-service/core
Added dependency edges (3)
- order-command-service/core → shared
- order-query-service/core → shared
- postgresql → order-query-service/core (coupling)
Removed dependency edges (was a dependency, now gone) (3)
- order-command-service/core → shared
- order-query-service/core → shared
- postgresql → order-query-service/core (coupling)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
denis.sajnar/cqrs-microservices 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 10 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 858dcd3c48341316d9b9cda2e66487f65c7c4999 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.