Skip to content
CAI
Software that uses CAICheck a score

Rezakazemi890/Clean-Architecture-CQRS

54.8

Adequate · 21 September 2026

1.1k

lines of production code

C#

primary language

4

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 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 55 → 55 (-0.3)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 66 → 65 (-1.0)
  • Architecture 89 → 89 (+0.0)
  • Maturity 60 → 60 (+0.0)
  • Readiness 53 → 53 (-0.9)
  • Security 47 → 47 (-0.1)
  • Domain Modelling 100 → 100 (+0.0)

Resolved (11)

  • Bounded contexts not declared
  • Exception naming is inconsistent. Some are suffixed with 'Exception' (SampleEntityAlreadyExistsException, SampleInvalidException, SampleDuplicateException), while one is not (SampleEntityNotFound). Also, 'NotFound' is typically a state/condition, not an exception type name itself in this context.
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • The 'Gender' concept is split between a Consts namespace/type and a Policies namespace/types. 'Gender' as a constant/enum is in 'Consts', while specific gender policies are in 'Policies'. This is a structural inconsistency regarding where 'Gender' related artifacts live.
  • The concept of 'Destination' is represented by multiple types across different layers: 'DestinationWriteModel', 'DestinationDto', 'DestinationReadModel', and 'SampleEntityDestination'. This suggests a lack of a unified model for Destination.
  • Typo in the class name: 'DataBase' should likely be 'Database' to match standard English spelling and common conventions, especially since 'Database' is the standard term.
  • early-stage repository — too little history to judge knowledge freshness
  • redundant comment (CleanArchitectureCQRS.Api/Controllers/BaseController.cs)
  • single-maintainer — knowledge-concentration (bus factor) risk

New (18)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no licence statement (README.md)
  • Documentation: no usage examples (README.md)
  • End-of-life runtime: .NET net9.0
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium: security finding (details withheld)
  • Medium: security finding (details withheld)
  • Medium: security finding (details withheld)
  • No dependency advisory monitoring
  • No test project references CleanArchitectureCQRS.Api (CleanArchitectureCQRS.Api/CleanArchitectureCQRS.Api.csproj)
  • No test project references CleanArchitectureCQRS.Infrastructure (CleanArchitectureCQRS.Infrastructure/CleanArchitectureCQRS.Infrastructure.csproj)
  • The parameter 'Destionation' contains a typo ('Destionation' instead of 'Destination'). This is a spelling inconsistency that should be corrected to match the standard spelling used elsewhere (e.g., 'destination' in the other parameter).
  • The parameter 'l' is used for two different concepts: a string (likely a city or name) and a SampleEntityDestination. Single-letter variable names are generally discouraged, but using the same letter for different types in the same scope or similar scopes is confusing. More importantly, 'l' is used for 'City' in one place and 'Destination' in another, which are semantically distinct but both short strings.
  • The parameter representing the name of a list (or entity) is named 'listName' in one context and 'Name' in another. While 'Name' is often sufficient when the type is clear, 'listName' is more specific. However, given the context of 'SampleEntity', 'Name' is likely the intended canonical name for the entity's name property/parameter, making 'listName' an inconsistent alias for the same concept.
  • Workflow token permissions not restricted
  • WriteOnlyPrivateField (CleanArchitectureCQRS.Domain/Entities/SampleEntity.cs)
  • redundant comment (CleanArchitectureCQRS.Infrastructure/Extensions.cs)

API surface

  • Unchanged — 7 HTTP endpoints

Architecture

  • Unchanged — 2 containers · 1 contexts · 0 edges

Written by watchdog.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 21 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 e911d76f2e7350f5271b6d401e8660c6e201877c — 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-28e75b8e3254.