Skip to content
CAI
Software that uses CAICheck a score

Rezakazemi890/Clean-Architecture-CQRS

49.6

Weak · 8 November 2026

1.1k

lines of production code

C#

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET 9 application built on Clean Architecture and the CQRS pattern, structured into distinct layers for API, application logic, domain modeling, and infrastructure. It provides a complete implementation for managing 'SampleEntity' resources, including in-memory command and query dispatching, Entity Framework Core data access, and Serilog-based logging. The codebase includes comprehensive unit tests and shared abstractions for commands, queries, and domain events.

Features

Added CQRS and Domain Abstractions

The CleanArchitectureCQRS.Shared.Abstractions library now includes core interfaces and base classes for a Command/Query/Handler pattern and domain modeling. New abstractions include ICommand, ICommandDispatcher, and ICommandHandler for commands, as well as IQuery, IQueryDispatcher, and IQueryHandler for queries. Additionally, the library introduces an abstract AggregateRoot base class for domain entities and an IDomainEvent marker interface, alongside a PublicException base class for application errors.

CleanArchitectureCQRS.Shared.Abstractions · high confidence

Added CQRS commands, queries, and DTOs for SampleEntity management

The Application layer now includes the full set of CQRS components for managing SampleEntity data. This includes command handlers for creating, adding/removing items, and deleting entities, alongside query handlers for retrieving and searching entities. New DTOs (DestinationDto, SampleEntityDto, SampleEntityItemDto) define the data transfer structures, while custom exceptions handle validation errors like duplicate names or missing entities.

CleanArchitectureCQRS.Application · high confidence

Added CQRS read/write EF Core implementations for SampleEntity

The Infrastructure project now includes a complete CQRS data access layer for the SampleEntity domain. This includes Read and Write DbContexts with their respective entity configurations, domain models, and repositories for write operations. Additionally, query handlers and a read service are provided to support read-side operations, with all dependencies registered in the service collection.

CleanArchitectureCQRS.Infrastructure · high confidence

Added domain model for SampleEntity with policy-driven item generation

The domain layer now includes a new SampleEntity aggregate root, along with its associated value objects (SampleEntityId, SampleEntityName, SampleEntityDestination, SampleEntityItem), domain events, custom exceptions, and a repository interface. A factory pattern is introduced to create SampleEntity instances, supporting a policy-based mechanism that automatically generates default items based on gender (Male or Female) using dedicated policy classes.

CleanArchitectureCQRS.Domain · medium confidence

Initial release of Clean Architecture with CQRS pattern

The repository now includes the full solution structure for a .NET 9 application implementing Clean Architecture with the CQRS pattern. This includes the API, Application, Domain, and Infrastructure projects, along with a UnitTest project, a Shared layer, and supporting files like .gitignore and License. The solution file has been updated to include all new project references and build configurations.

(repo-wide) · high confidence

Introduce CleanArchitectureCQRS.Api project with CQRS controllers and Serilog integration

The new CleanArchitectureCQRS.Api project provides the HTTP layer for the application, featuring a BaseController and a SampleEntityController that expose GET, POST, PUT, and DELETE endpoints for managing sample entities. The project is configured with Serilog for logging, registers shared, application, and infrastructure services, and includes development and default appsettings files containing database connection strings and logging levels.

CleanArchitectureCQRS.Api · high confidence

Introduces shared CQRS infrastructure and .NET 9 upgrade

The shared project now provides a complete, in-memory Command and Query dispatching system, including \InMemoryCommandDispatcher\ and \InMemoryQueryDispatcher\ with corresponding extension methods for dependency injection. Additionally, the project has been upgraded to target .NET 9, incorporating dependencies such as Microsoft.EntityFrameworkCore 9.0.3 and Scrutor 4.2.2, while also adding an \AppInitializer\ hosted service for automatic database schema creation.

CleanArchitectureCQRS.Shared · high confidence

Test coverage

Added unit tests for SampleEntity domain and CQRS command handler

New unit tests were added to the CleanArchitecture.CQRS.UnitTest project to verify the behavior of the SampleEntity domain model and the CreateSampleEntityWithItem CQRS command handler. The tests confirm that adding a duplicate item throws a SampleDuplicateException, that successful additions trigger the correct domain event, and that the command handler properly validates existence and invokes the repository.

CleanArchitecture.CQRS.UnitTest · high confidence

Dependencies

Upgrade to .NET 9 and add new project dependencies

The solution has been upgraded to .NET 9, with all existing projects (Shared, Shared.Abstractions, Domain, Application, Infrastructure, and Api) targeting net9.0. New project files have been added for UnitTest, Api, Application, Domain, Infrastructure, and Shared layers, each defining their specific package dependencies (e.g., xUnit, Serilog, Entity Framework Core 9.0.3, Swashbuckle) and project references.

(dependencies) · medium 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

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 49 → 50 (+0.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 64 → 64 (+0.1)
  • Architecture 89 → 89 (+0.0)
  • Maturity 57 → 57 (+0.0)
  • Readiness 39 → 39 (+0.0)
  • Security 45 → 47 (+2.4)
  • Domain Modelling 100 → 100 (+0.0)
  • Performance 100 → 100 (+0.0)

Resolved (11)

  • Documentation: no project overview (README.md)
  • End-of-life runtime: .NET net9.0 (CleanArchitectureCQRS.Shared/CleanArchitectureCQRS.Shared.csproj)
  • Medium: security finding (details withheld)
  • XML-doc coverage: CleanArchitectureCQRS.Api (CleanArchitectureCQRS.Api/CleanArchitectureCQRS.Api.csproj)
  • XML-doc coverage: CleanArchitectureCQRS.Application (CleanArchitectureCQRS.Application/CleanArchitectureCQRS.Application.csproj)
  • XML-doc coverage: CleanArchitectureCQRS.Domain (CleanArchitectureCQRS.Domain/CleanArchitectureCQRS.Domain.csproj)
  • XML-doc coverage: CleanArchitectureCQRS.Infrastructure (CleanArchitectureCQRS.Infrastructure/CleanArchitectureCQRS.Infrastructure.csproj)
  • XML-doc coverage: CleanArchitectureCQRS.Shared (CleanArchitectureCQRS.Shared/CleanArchitectureCQRS.Shared.csproj)
  • XML-doc coverage: CleanArchitectureCQRS.Shared.Abstractions (CleanArchitectureCQRS.Shared.Abstractions/CleanArchitectureCQRS.Shared.Abstractions.csproj)
  • redundant comment (CleanArchitectureCQRS.Infrastructure/Extensions.cs)
  • redundant comment (CleanArchitectureCQRS.Infrastructure/Logging/Extensions.cs)

New (1)

  • Documentation: no map of the repository's parts (README.md)

API surface

  • Unchanged — 7 HTTP endpoints

Architecture

  • Unchanged — 2 containers · 1 contexts · 0 edges

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

Survey your own repository

Rezakazemi890/Clean-Architecture-CQRS 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 8 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 e911d76f2e7350f5271b6d401e8660c6e201877c — 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.3+preprod-45ab2cab63de.