Skip to content
CAI
Software that uses CAICheck a score

sanjyotagureddy/aspnetrun-microservices

57.4

Adequate · 8 November 2026

10.6k

lines of production code

C#

primary language

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET 10 microservices platform for e-commerce operations, orchestrating products, inventory, carts, orders, and discounts through a YARP API gateway. It implements a domain-driven architecture with broker-agnostic Kafka messaging, transactional outbox patterns, and gRPC communication to ensure reliable event-driven interactions between services. The platform provides comprehensive observability via OpenTelemetry and structured logging with payload protection, supported by a shared kernel for common abstractions like auditing and validation.

How it got here

2021 — Initial .NET 10 microservices scaffolding

3 changes.

The project was initialized as a .NET 10 microservices platform, establishing a complete architecture with an Aspire AppHost, YARP API Gateway, and core services for products, cart, orders, and inventory. This period focused on setting up the foundational infrastructure, including centralized observability, broker-agnostic messaging with the outbox pattern, and containerized service definitions. The work also involved upgrading dependencies to .NET 10 and Aspire 13.4 to support the new distributed system.

2026 — Shared kernel and microservice expansion

9 changes.

This period focused on establishing a robust shared kernel with standardized logging, broker-agnostic messaging, and architectural primitives to support the growing microservices ecosystem. Concurrently, new domain capabilities were introduced in the Product and Inventory services, while comprehensive API endpoints for Cart and Order management were implemented to handle core business workflows.

Features

Automated Windows hosts file management for local microservices

A new PowerShell script (update-hosts.ps1) is introduced to automatically configure the local hosts file for the microservices environment. The script requires administrator privileges, backs up the existing hosts file, and injects entries for services such as the API gateway, product, basket, ordering, and various infrastructure components (RabbitMQ, PostgreSQL, OpenSearch) under the aspnetrun.local domain. This simplifies local development setup by ensuring DNS resolution for all internal services is handled programmatically.

scripts · high confidence

Initial repository scaffolding for .NET 10 microservices platform

The repository has been initialized with a complete project structure for an ASP.NET Core microservices application targeting .NET 10. This includes an Aspire AppHost for orchestrating local resources (PostgreSQL, Kafka), a YARP-based API Gateway, and service projects for Products, Cart, Order, Inventory, and a Discount gRPC service. The codebase introduces a shared kernel with broker-agnostic messaging contracts, a transactional outbox pattern for reliable event publishing, and centralized logging/observability via OpenTelemetry and Serilog. Documentation has been added to guide local development, including a Postman collection for API testing and a detailed README outlining the current architecture, prerequisites, and build/test instructions.

(repo-wide) · high confidence

Introduce YARP Gateway, Cart, Discount, and Inventory microservices with unified observability and messaging

This change adds four new service components to the platform: a YARP-based API Gateway that routes traffic to products, inventory, cart, and orders; a Cart API backed by Redis for distributed caching and integrated with a gRPC Discount client; a Discount gRPC service using SQLite for coupon management; and an Inventory API for tracking stock levels. All services are containerized with .NET 10 Dockerfiles and share a standardized observability stack, including AppCallContext middleware for correlation/tenant tracking, request logging with payload protection and redaction, and a broker-agnostic messaging architecture with contract versioning (e.g., cart checkout and inventory initialized events).

src/Services · high confidence

Introduce broker-agnostic messaging abstraction with Kafka implementation

The \Common.SharedKernel.Messaging\ library now provides a unified, broker-agnostic messaging architecture. It defines core abstractions for publishing and consuming messages (\IMessageBus\, \IMessageConsumer\, \IMessageProducer\), handling contracts with versioning and upcasting (\IContractAwareMessageHandler\, \IMessageUpcaster\), and managing destination provisioning (\IDestinationProvisioner\). A concrete Kafka implementation is included, featuring automatic topic creation and reconciliation, contract compatibility checks, and retry policies. The library integrates with dependency injection via \AddMessaging\ and \UseKafka\ extensions, allowing services to register destinations and configure serialization, while a hosted service validates configuration and provisions topics at startup.

src/Shared/Common.SharedKernel.Messaging · high confidence

Introduce cart and order management APIs

This change introduces the API surface for cart and order management. For carts, it adds endpoints to get, update, and delete a shopping cart, as well as a checkout endpoint that publishes a checkout event and clears the cart. For orders, it adds endpoints to create an order, retrieve orders by user name, retrieve a specific order by ID, and cancel an order. These endpoints wire up MediatR handlers that interact with repositories and, for cart updates, a gRPC discount service.

src/Services/Cart/Cart.Api/Features/Cart, src/Services/Order/Order.Api/Features/Orders · high confidence

Introduce shared architectural primitives and web infrastructure

The Common.SharedKernel library now provides foundational building blocks for the application, including base types for entities, value objects, and auditing, as well as contracts for domain and integration events. It adds a result-pattern for handling operation outcomes, a validation pipeline behavior for MediatR requests, and a guard helper for input validation. For web services, it introduces a dynamic endpoint discovery mechanism that respects environment-based scopes (Development, UAT, Production) and integrates Swagger UI with support for both JWT Bearer and Keycloak OAuth2 authentication flows.

src/Shared/Common.SharedKernel · high confidence

Introduce shared kernel abstractions for logging, messaging, auditing, and domain events

The Shared project now provides a set of foundational building blocks for application development. A new \LogEntry\ record standardizes structured logging data, while \MessageEnvelope\<T\>\ establishes a contract for broker-agnostic messaging with support for correlation, causation, and tenant context. Additionally, \AuditableEntity\ simplifies the implementation of audit trails by tracking creation and update timestamps and users, and \DomainEvent\ provides a base type for domain-driven event handling.

