Skip to content
CAI
Software that uses CAICheck a score

Amitpnk/Onion-architecture-ASP.NET-Core

59.7

Adequate · 21 September 2026

1.5k

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-based Onion Architecture template that provides a structured foundation for building applications with distinct layers for domain, infrastructure, persistence, and services. It includes built-in support for user authentication, customer management, and email services, along with health check endpoints and automated testing scaffolding. The project is designed to be packaged and distributed as a Visual Studio extension, offering a standardized starting point for .NET 8 development.

Features

Added Visual Studio extension template scaffolding and build configuration

The OATemplate project now includes the full set of files required to package and distribute a Visual Studio extension. This includes the VSIX manifest (source.extension.vsixmanifest) defining the 'Onion Architecture' template, the template pack build script (templatepack.OATemplate.proj) for generating the NuGet package, and the MSBuild targets (wafflebuilder.targets) that automate the creation of VSIX and template zips. Additionally, the project now provides a standard HTML/CSS help page (index.html, stylesheet.css) and a pkgdef registration file (template.pkgdef) to ensure the template is correctly installed and registered in Visual Studio.

src/OATemplate · high confidence

Added template configuration and solution file for the Onion Architecture template

The template metadata and solution structure for the 'Onion Architecture' (OA) template have been added. This includes \template.json\ and \template.vstemplate\ files that define the template's identity, description, and project structure, along with the \OA.sln\ solution file that references the main project and its sub-projects (Domain, Infrastructure, Persistence, Service, and Test projects).

src/.template.config · high confidence

Centralized infrastructure configuration and mapping setup

The infrastructure layer now provides a consolidated set of extension methods to configure the application's core services. This includes registering the Entity Framework Core \ApplicationDbContext\ (supporting both in-memory and SQL Server backends), setting up AutoMapper for \CustomerModel\ to \Customer\ entity mapping, and configuring Swagger/OpenAPI documentation with JWT security schemes. Additionally, it adds health check endpoints (\/healthz\, \/healthcheck\, \/healthcheck-ui\) and registers transient services like \DateTimeService\ and \AccountService\.

src/OA.Infrastructure · high confidence

Initial release of the Onion Architecture template

The repository now includes the full source code for the Onion Architecture template, organized into a solution with projects for Domain, Infrastructure, Persistence, Service, and Unit/Integration tests. The project utilizes .NET Core, Entity Framework Core, AutoMapper, and Serilog for logging. It also includes a CHANGELOG.md documenting the initial release and subsequent versions, along with a Code of Conduct and a .gitignore file updated to exclude health check database files.

(repo-wide) · high confidence

Introduce customer management commands and queries

Added new MediatR-based commands (Create, Update, Delete) and queries (GetAll, GetById) for the Customer entity. This provides the backend logic for creating, modifying, and retrieving customer records, utilizing the primary constructor syntax and file-scoped namespaces for cleaner code structure.

src/OA.Service/Features/CustomerFeatures · high confidence

Introduced EF Core persistence layer and identity seed data

Added the \ApplicationDbContext\ and \IApplicationDbContext\ interface to manage the primary database context for entities like Customers, Orders, and Products. Additionally, introduced an \IdentityContext\ to handle ASP.NET Core Identity tables, configuring them in a dedicated 'Identity' schema. To support initial setup, added seed data classes (\DefaultRoles\, \DefaultUser\, \MappingUserRole\) that populate default roles and a super-admin user upon database initialization.

src/OA.Persistence · high confidence

Introduces domain models for authentication, configuration, and core entities

The domain layer now includes new classes for authentication (ApplicationUser, AuthenticationRequest/Response, RefreshToken, and request DTOs for login, registration, and password management), a generic Response wrapper, a BaseEntity base class, and settings classes for JWT, mail, and application details. These additions provide the foundational data structures and configuration models required for user identity, token management, and system settings.

src/OA.Domain · high confidence

New API controllers for account, customer, mail, and meta endpoints

The application now exposes new HTTP endpoints for account management (authenticate, register, confirm email, forgot/reset password), customer CRUD operations (create, read, update, delete), email sending, and system information retrieval. These controllers implement the core business logic for user authentication, customer data management, and system metadata, utilizing dependency injection for services like IAccountService, IMediator, and IEmailService.

src/OA/Controllers · high confidence

Behavioural changes

Added custom exception middleware and domain-specific exception types

The service layer now includes a custom exception middleware that intercepts unhandled exceptions and maps them to appropriate HTTP status codes and JSON error responses. Specific exception types such as ValidationException, BadRequestException, NotFoundException, and DeleteFailureException are introduced to handle distinct error scenarios, ensuring consistent error handling across the application.

src/OA.Service · high confidence

Introduce configurable theming and health check endpoints in the OA application

The OA project now supports custom CSS-based theming via a new \custom.css\ file that defines primary, secondary, and background colors for the UI. Additionally, the application's startup configuration in \Program.cs\ has been updated to register health check endpoints (\/healthz\ and \/healthcheck-ui\) and Swagger, allowing users to monitor service status and view API documentation. Configuration for logging, database connections, and feature flags is also explicitly defined in the new \appsettings\ files.

src/OA · medium confidence

Introduced domain entity classes for the OA system

The OA.Domain layer now includes new entity classes for Category, Customer, Order, Product, and Supplier, each inheriting from a base entity and defining their respective properties and relationships.

OA.Domain · high confidence

Test coverage

Added integration tests for Customer API endpoints; Added unit test for database insertion.

Dependencies

Upgrade to .NET 8 and update NuGet packages

All .NET project files in the solution have been upgraded to target .NET 8.0, and the referenced NuGet packages have been updated to their latest compatible versions, including Swashbuckle.AspNetCore, Serilog.Sinks.MSSqlServer, System.IdentityModel.Tokens.Jwt, MailKit, and MimeKit.

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

Lenses

  • Code Health 87 → 87 (-0.0)
  • Architecture 89 → 89 (+0.3)
  • Maturity 64 → 64 (+0.0)
  • Readiness 56 → 56 (+0.5)
  • Security 51 → 56 (+5.0)
  • Accessibility 64 → 64 (+0.0)

Resolved (8)

  • Bounded contexts not declared
  • Build did not complete in the analyzer
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • The README contains a SonarCloud quality gate badge for Bugs but no documentation of how to reproduce or fix them. (README.md)
  • dormant codebase — no living knowledge left to concentrate

New (8)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (10 lines × 4) (src/OA.Domain/Entities/Customer.cs)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • bus factor 1 — one contributor carries this repository
  • misleading comment (src/OA/Program.cs)

API surface

  • Unchanged — 12 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

Amitpnk/Onion-architecture-ASP.NET-Core 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 7b36c72dc718ca1fffd200c487a282df361af859 — 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.