CanerPatir/aspnet-core-clean-arch
42.5
Weak · 21 September 2026
1.7k
lines of production code
C#
primary language
4
measurements over time
What this system is
This system is a .NET Core product management service built on a hexagonal architecture with event sourcing. It enables users to create products, add content and variants, and manage product approval workflows. The application persists state changes as events to MongoDB or an in-memory store and exposes these capabilities through a REST API with input validation.
Features
Add content to product API endpoint and validation
A new POST endpoint at /api/products has been added to allow users to add content to a product. This endpoint accepts an AddContentToProductCommand and validates that the Description, Title, AttributeId, ProductId, and AttributeValueId fields are all provided before processing the request.
src/WebApi/UseCases/AddContentToProduct · high confidence
Add content to product capability
Users can now associate specific content with an existing product. This new use case allows specifying a product ID, content title, description, and associated attribute details (ID and value ID). The system loads the target product, attaches the new content along with its attribute reference, and persists the updated product state.
src/Application/UseCases/AddContentToProduct · high confidence
Adds Serilog-based logging configuration with Graylog and console support
The application now includes a new logging infrastructure component that configures Serilog via a WebHost extension. This setup enriches logs with application version and environment details, writes logs to a Graylog server via UDP, and optionally outputs colored logs to the console, all driven by configuration values.
src/Infrastructure/Logging · high confidence
Adds in-process message bus with Mediator pattern
The application now includes an in-process message bus infrastructure in the messaging layer, introducing a custom Mediator implementation that routes commands, queries, and events to their respective handlers via dependency injection. This change adds the \IMediator\ interface and its concrete \Mediator\ class, along with service collection extensions to automatically scan assemblies and register command, query, and event handlers, enabling decoupled communication between application components without external messaging dependencies.
src/Infrastructure/Messaging · high confidence
Application layer interfaces and CreateProduct use case
The Application layer now defines core command, query, and event handler interfaces (ICommandHandler, IQueryHandler, IEventHandler) to structure application logic. Additionally, a new CreateProduct use case has been introduced, consisting of a CreateProductCommand and its corresponding handler, which persists new products via the IProductRepository.
src/Application · high confidence
Event-sourced persistence with optimistic concurrency for MongoDB
The persistence layer now supports an event-sourced architecture for the Product aggregate, introducing an IEventStore interface with implementations for both in-memory and MongoDB backends. This change adds optimistic concurrency control to prevent data loss during concurrent updates, throwing a ConcurrencyException when version mismatches are detected. Users can now choose between a lightweight in-memory store for testing or a production-ready MongoDB implementation that persists event streams and handles domain event dispatching via the mediator.
src/Infrastructure/Persistence · high confidence
Initial Web API infrastructure and configuration setup
The WebApi project is initialized with a standard ASP.NET Core 3.0 host, including a Startup class that wires up infrastructure services and MVC. The API exposes Swagger documentation at the root path and includes response compression. JSON serialization is configured to use a custom contract resolver that preserves original property names for types within specific namespaces while camel-casing others. Validation is integrated via FluentValidation, and logging is configured using Serilog with environment-specific settings for Development, Staging, and Production.
src/WebApi · high confidence
Initial domain model and infrastructure abstractions for product management
This change introduces the foundational domain layer for the product context, establishing core DDD building blocks and specific product entities. It adds base abstractions including \Entity\, \ValueObject\, \BaseDomainEvent\, and an \InstanceEventRouter\ to handle internal event routing within aggregates. The \IRepository\ interface and its \ProductContext\ specialization (\IProductRepository\) define the storage contract for aggregates. Concrete domain models are introduced for \Product\, \Content\, and \Variant\, along with a comprehensive set of domain events (e.g., \ProductCreated\, \VariantAddedToProduct\, \ImageAddedToProduct\) that drive state changes within these entities.
src/Domain · high confidence
Initial domain model for product management
The Domain layer now includes the foundational classes for the product context, introducing an AggregateRoot base class with event sourcing capabilities (versioning, change tracking, and history loading) and a Product aggregate root. The Product entity supports creating products with brand and category references, adding content and variants with specific attribute slicers/varianter attributes, attaching images to variants, and approving products once they meet minimum content and image requirements. Supporting value objects like AttributeRef, BrandRef, CategoryRef, and ImageRef are also added to model product attributes and metadata.
Domain · high confidence
Initial project scaffolding with hexagonal architecture structure
The repository has been initialized with a sample .NET Core 3.0 application demonstrating hexagonal (ports and adapters) architecture. This includes the addition of a solution file organizing the project into Domain, Application, Infrastructure, and WebApi layers under src, along with corresponding test projects (TestBase, Domain.Specs, Application.Tests, Infrastructure.Tests) under test. A global Directory.build.props file sets the project version to 0.0.1 and language version to latest, while the project is licensed under Apache License 2.0.
(repo-wide) · high confidence
New API endpoint for creating products with input validation
A new POST endpoint at /api/products has been added to allow users to create new products. This endpoint accepts a CreateProductCommand and validates that the BrandId, CategoryId, and ProductCode are provided before processing the request.
src/WebApi/UseCases/CreateProduct · high confidence
Test coverage
Expanded test coverage for product domain and application command handlers
Added comprehensive unit and specification tests for the Product domain aggregate, verifying creation, content and variant addition, and approval workflows (including validation for missing content, variants, and images). Included tests for the CreateProduct command handler to ensure products are persisted correctly via the repository. Added a new in-memory database fixture using SQLite for integration testing and established base classes for test infrastructure, including an in-process message bus mediator test and IoC-based test helpers.
test · high confidence
Dependencies
Initial project structure and dependency configuration for .NET Core 3.0
This change introduces the foundational project structure and dependency manifests for the application, establishing a clean architecture with Domain, Application, Infrastructure, and WebApi layers. The solution targets .NET Core 3.0 (with shared libraries using netstandard2.1) and integrates key libraries including FluentValidation for input validation, MongoDB Driver for data persistence, Serilog for logging, and xunit with AutoFixture for testing. This sets the baseline for the application's runtime environment and architectural boundaries.
(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 42 → 42 (+0.6)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 77 → 63 (-14.3)
- Architecture 76 → 75 (-0.6)
- Maturity 57 → 57 (+0.0)
- Readiness 28 → 28 (+0.0)
- Security 43 → 44 (+1.2)
- Domain Modelling 73 (new)
- Event Sourcing 100 (new)
Resolved (12)
- Bounded contexts not declared
- Low cohesion: AggregateRoot (LCOM4 4) (src/Domain/Abstraction/AggregateRoot.cs)
- Medium CVE: SharpCompress 0.23.0
- Medium CVE: SharpCompress 0.23.0
- No exposed public API
- Test runner surfaced no tests
- Thin analysable surface across projects
- early-stage repository — too little history to judge knowledge freshness
- git history depth insufficient
- git history depth insufficient
- redundant comment (src/Domain/ProductContext/Product.cs)
- single-maintainer — knowledge-concentration (bus factor) risk
New (8)
- Documentation: no architecture or design documentation (README.md)
- Documentation: no usage examples (README.md)
- EmptyCatchBlock (src/Infrastructure/Messaging/Mediator/ServiceCollectionExtensions.cs)
- End-of-life runtime: .NET netcoreapp3.0
- Inconsistent naming for the same conceptual attribute type. 'VarianterAttr' appears to be a typo or non-standard abbreviation for 'Variant Attribute', while 'SlicerAttribute' uses a different, potentially domain-specific term ('Slicer') for what is likely the same kind of attribute reference or configuration object within the Product context. Given the presence of 'Variant' and 'Content' as distinct concepts, 'VarianterAttr' is likely a misspelling of 'VariantAttribute' or a confusion with 'SlicerAttribute'.
- Medium CVE: SharpCompress 0.23.0
- redundant comment (src/Infrastructure/Persistence/EventStoreProductRepository.cs)
- redundant comment (src/Infrastructure/Persistence/Mongo/MongoDbProvider.cs)
API surface
- Unchanged — 1 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
CanerPatir/aspnet-core-clean-arch 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 d985326b38dd92fb013d55963eba382e28c476a5 — 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.