Shared · high confidence

Inventory service introduces domain events for stock initialization

The Inventory microservice now emits an \inventory.initialized\ domain event whenever an inventory item is initialized with a specific stock quantity. This change adds the \InventoryInitializedDomainEvent\ record and integrates event raising into the \InventoryItem\ domain entity, enabling downstream systems to react to initial stock setup events.

Inventory · high confidence

New structured logging library with payload protection and OpenSearch integration

The \Common.SharedKernel.Logging\ package introduces a comprehensive, structured logging system that replaces previous ad-hoc approaches. It provides a typed API for emitting Trace, API, and Error logs, enriched with correlation, trace, tenant, and user context. A key capability is the payload protection pipeline, which automatically masks or hashes sensitive data in request/response bodies and headers before they are persisted, with configurable failure behaviors. The library supports multiple sinks, including Console (text/JSON), File, and Elasticsearch/OpenSearch, with specific index prefixes for application, messaging, audit, security, and payload logs. It also includes a built-in HTTP request logging middleware that captures request/response details, durations, and status codes, integrating seamlessly with the payload protection and enrichment features.

src/Shared/Common.SharedKernel.Logging · high confidence

Product service introduces domain events for creation, update, and deletion

The Product service now emits domain events when a product is created, updated, or deleted. New domain event records (ProductCreatedDomainEvent, ProductUpdatedDomainEvent, ProductDeletedDomainEvent) are defined in the domain layer, and the Product entity exposes methods to raise these events, capturing details such as product ID, name, SKU, price, and timestamps. This change supports downstream processing of product lifecycle changes, likely integrating with an outbox pattern for reliable event delivery.

Services · high confidence

Test coverage

Added integration and unit tests for logging, messaging, inventory, and cart services

Added comprehensive test coverage for the shared logging pipeline, Kafka-based messaging with Postgres outbox, the new Inventory microservice persistence, and Cart API business logic. The changes include integration tests verifying that log entries are dispatched to configured sinks, that messages are correctly published to Kafka with proper envelopes and headers, and that the outbox publisher reliably marks rows as published or failed with retry logic. Inventory tests confirm that the Postgres schema initializer creates the required tables and indexes and that the inventory store correctly persists and queries stock data. Cart unit tests validate core shopping cart operations including retrieving, updating, and deleting carts, as well as the checkout flow which publishes integration events and clears the cart. Supporting test infrastructure includes Docker-based fixtures for Kafka and Postgres, recording loggers, and code coverage configurations.

tests · high confidence

Dependencies

Upgrade to .NET 10 and adopt Aspire 13.4 with centralized package management

The project has been upgraded to target .NET 10.0 across all services, shared kernels, and test projects. It now uses Aspire 13.4.2 for hosting and orchestration, introducing centralized package version management via Directory.Packages.props. Key dependencies include Grpc.AspNetCore 2.80.0, MediatR 14.1.0, FluentValidation 12.1.1, and OpenTelemetry 1.16.0, while test infrastructure has been updated to use xUnit v3 and the Microsoft Testing Platform.

(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

Score

  • CAI 54 → 57 (+3.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 77 → 77 (-0.0)
  • Architecture 78 → 76 (-1.5)
  • Maturity 59 → 73 (+13.2)
  • Readiness 50 → 61 (+11.1)
  • Security 49 → 48 (-0.5)
  • Domain Modelling 81 → 81 (+0.0)
  • Event-Driven 100 → 100 (+0.0)
  • Performance 63 → 60 (-2.9)

Resolved (13)

  • ADR has no Decision section (src/Shared/Common.SharedKernel.Logging/docs/ADR-0001-lightweight-logging-hardening.md)
  • No context/problem framing or consequences/trade-offs for each checklist item (src/Shared/Common.SharedKernel.Logging/docs/ADR-0002-Implementation-Checklist.md)
  • Vulnerable: MessagePack
  • XML-doc coverage: Cart.Api (src/Services/Cart/Cart.Api/Cart.Api.csproj)
  • XML-doc coverage: Common.SharedKernel (src/Shared/Common.SharedKernel/Common.SharedKernel.csproj)
  • XML-doc coverage: Common.SharedKernel.Logging (src/Shared/Common.SharedKernel.Logging/Common.SharedKernel.Logging.csproj)
  • XML-doc coverage: Common.SharedKernel.Messaging (src/Shared/Common.SharedKernel.Messaging/Common.SharedKernel.Messaging.csproj)
  • XML-doc coverage: Discount.Grpc (src/Services/Discount/Discount.Grpc/Discount.Grpc.csproj)
  • XML-doc coverage: Gateway.Yarp (src/Gateway/Gateway.Yarp/Gateway.Yarp.csproj)
  • XML-doc coverage: Inventory.Api (src/Services/Inventory/Inventory.Api/Inventory.Api.csproj)
  • XML-doc coverage: Order.Api (src/Services/Order/Order.Api/Order.Api.csproj)
  • XML-doc coverage: Products.Api (src/Services/Product/Products.Api/Products.Api.csproj)
  • XML-doc coverage: aspnetrun-microservices.ServiceDefaults (src/aspire/aspnetrun-microservices.ServiceDefaults/aspnetrun-microservices.ServiceDefaults.csproj)

New (1)

  • ADR declares no status (src/Shared/Common.SharedKernel.Logging/docs/ADR-0002-Implementation-Checklist.md)

API surface

  • Unchanged — 9 HTTP endpoints

Architecture

  • Unchanged — 10 containers · 3 contexts · 2 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

sanjyotagureddy/aspnetrun-microservices 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 b5aebdbade0938f4ed1a34accd16deb27ce0887e — 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.