Skip to content
CAI
Software that uses CAICheck a score

mehdihadeli/vertical-slice-api-template

56.8

Weak · 8 November 2026

11.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 10-based vertical slice template designed to scaffold microservices with a focus on clean architecture and domain-driven design. It provides foundational infrastructure for product catalog management, including CQRS command/query handling, event-driven messaging via Wolverine, and data persistence with EF Core and PostgreSQL. The framework also integrates comprehensive observability through OpenTelemetry, caching strategies with Redis, and automated API client generation using Kiota.

How it got here

2023 — .NET 10 migration and vertical slice scaffolding

14 changes.

The project upgraded to .NET 10 and the Microsoft Testing Platform while centralizing dependency management and enforcing code quality via Husky hooks. Concurrently, the Vertical Slice Template was scaffolded with a complete Products module, including EF Core data access, CQRS handlers, minimal API endpoints, and shared infrastructure for caching, messaging, and observability.

2024–2026 — Dev container and Aspire infrastructure setup

4 changes.

This period focused on establishing the local development environment by introducing a standardized .NET 10 dev container and initial Aspire application host infrastructure. It also involved generating a new Kiota-based API client for the Catalogs service and adding corresponding integration and contract tests to ensure reliability.

Features

Added Aspire application host and service defaults for local development

This change introduces the initial Aspire infrastructure for the Vertical Slice Template, including an AppHost that configures PostgreSQL 17 and RabbitMQ 4-management containers, and a ServiceDefaults library that sets up OpenTelemetry observability, default health checks, HTTP logging, and service discovery. It also adds build scripts to automate version calculation and release preparation using NBGV.

scripts, src/Aspire · high confidence

Added paginated product listing API endpoint

Introduced a new v1 API endpoint for retrieving products with pagination support. This change adds the necessary CQRS components (query, handler, validator) and the minimal API route to fetch a paginated list of products, applying sorting and filtering via Sieve before returning the results as DTOs.

src/App/Vertical.Slice.Template/Products/Features/GettingProductsByPage · high confidence

Added product creation and retrieval features with validation and caching

The template now includes the \CreateProduct\ command and \GetProductById\ query within the Products vertical slice. The creation flow validates input via FluentValidation, generates IDs using \IdGenerator.NewId()\, persists the product, and publishes both a domain event (\ProductCreatedDomainEvent\) and an integration event (\ProductCreatedIntegrationEventV1\). The retrieval flow uses a read model, applies caching via \CacheQuery\, and returns a DTO, with the underlying database executor registered in the handler.

Vertical.Slice.Template · high confidence

Adds shared caching abstractions and hybrid cache implementation

Introduces a new caching layer in the shared abstractions, providing interfaces for a hybrid cache service (local and distributed) and Redis Pub/Sub messaging. This includes pipeline behaviors for the Mediator library to automatically cache query responses and invalidate cache entries based on command execution, along with configuration options for serialization types (JSON or MessagePack) and Redis connection settings.

src/Shared · high confidence

Generated Kiota-based API client for the Catalogs service

A new API client implementation using Microsoft Kiota has been added to the ApiClients layer, providing a type-safe, fluent interface for interacting with the Catalogs service. This generated code covers the v1 product endpoints, enabling users to create products, retrieve products by ID, and fetch paginated product lists with filtering and sorting. The client includes strongly-typed request and response models (such as CreateProductRequest and GetProductsByPageResponse) and handles JSON serialization and deserialization automatically, offering an alternative to the existing NSwag-generated clients.

src/ApiClients, src/App/Vertical.Slice.Template/Shared/Clients · high confidence

Initial Product module scaffolding with EF Core, Sieve, and Mapperly

The Products vertical slice is now scaffolded with a complete data and API layer. Entity Framework Core configuration defines the Product table schema, while a Sieve configuration enables filtering and sorting on product read models. Mapping between domain entities, DTOs, and read models is handled by Mapperly, and the API endpoints for creating, retrieving by ID, and paginating products are registered under versioned routes.

