Skip to content
CAI
Software that uses CAICheck a score

nkz-soft/microservice-template

50.9

Weak · 21 September 2026

2.9k

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 microservice template implementing Clean Architecture and Domain-Driven Design, serving as a production-ready scaffold for building scalable applications. It provides a modular infrastructure supporting REST, gRPC, GraphQL, and SignalR presentation layers, backed by PostgreSQL, Redis, and RabbitMQ. The codebase includes comprehensive test coverage and Kubernetes deployment configurations, enabling developers to rapidly bootstrap services with standardized patterns for validation, logging, and distributed event handling.

How it got here

2022 — microservice template and test infrastructure

17 changes.

This period focused on establishing the initial release of the NKZSoft microservice template, implementing a complete architecture with DDD and Clean Architecture patterns across .NET 9. The work included building out the domain models, application layer behaviors, and various presentation layers (REST, gRPC, GraphQL, SignalR) alongside infrastructure for PostgreSQL, Redis, and RabbitMQ. Comprehensive test coverage was added for all components, including unit and integration tests using Docker containers for dependencies.

2023 — gRPC and REST API implementation

4 changes.

This period focused on implementing the gRPC and REST presentation layers, introducing streaming support and structured error handling. The work was complemented by comprehensive integration tests and the addition of Kubernetes deployment configurations via Helm charts.

Features

Add Docker Compose configuration for local development environment

Users can now start the entire application stack locally using Docker Compose. The new configuration defines the application service alongside its dependencies: PostgreSQL (v16), RabbitMQ (v3.13-management), Redis (v7.4), and Jaeger for distributed tracing. The setup includes health checks for all infrastructure services and exposes the necessary ports for development.

deployment/docker · high confidence

Add Helm chart for deploying the template service to Kubernetes

A new Helm chart named 'template-service' has been added to the 'deployment/k8s' directory, enabling users to deploy the application to a Kubernetes cluster. The chart includes templates for the Deployment, Service, Ingress, HorizontalPodAutoscaler, ConfigMap, and Secret, along with helper templates and a test connection pod. Additionally, an infrastructure script is provided to install RabbitMQ, PostgreSQL, and Redis via Helm, and generate the necessary secret for database credentials.

deployment/k8s · high confidence

Add RabbitMQ-based message broker integration with MassTransit

The application now supports asynchronous event-driven communication via RabbitMQ using the MassTransit framework. This change introduces integration event definitions for creating and updating to-do items, alongside corresponding message consumers that process these events. The message broker infrastructure is wired up through service collection extensions that register the consumers and configure the RabbitMQ transport, enabling distributed event handling within the system.

src/NKZSoft.Template.Events, src/NKZSoft.Template.MessageBrokers.RabbitMq · high confidence

Add SignalR real-time presentation layer

The application now supports real-time communication via SignalR. This change introduces a new presentation layer that registers SignalR services and maps the \ToDoItemHub\ endpoint, allowing clients to receive live updates. The startup configuration in \Program.cs\ and global usings have been updated to conditionally include the SignalR extensions, enabling WebSocket-based push notifications alongside the existing REST and gRPC APIs.

src/NKZSoft.Template.Presentation.Starter · high confidence

Adds application-layer infrastructure for validation, logging, and exception handling

The \NKZSoft.Template.Application\ project now includes a comprehensive set of common behaviors and exception types to standardize request processing. This includes pipeline behaviors for validation (\ValidationBehaviour\), performance monitoring (\PerformanceBehaviour\), logging (\LoggingBehaviour\), and unhandled exception handling (\UnhandledExceptionBehaviour\). Additionally, a suite of domain-specific exceptions (e.g., \NotFoundException\, \ValidationException\) and base handler classes for database and streaming operations have been introduced to support the application's command and query handlers.

src/NKZSoft.Template.Application · high confidence

Initial release of the NKZSoft microservice template

The repository now provides a complete microservice template based on DDD and Clean Architecture, targeting .NET 9. The template includes a modular structure with REST, gRPC, GraphQL, and SignalR presentation layers, alongside infrastructure for PostgreSQL, Redis, and RabbitMQ. It also introduces Kubernetes deployment support via Helm charts, OpenTelemetry integration, and a suite of code analyzers and style rules to enforce consistent, high-quality code.

(repo-wide) · high confidence

Introduce PostgreSQL persistence and Redis caching layers

The application now supports a PostgreSQL database and a Redis-based caching layer. For PostgreSQL, the \NKZSoft.Template.Persistence.PostgreSQL\ package provides the \ApplicationDbContext\, repository implementations for \ToDoItem\ and \ToDoList\, and configuration for connection strings and health checks. For caching, the new \NKZSoft.Template.EFCore.Caching.Redis\ package adds second-level caching using Redis, with configuration and validation for Redis connections. Both layers include OpenTelemetry tracing support and are registered via extension methods.

