Skip to content
CAI
Software that uses CAICheck a score

felixsjoberg/Bank.CleanArchitecture.WebApi

36.3

Weak · 8 November 2026

1.7k

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 7-based banking application backend structured using Clean Architecture and Docker. It provides a Web API for user authentication, account management, and fund transfers, leveraging CQRS with MediatR for command and query handling. The infrastructure layer utilizes Dapper with SQL Server stored procedures for data persistence and implements JWT-based security for role-based access control.

Features

Initial Web API presentation layer with account and transaction endpoints

This change introduces the \BankApplication.Presentation\ layer, establishing the Web API surface for the bank application. It adds controllers for authentication (\/auth\), customer account management (\/Accounts\), and administrator operations (\/admin\), enabling users to register, log in, create accounts, view balances, transfer funds, and manage customer data. The implementation relies on MediatR for command/query handling and Mapster for DTO mapping, with a centralized error handling strategy that maps specific application exceptions to HTTP status codes via an \/error\ endpoint.

BankApplication.Presentation · high confidence

Initial database stored procedures for core banking operations

This change introduces a new set of SQL stored procedures in the \db-StoredProcedures\ directory to support core banking functionality. The additions include procedures for creating customers (\CreateCustomer\), users (\AddUser\), and accounts (\CreateAccount\, \CreateAccountReturnDisposition\), as well as managing account credits (\AddAccountCredit\) and executing fund transfers (\Transfer\). It also provides data retrieval and validation procedures such as \GetAccounts\, \GetAccountById\, \GetUserByEmail\, \IsValidAccount\, and \IsValidTransfer\. These stored procedures define the database-level logic for user onboarding, account management, transaction processing, and data querying.

db-StoredProcedures · high confidence

Behavioural changes

Application layer restructured with CQRS, MediatR, and JWT authentication

The application layer has been refactored to use the CQRS pattern with MediatR, replacing the previous service-based approach. This introduces new command and query handlers for account creation, account retrieval, transaction history, fund transfers, and administrator operations like adding credit and creating new customer accounts. Authentication is now implemented via JWT tokens (using a symmetric key) for user registration and login, replacing the previous mock authentication service. The infrastructure layer now uses Dapper with SQL Server stored procedures for persistence, and dependency injection has been updated to register MediatR and the new repository implementations.

BankApplication.Application, BankApplication.Infrastructure · high confidence

Domain model restructuring and user entity updates

The domain layer has been reorganized by moving entity classes from the Models namespace to Entities, and the User entity has been significantly updated to support authentication and authorization: the primary key changed from an integer to a Guid, the username field was replaced with an Email field, and a Role property was added. Additionally, new aggregates for account transactions, new customer accounts, and transfers were introduced, while relationships between Disposition and User were established to support the new authorization structure.

BankApplication.Domain · high confidence

Removal of legacy authentication controller and application entry point

The \AuthenticationController\ (exposing \/auth/register\ and \/auth/login\ endpoints) and the \Program.cs\ entry point have been deleted from the \BankApplication\ project. This change removes the previous implementation of user registration and login, as well as the application's startup configuration, indicating a structural shift in how the application is bootstrapped and how authentication is handled.

BankApplication · high confidence

Repository restructured to Clean Architecture with .NET 7 and Docker support

The project has been reorganized into a Clean Architecture structure, replacing the previous solution layout with distinct layers: Domain, Application, Infrastructure, and Presentation (containing WebApi and Contracts). The application is now built on ASP.NET Core 7 and includes a Dockerfile and docker-compose configuration to run the backend alongside an Azure SQL Edge database. The solution also introduces JWT authentication, role-based authorization, and CQRS via MediatR, while disabling specific nullable reference type warnings in the editor configuration.

(repo-wide) · high confidence

Dependencies

Introduces JWT authentication, CQRS/MediatR, and mapping libraries

The project dependencies have been expanded to support new architectural patterns and security features. The WebApi and Application layers now include MediatR (v11.1.0) and Mapster (v7.3.0) to enable CQRS and object mapping, while the Infrastructure layer adds System.IdentityModel.Tokens.Jwt and Microsoft.AspNetCore.Authentication.JwtBearer to implement JWT-based authentication. Additionally, Azure.Identity and Swashbuckle.AspNetCore.Filters were added to the WebApi, and Microsoft.Extensions.Configuration.UserSecrets was added to the Application layer to support local secret management.

(dependencies) · high confidence

Housekeeping

Cleanup of generated build artifacts

This change removes generated build and NuGet cache files (such as \obj/\ and \bin/\ contents) from the \BankApplication.Contracts\ project directory. These files are automatically regenerated during the build process and should not be committed to version control, so their removal helps keep the repository clean and prevents merge conflicts.

