Skip to content
CAI
Software that uses CAICheck a score

meysamhadeli/ecommerce-monolith

48.3

Weak · 8 November 2026

2k

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 an e-commerce monolith built on .NET 10 that manages product catalogs, inventory levels, and customer orders. It exposes capabilities for creating and listing categories and products, tracking stock through add, sell, and damage operations, and processing new orders with automatic inventory deduction and shipping cost calculation. The architecture utilizes CQRS with MediatR and Vertical Slices, backed by a PostgreSQL database with transactional integrity.

Features

Add endpoint to sell products and deduct inventory

A new API endpoint (POST /inventory/sell-product) has been added to allow users to purchase products. This feature validates the request, checks that the product is in stock and has sufficient quantity, deducts the sold amount from the current inventory item, and records the transaction as a new 'Sold' inventory item.

src/ECommerce/Inventories/Features/SellingProduct · high confidence

Add paginated category listing API endpoint

Introduces a new API endpoint at /catalog/get-categories-by-page that allows users to retrieve a paginated list of product categories. The endpoint supports filtering and sorting via query parameters, validates page and page size inputs, and returns the results as a paginated list of category DTOs.

src/ECommerce/Categories/Features/GettingAllCategoriesByPage · high confidence

Add paginated product listing endpoint

Introduces a new API endpoint at /catalog/get-products-by-page that allows users to retrieve a paginated list of products. The endpoint accepts page number, page size, filters, and sort order parameters, validates that these values are at least 1, and returns the requested product data mapped to DTOs.

src/ECommerce/Products/Features/GettingAllProductsByPage · high confidence

Adds database transaction pipeline behavior for MediatR requests

The application now automatically wraps MediatR command and query handlers in a database transaction. A new \EfTxBehavior\ pipeline behavior ensures that changes made by handlers are persisted to the database via \IDbContext.ExecuteTransactionalAsync\, while also providing debug and info-level logging for request handling and execution. This behavior is registered alongside validation and logging behaviors in the custom MediatR configuration.

src/ECommerce/Extensions · high confidence

Initial Orders module structure and data models

This change introduces the foundational structure for the Orders module within the ECommerce application. It adds core data models for \Order\ and \OrderItem\, including their relationships to Customers and Products, as well as enumerations for order status, shipment type, and discount type. Additionally, it defines Data Transfer Objects (DTOs) for API communication, establishes AutoMapper mappings for order registration, and implements specific validation exceptions to handle business rules such as invalid quantities, prices, and inventory checks.

src/ECommerce/Orders · high confidence

Initial database schema and seed data for e-commerce domain

The data layer now includes Entity Framework Core configurations and an initial migration that creates the core e-commerce tables: categories, customers, inventories, products, orders, and order items, along with their relationships and indexes. The database uses PostgreSQL with snake\_case naming conventions. Additionally, a data seeder is provided to populate initial reference data for categories, inventories, products, inventory items, and customers upon first run.

src/ECommerce/Data · high confidence

Initial implementation of the Categories domain module

This change introduces the foundational structure for the Categories feature within the ECommerce application. It defines the core Category model (Id, Name) and establishes a set of validation exceptions to handle business rules, such as duplicate names, invalid IDs, and name length constraints. Additionally, it provides a Data Transfer Object (CategoryDto) and AutoMapper mappings to facilitate the conversion between internal models and API requests/responses for creating and retrieving paginated category lists.

src/ECommerce/Categories · high confidence

Initial inventory data models and validation exceptions

This change introduces the foundational data structures for the inventory module, including the \Inventory\ and \InventoryItems\ domain models, along with corresponding DTOs (\InventoryDto\, \InventoryItemsDto\) and a \ProductStatus\ enum. It also adds a comprehensive set of validation exceptions (e.g., \InvalidQuantityException\, \ProductNotExistToInventoryException\) to enforce business rules for inventory operations.

src/ECommerce/Inventories · high confidence

Initial product domain model and validation infrastructure

This change introduces the core Product entity and its associated data transfer objects within the ECommerce Products module. It defines the Product model with fields for identification, categorization, pricing (including price, profit margin, and net price), and physical attributes like breakability. To support this domain, a comprehensive set of validation exceptions has been added to enforce business rules, including checks for invalid or missing names, descriptions, barcodes, prices, and net prices, as well as length constraints. Additionally, AutoMapper mappings are configured to handle conversions between the domain model, request/response DTOs, and paginated lists, enabling the underlying infrastructure for product creation and retrieval.