src/NKZSoft.Template.Persistence.PostgreSQL · high confidence

Introduce domain models and events for a To-Do list application

The domain layer now includes the core entities for a To-Do list feature. This adds the \ToDoItem\ and \ToDoList\ aggregate roots, which manage title, note, and item associations. Additionally, new domain events (\ToDoItemCreatedDomainEvent\ and \ToDoItemUpdatedDomainEvent\) are introduced to track changes to these entities, enabling event-driven updates within the application.

src/NKZSoft.Template.Domain/AggregatesModel · high confidence

Introduces foundational domain model base classes and interfaces

The \src/NKZSoft.Template.Domain/Common\ directory now contains the core building blocks for the application's domain layer. This includes \BaseEntity\ and \BaseAuditableEntity\ to provide generic primary key support and automatic audit tracking (created/modified timestamps and users), alongside interfaces (\IEntity\, \IAggregateRoot\, \IBaseAuditableEntity\) to enforce domain patterns. Additionally, the codebase now supports strongly-typed enumerations via the \Enumeration\ class and value objects via the \ValueObject\ base class, enabling consistent equality comparison and value-based identity across the domain model.

src/NKZSoft.Template.Domain/Common · high confidence

New gRPC service for managing TodoItems with streaming support

The gRPC presentation layer now exposes a new \ToDoItemService\ that provides methods to retrieve a single item, fetch a paginated collection, and stream items using \IAsyncEnumerable\. The service is wired up via \ServiceCollectionExtension\ and \EndpointRouteBuilderExtension\, and includes data transfer objects (\ToDoItemDto\, \ErrorResponse\, \ResultResponse\) and mapping configurations to convert between application queries and gRPC responses.

src/NKZSoft.Template.Presentation.Grpc · high confidence

Behavioural changes

REST API error handling and result mapping

The REST presentation layer now implements a structured error handling pipeline. A global exception handler and a custom exception filter attribute work together to catch unhandled exceptions, log them, and return standardized JSON error responses. The \ResultDtoBase\ model and its extensions map internal result states to appropriate HTTP status codes and error details, ensuring consistent API responses for validation, not found, and other error conditions.

src/NKZSoft.Template.Presentation.Rest · high confidence

Test coverage

Add GraphQL integration tests with shared test infrastructure; Added GraphQL service tests for mutations and queries; Added integration tests for gRPC and REST presentation layers; Added test container factory for Postgres, RabbitMQ, and Redis; Added test infrastructure for application layer tests; Added test infrastructure for integration and unit testing; Added tests for SignalR hub integration; Added unit tests for TodoItem commands and queries; Initial test infrastructure for the application layer.

Dependencies

Centralized package version management and .NET 9 upgrade

The project now uses central package management via a new Directory.Packages.props file, which defines the versions for all dependencies including Microsoft.EntityFrameworkCore, HotChocolate, and OpenTelemetry. This change also upgrades the .NET framework to version 9.0.1, updating related packages such as Microsoft.AspNetCore.Mvc.Testing and Microsoft.Extensions.Configuration.Abstractions to their .NET 9 equivalents.

(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

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

Lenses

  • Code Health 86 → 69 (-16.2)
  • Architecture 83 → 83 (+0.0)
  • Maturity 73 → 73 (+0.0)
  • Readiness 37 → 38 (+1.0)
  • Security 65 → 64 (-0.2)
  • Domain Modelling 60 → 53 (-7.0)
  • Event-Driven 100 → 100 (+0.0)

Resolved (21)

  • Bounded contexts not declared
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium IaC: CKV2_GHA_1 (.github/workflows/build-by-tag.yaml)
  • Medium IaC: CKV2_GHA_1 (.github/workflows/cleanup.yaml)
  • Medium IaC: CKV_DOCKER_2 (Dockerfile)
  • Medium IaC: CKV_SECRET_4 (src/NKZSoft.Template.Presentation.Starter/appsettings.Development.json)
  • Medium IaC: CKV_SECRET_4 (src/NKZSoft.Template.Presentation.Starter/appsettings.Docker.json)
  • Medium IaC: CKV_SECRET_4 (src/NKZSoft.Template.Presentation.Starter/bin/Debug/net9.0/appsettings.Development.json)
  • Medium IaC: CKV_SECRET_4 (src/NKZSoft.Template.Presentation.Starter/bin/Debug/net9.0/appsettings.Docker.json)
  • No exposed public API
  • …and 1 more

New (137)

  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • AnalyzerSeverityNone (.editorconfig)
  • …and 117 more

API surface

  • Unchanged — 2 HTTP endpoints

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

Survey your own repository

nkz-soft/microservice-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 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 ff72cc925979a802b933358de9bba12b96f78a4c — 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.