BankApplication.Contracts · 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 38 → 36 (-1.5)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 84 → 84 (+0.0)
  • Architecture 86 → 86 (+0.0)
  • Maturity 58 → 62 (+4.4)
  • Readiness 9 → 11 (+2.2)
  • Security 49 → 46 (-2.4)
  • Domain Modelling 56 (new)
  • Event-Driven 100 → 100 (+0.0)
  • Performance 100 → 100 (+0.0)

Resolved (20)

  • Documentation: no usage examples (README.md)
  • Duplicate Intent: The CustomerAccount nested type in NewCustomerAccountRequest contains the same fields (AccountTypesId, Frequency) as the standalone CreateAccountRequest. This suggests that account creation logic is duplicated across different request flows (admin new customer vs. direct account creation).
  • End-of-life runtime: .NET net7.0 (BankApplication.Infrastructure/BankApplication.Infrastructure.csproj)
  • Inconsistent Naming for Account Identifiers: In AccountTransactionsResponse, the account is identified by 'AccountId' (int in constructor, string in property). In TransferResponse, accounts are identified by 'SenderAccount' (string) and 'RetrieverAccount' (int). The type mismatch (int vs string) for the same conceptual entity (Account ID) across response types is confusing.
  • Properties 'Emailaddress', 'Telephonenumber', and 'Telephonecountrycode' are concatenated single words, while other properties like 'CountryCode', 'Givenname' (in parameter), 'Surname', 'City' follow standard casing. 'Givenname' is also concatenated. This indicates an inconsistent approach to naming multi-word properties.
  • Redundant Request Types: Similar to above, two request types exist for fetching transactions. One is AccountId-only, the other is UserId+AccountId. This creates confusion about which type to use for which endpoint or context.
  • Redundant Request Types: Two distinct request types exist for creating an account. One lacks UserId (likely for admin context), the other includes it. This forces consumers to choose between two nearly identical DTOs based on implicit context rather than explicit API design.
  • Redundant Request Types: Two request types exist for transfers. One lacks UserId, the other includes it. This inconsistency mirrors the pattern seen in CreateAccount and GetTransactions, suggesting a systemic lack of unified request modeling.
  • The namespace and assembly prefix for persistence-related infrastructure is spelled 'Presistence' instead of 'Persistence'. This spelling error is repeated across multiple repository types and the namespace itself.
  • The property/parameter name 'Telephonenumber' (and 'Telephonecountrycode') uses a concatenated camelCase style for a multi-word concept, whereas other similar properties in the same models use separate words or standard casing (e.g., 'Emailaddress' is also concatenated, but 'CountryCode' is not). More critically, 'Telephonenumber' is inconsistent with standard naming conventions for multi-word identifiers which typically use PascalCase for properties (TelephoneNumber) or camelCase with separators if not a single compound word. However, the primary inconsistency is between 'Telephonenumber' and 'Telephonecountrycode' vs 'CountryCode'. 'CountryCode' is two words, 'Telephonenumber' is one. This suggests a lack of consistent tokenization for multi-word identifiers.
  • The word 'Administrator' is consistently misspelled as 'Adminstrator' across namespaces, types, controllers, and repositories. While consistent internally, this is a spelling error in the codebase vocabulary.
  • Vulnerable: Azure.Identity
  • Vulnerable: System.Data.SqlClient
  • Vulnerable: System.IdentityModel.Tokens.Jwt
  • XML-doc coverage: BankApplication.Application (BankApplication.Application/BankApplication.Application.csproj)
  • XML-doc coverage: BankApplication.Contracts (BankApplication.Presentation/BankApplication.Contracts/BankApplication.Contracts.csproj)
  • XML-doc coverage: BankApplication.Domain (BankApplication.Domain/BankApplication.Domain.csproj)
  • XML-doc coverage: BankApplication.Infrastructure (BankApplication.Infrastructure/BankApplication.Infrastructure.csproj)
  • XML-doc coverage: BankApplication.WebApi (BankApplication.Presentation/BankApplication.WebApi/BankApplication.WebApi.csproj)
  • misleading comment (BankApplication.Application/Authentication/Commands/Register/RegisterCommandHandler.cs)

New (5)

  • End-of-life runtime: .NET net7.0 (BankApplication.Application/BankApplication.Application.csproj)
  • End-of-life runtime: .NET net7.0 (BankApplication.Domain/BankApplication.Domain.csproj)
  • End-of-life runtime: .NET net7.0 (BankApplication.Infrastructure/BankApplication.Infrastructure.csproj)
  • End-of-life runtime: .NET net7.0 (BankApplication.Presentation/BankApplication.Contracts/BankApplication.Contracts.csproj)
  • End-of-life runtime: .NET net7.0 (BankApplication.Presentation/BankApplication.WebApi/BankApplication.WebApi.csproj)

API surface

  • Unchanged — 8 HTTP endpoints

Architecture

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

felixsjoberg/Bank.CleanArchitecture.WebApi 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 6942c1048ba12ed742daf6de05c46f40f68d0498 — 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.