src/App/Vertical.Slice.Template/Products · high confidence

Initial database schema and data access layer for the Catalogs module

This change introduces the foundational data access components for the Catalogs vertical slice within the template. It adds an Entity Framework Core migration that creates a 'products' table in the 'catalog' schema, including columns for id, name, description, price, and category\_id. The update also provides the corresponding DbContext, a generic repository implementation, a design-time factory for tooling support, and a migration schema executor to apply database changes. Additionally, the CatalogsDbContext has been refactored to inherit from a base EF context class and moved into the shared data structure.

src/App/Vertical.Slice.Template/Shared/Data · high confidence

Initial dev container configuration for .NET 10 development

Developers can now start the project in a standardized VS Code dev container environment. The configuration targets .NET 10.0.100 and includes the GitHub CLI, PowerShell, Node.js, and Git. It pre-installs a curated set of VS Code extensions (including C\# Dev Kit, CSharpier, and SonarLint) and applies specific editor settings such as format-on-save and the MesloLGM Nerd Font. The container also runs a post-create script to ensure the required fonts are installed locally.

.devcontainer · high confidence

Introduce minimal API endpoints for product creation and retrieval

The product feature now exposes HTTP endpoints for creating and fetching products using ASP.NET Core minimal APIs. The new CreateProduct endpoint accepts a POST request to create a product and returns a 201 Created response with the new ID, while the GetProductById endpoint handles GET requests to retrieve product details by ID. These endpoints utilize the Mediator pattern to dispatch commands and queries, replacing previous abstraction layers with direct minimal API handlers.

src/App/Vertical.Slice.Template/Products/Features/CreatingProduct · high confidence

Introduce shared domain primitives and messaging abstractions

The Shared library now provides foundational building blocks for domain-driven design and messaging. This includes new abstractions for domain events (IDomainEvent, IEvent) and integration events (IIntegrationEvent, IMessage) that leverage the Mediator library's INotification interface. It also introduces core domain primitives such as Identity, Entity, and Aggregate base classes to manage state, versioning, and uncommitted domain events, along with AuditableEntity and AuditAggregate for tracking modifications. Additionally, a generic PageList class is added to support standardized pagination across the application.

Shared · high confidence

New shared infrastructure and client wiring in the template

The template now includes a new shared layer that centralizes application setup. It adds OpenTelemetry instrumentation (Meter and ActivitySource) for observability. The \CatalogsConfigurations\ class provides a unified entry point to register and map the Catalogs module endpoints. A new \WebApplicationBuilderExtensions\ suite configures the application's infrastructure, including dependency injection for multiple HTTP client strategies (REST, Connected Service, and Kiota) with resilience and validation, registers the Mediator source generator instead of MediatR, sets up Wolverine for event bus messaging, and configures standard middleware such as authentication, authorization, header propagation, caching, and rate limiting. Storage is configured to support both in-memory and PostgreSQL backends via \CatalogsDbContext\.

src/App/Vertical.Slice.Template/Shared/Extensions · high confidence

Removals

Removal of product creation and retrieval endpoints

The product creation and single-product retrieval features have been removed from the API. Specifically, the \POST /api/products\ endpoint for creating products and the \GET /api/products/{id}\ endpoint for fetching a product by ID are no longer available, along with their associated MediatR handlers, validators, and request/response models.

src/Catalogs/Products/Features/CreatingProduct, src/Catalogs/Products/Features/GettingProductById · high confidence

Behavioural changes

API project restructured and upgraded to .NET 10

The API project has been migrated to .NET 10, evidenced by the new Dockerfiles targeting the \dotnet/aspnet:10.0-alpine\ base image and the SDK. The project structure has been reorganized under \src/App/Vertical.Slice.Template.Api\, including new solution, configuration, and launch settings files. The application entry point (\Program.cs\) now initializes service defaults, registers infrastructure and catalog services, and conditionally enables OpenAPI documentation. Additionally, development tooling has been added with VS Code launch and task configurations to support local debugging and Docker-based builds.

src/App/Vertical.Slice.Template.Api · high confidence

Automated code quality and build checks via Husky hooks

The repository now enforces code formatting, style, and analyzer rules before commits are accepted, and runs builds and tests before pushes. Specifically, the pre-commit hook executes C\# formatting (CSharpier), style verification, and analyzer checks on the solution, blocking commits that introduce violations. The pre-push hook triggers a Release build and runs the test suite, ensuring that only passing code is pushed to the remote repository.

.husky · high confidence

Upgrade to .NET 10 and Microsoft Testing Platform

The project now targets .NET 10.0, requiring the .NET 10 SDK to build and run. The test runner has switched to the Microsoft Testing Platform, as configured in global.json, and the solution structure has been updated to support this new testing infrastructure alongside the upgraded framework.

(repo-wide) · high confidence

Test coverage

Added integration and contract tests for Catalogs API clients; Removed placeholder unit test file.

Dependencies

Upgrade to .NET 10 and centralize dependency management

The project has been upgraded from .NET 7 to .NET 10, with the Aspire AppHost and Service Defaults projects now targeting net10.0. To support this, the solution now uses central package management via Directory.Packages.props, moving version definitions out of individual .csproj files. This change also introduces new API client generation capabilities using NSwag Connected Services and Kiota, adds WolverineFx for messaging, and migrates the test suite to xUnit v3.

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

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

Lenses

  • Code Health 58 → 59 (+0.8)
  • Architecture 81 → 76 (-4.8)
  • Maturity 77 → 80 (+3.7)
  • Readiness 51 → 57 (+5.2)
  • Security 50 → 51 (+0.6)
  • Domain Modelling 67 → 67 (+0.0)
  • Event-Driven 68 → 83 (+15.6)
  • Performance 74 → 77 (+3.5)

Resolved (43)

  • CRAP 110: DefaultProblemDetailMapper.GetMappedStatusCodes (src/Shared/Web/ProblemDetail/DefaultProblemDetailMapper.cs)
  • CRAP 210: ModuleExtensions.AddModulesServices (src/Shared/Web/Minimal/Extensions/ModuleExtensions.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Products/Features/CreatingProduct/v1/CreateProductEndpoint.cs (src/App/Vertical.Slice.Template/Products/Features/CreatingProduct/v1/CreateProductEndpoint.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Products/Features/GettingProductById/v1/GetProductById.cs (src/App/Vertical.Slice.Template/Products/Features/GettingProductById/v1/GetProductById.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Products/Features/GettingProductById/v1/GetProductByIdEndpoint.cs (src/App/Vertical.Slice.Template/Products/Features/GettingProductById/v1/GetProductByIdEndpoint.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Products/Features/GettingProductsByPage/v1/GetProductsByPage.cs (src/App/Vertical.Slice.Template/Products/Features/GettingProductsByPage/v1/GetProductsByPage.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Products/Features/GettingProductsByPage/v1/GetProductsByPageEndpoint.cs (src/App/Vertical.Slice.Template/Products/Features/GettingProductsByPage/v1/GetProductsByPageEndpoint.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Products/ProductConfigurations.cs (src/App/Vertical.Slice.Template/Products/ProductConfigurations.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Shared/CatalogsConfigurations.cs (src/App/Vertical.Slice.Template/Shared/CatalogsConfigurations.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Shared/Clients/ConnectedService/CatalogsConnectedServiceClient.cs (src/App/Vertical.Slice.Template/Shared/Clients/ConnectedService/CatalogsConnectedServiceClient.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Shared/Clients/Kiota/CatalogsKiotaClient.cs (src/App/Vertical.Slice.Template/Shared/Clients/Kiota/CatalogsKiotaClient.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Shared/Data/CatalogsMigrationSchema.cs (src/App/Vertical.Slice.Template/Shared/Data/CatalogsMigrationSchema.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationBuilderExtensions/WebApplicationBuilderExtensions.ProblemDetails.cs (src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationBuilderExtensions/WebApplicationBuilderExtensions.ProblemDetails.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationBuilderExtensions/WebApplicationBuilderExtensions.Storage.cs (src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationBuilderExtensions/WebApplicationBuilderExtensions.Storage.cs)
  • Low coverage: src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationExtensions/WebApplicationExtensions.Infrastructure.cs (src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationExtensions/WebApplicationExtensions.Infrastructure.cs)
  • Low coverage: src/Shared/Cache/CacheQuery.cs (src/Shared/Cache/CacheQuery.cs)
  • Low coverage: src/Shared/Core/Persistence/DataSeedWorker.cs (src/Shared/Core/Persistence/DataSeedWorker.cs)
  • Low coverage: src/Shared/Core/Persistence/DataSeederManager.cs (src/Shared/Core/Persistence/DataSeederManager.cs)
  • Low coverage: src/Shared/Core/Persistence/MigrationManager.cs (src/Shared/Core/Persistence/MigrationManager.cs)
  • Low coverage: src/Shared/Core/Persistence/MigrationWorker.cs (src/Shared/Core/Persistence/MigrationWorker.cs)
  • …and 23 more

New (20)

  • CRAP 162: ModuleExtensions.AddModulesServices (src/Shared/Web/Minimal/Extensions/ModuleExtensions.cs)
  • CRAP 72: QueryCollectionExtensions.IsValidJson (src/Shared/Web/Extensions/QueryCollectionExtensions.cs)
  • Flaky test: Vertical.Slice.Template.ClientsTests::Vertical.Slice.Template.ConnectedServiceClientsTests.RestClient.CatalogRestClientTests.get product by id can get product with valid data
  • Medium: security finding (details withheld)
  • Projects may be oversized for their cohesion (src/Shared/Shared.csproj)
  • Split Shared (src/Shared/Shared.csproj)
  • doc comments repeat the names (src/App/Vertical.Slice.Template/Shared/Clients/ICatalogsClient.cs)
  • doc comments repeat the names (src/Shared/Abstractions/Core/Domain/Events/IEvent.cs)
  • doc comments repeat the names (tests/Shared/Tests.Shared/Extensions/HttpResponseMessageExtensions.cs)
  • redundant comment (src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationBuilderExtensions/WebApplicationBuilderExtensions.HttpClient.cs)
  • redundant comment (src/App/Vertical.Slice.Template/Shared/Extensions/WebApplicationExtensions/WebApplicationExtensions.Infrastructure.cs)
  • redundant comment (src/Shared/Core/Extensions/AssemblyExtensions.cs)
  • redundant comment (src/Shared/Diagnostics/ActivityExtensions.cs)
  • redundant comment (src/Shared/Diagnostics/ActivityExtensions.cs)
  • redundant comment (src/Shared/OpenApi/AspnetOpenApi/EnumSchemaTransformer.cs)
  • redundant comment (src/Shared/OpenApi/AspnetOpenApi/EnumSchemaTransformer.cs)
  • redundant comment (src/Shared/OpenApi/Swashbuckle/EnumSchemaFilter.cs)
  • redundant comment (src/Shared/OpenApi/Swashbuckle/EnumSchemaFilter.cs)
  • redundant comment (src/Shared/OpenApi/Swashbuckle/Extensions/DependencyInjectionExtensions.cs)
  • redundant comment (src/Shared/Resiliency/DependencyInjectionExtensions.cs)

API surface

  • Unchanged — 3 HTTP endpoints

Architecture

  • Unchanged — 5 containers · 2 contexts · 1 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

mehdihadeli/vertical-slice-api-template 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 be0da196411b5d8174aa2b435b55902f6b4021a7 — 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.