src/ECommerce/Products · high confidence

Initial project scaffold with .NET 10 and Vertical Slice Architecture

The repository is initialized as an ECommerce monolith targeting .NET 10 (SDK 10.0.100), structured using Vertical Slice Architecture and CQRS with MediatR. The solution includes an API project (ECommerce.Api), domain logic (ECommerce), and a suite of tests (Unit, Integration, EndToEnd). It integrates the 'Griffin' building blocks as a git submodule under src/BuildingBlocks and enforces code quality via StyleCop, Roslynator, and other analyzers. The project supports containerized deployment via a Dockerfile and exposes API documentation through Swagger/OpenAPI.

(repo-wide) · high confidence

Initial release of ECommerce domain features

This change introduces the initial implementation of core ECommerce capabilities, including the creation of categories and products, customer data models with associated validation exceptions, and inventory management operations such as adding products to stock and damaging items. These features are exposed via new API endpoints (e.g., /catalog/category, /catalog/product, /inventory/add-product-to-inventory, /inventory/damage-product) built on a CQRS architecture using MediatR and FluentValidation, and are registered with API versioning 1.0.

(repo-wide) · high confidence

Initial release of ECommerce.Api with minimal API and OpenAPI support

The ECommerce.Api project is introduced, providing the entry point for the e-commerce service. It is configured as a minimal API application using the Griffin framework, which automatically maps endpoints and exposes an OpenAPI (Swagger) interface in non-production environments. The service is set up to connect to a PostgreSQL database via configuration files for development, Docker, and test environments, and listens on HTTP port 5000 and HTTPS port 5001 by default.

src/ECommerce.Api · high confidence

New API endpoints for paginated inventory and inventory items retrieval

Added new API endpoints to fetch paginated lists of inventories and inventory items. The 'Get All Inventory By Page' endpoint allows clients to retrieve a paginated list of inventory records with filtering and sorting. The 'Get All Inventory Items By Page' endpoint provides similar pagination capabilities for individual inventory items, including optional filtering by specific inventory ID and product status (None, InStock, Damaged, or Sold). Both endpoints support standard pagination parameters (page number, page size) and use Sieve for advanced filtering and sorting.

src/ECommerce/Inventories/Features/GettingAllInventoryItemsByPage · high confidence

New order registration endpoint with inventory deduction and shipping logic

Users can now register new orders via a POST endpoint at /order/register-new-order. The system validates that the customer exists and that requested items are in stock, then deducts the quantities from inventory and records the sold items. The total price is calculated based on product net prices, adding regular shipping (200) or express shipping (500) depending on whether items are breakable, and applying the specified discount. Orders with a total below 50,000 are rejected.

src/ECommerce/Orders/Features/RegisteringNewOrder · high confidence

Test coverage

Added end-to-end and integration test suites for the ECommerce API; Initial unit test suite for core domain features.

Dependencies

Initial project setup with .NET 10 and core dependencies

The project has been initialized with a .NET 10-based architecture, establishing the foundational package references across the solution. The API and domain layers rely on Microsoft.EntityFrameworkCore.Design 10.0.3, while the core business logic integrates Ardalis.GuardClauses 5.0.0, AutoMapper 13.0.1, FluentValidation 12.1.1, MediatR 14.0.0, and Sieve 2.5.5. Testing infrastructure is configured using xUnit 2.9.3, FluentAssertions 7.0.0, and AutoBogus 2.13.1, with integration and unit tests supported by Microsoft.AspNetCore.Mvc.Testing 10.0.3, Npgsql 10.0.1, and Testcontainers.PostgreSql 4.9.0.

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

Lenses

  • Code Health 69 → 69 (+0.0)
  • Architecture 81 → 81 (-0.2)
  • Maturity 71 → 73 (+2.8)
  • Readiness 69 → 69 (+0.0)
  • Security 21 → 21 (+0.0)
  • Performance 100 → 100 (+0.0)

Resolved (4)

  • Coverage not measured — no coverage collector is wired up
  • Split ECommerce
  • XML-doc coverage: ECommerce (src/ECommerce/ECommerce.csproj)
  • XML-doc coverage: ECommerce.Api (src/ECommerce.Api/ECommerce.Api.csproj)

New (1)

  • Projects may be oversized for their cohesion (src/ECommerce/ECommerce.csproj)

API surface

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

meysamhadeli/ecommerce-monolith 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 c19c7931105726384bb4c6c1771bea2c1181f7d4 — 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.