Skip to content
CAI
Software that uses CAICheck a score

ttulka/ddd-example-ecommerce

45.8

Weak · 22 September 2026

3.3k

lines of production code

Java

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This is an e-commerce application built with Spring Boot that manages the full lifecycle of online sales, from product browsing and cart management to order processing and payment collection. It coordinates inventory and logistics by tracking stock levels, preparing deliveries, and dispatching orders through a saga-based state machine. The system exposes these capabilities via REST APIs and a Thymeleaf-based web interface, supported by a JDBC persistence layer for all domain entities.

Features

Add JDBC persistence for sales orders

Users can now have their orders persisted to a relational database via a new JDBC implementation. This introduces the OrderItem and ProductId domain models, along with Spring-based configuration and repository classes (FindOrdersJdbc, PlaceOrderJdbc, OrderJdbc) that map order data to and from the database, enabling reliable order placement and retrieval.

src/main/java/com/ttulka/ecommerce/sales/order/jdbc · high confidence

Add Warehouse REST controller for stock inquiries

A new REST controller is introduced to expose warehouse stock information. It provides a GET endpoint at /warehouse/stock/{productId} that returns the current stock level for a given product ID.

src/main/java/com/ttulka/ecommerce/warehouse/rest · high confidence

Add ecommerce portal web controllers and use-case adapters

The portal layer now provides web controllers (Cart, Catalog, Order) and use-case adapters (PlaceOrderFromCart, PrepareOrderDelivery) that bridge HTTP requests to the domain services. Users can browse the product catalog, manage a shopping cart, and place orders with delivery preparation, all coordinated through Spring MVC controllers and Spring-configured beans.

src/main/java/com/ttulka/ecommerce/portal · high confidence

Add order dispatching capability with saga-based state management

A new dispatching module has been introduced to manage the lifecycle of an order's transition to a dispatched state. This includes a domain event (DeliveryDispatched), a use-case interface (Dispatching), and a saga implementation (DispatchingSaga) that tracks order states (Prepared, Accepted, Fetched, Paid) and triggers the actual dispatch once all conditions are met. The saga is wired via Spring configuration and driven by asynchronous event listeners that react to domain events like OrderPlaced and PaymentCollected.

src/main/java/com/ttulka/ecommerce/shipping/dispatching · high confidence

Add payment tracking and retrieval capabilities

Introduced a new payment domain model and use cases to support tracking and querying of payments. The Payment entity now includes state management for requesting and collecting payments, along with specific exceptions for invalid state transitions. A domain event, PaymentCollected, is added to track when payments are finalized. The FindPayments interface and Payments collection provide the ability to retrieve all payments, while the PaymentController exposes a REST endpoint at /payment to list recent payments, returning their ID, reference ID, total amount, and collection status.

src/main/java/com/ttulka/ecommerce/billing/payment · high confidence

Added Maven Wrapper for consistent builds

The project now includes the Maven Wrapper, allowing developers to build the project without pre-installing Maven. The wrapper script and configuration files (.mvn/wrapper/MavenWrapperDownloader.java and maven-wrapper.properties) are added, pinning the build to Maven 3.8.3 and the wrapper version 0.5.6.

.mvn · high confidence

Added delivery management capabilities

The system now supports managing deliveries, including preparing and dispatching them. Users can view all deliveries or search by order ID via the new /delivery REST endpoints. The delivery state (prepared/dispatched) is tracked and exposed in the API response.

src/main/java/com/ttulka/ecommerce/shipping/delivery · high confidence

Added e-commerce template pages for cart, catalog, and order flows

The application now includes Thymeleaf templates for the core shopping experience: a product catalog page to browse and buy items, a shopping cart view to review selected products, an order submission form to capture delivery details, and success/error pages to confirm or report on order placement. A shared layout template provides the site header and footer structure.

src/main/resources/templates · high confidence

Cart domain model and JDBC persistence layer

Introduced the core Cart domain model, including the Cart and CartItem entities, along with domain primitives like CartId, ProductId, and Title. Added use-case interfaces for listing, retrieving, and removing cart items. Implemented the JDBC persistence layer with CartJdbc and RetrieveCartJdbc to handle database operations for the cart, including adding, removing, and querying cart items.

src/main/java/com/ttulka/ecommerce/sales/cart · high confidence

Initial application setup with async support and embedded database

The application is initialized with the main entry point enabling asynchronous processing via @EnableAsync, and a configuration for sample data using an embedded H2 database for non-test profiles.

src/main/java/com/ttulka/ecommerce · medium confidence

Initial database schema, example data, and UI assets for the e-commerce application

The application now includes the foundational data layer and user interface assets. The database schema defines tables for the catalog (categories, products), cart, orders, payments, deliveries, and a dispatching saga state machine. Example seed data is provided for products and stock levels. Additionally, the project now includes i18n message properties for UI text and a CSS stylesheet that styles the header, content, footer, and product/cart/order components.

src/main/resources · high confidence

Initial project scaffolding and build tooling

The repository was initialized with essential configuration files to support the project's build and development workflow. A \.gitignore\ file was added to exclude build artifacts, IDE settings, and temporary files from version control. A \README.md\ was introduced to document the project's Domain-Driven Design and Service-Oriented Architecture, providing instructions on how to build and run the application using Maven. Additionally, Maven wrapper scripts (\mvnw\ and \mvnw.cmd\) and a \lombok.config\ were added to standardize the build environment and configure Lombok's behavior, ensuring consistent builds across different environments.

(repo-wide) · high confidence

Introduce JDBC implementations for warehouse operations

Added JDBC-based implementations for the warehouse domain, including WarehouseJdbc for stock management and GoodsFetchingJdbc for processing fetch requests. The new code handles database interactions for tracking product inventory and recording fetched goods, wired via WarehouseJdbcConfig.

src/main/java/com/ttulka/ecommerce/warehouse/jdbc · high confidence

Introduce JDBC persistence for payment processing and queries

Added new classes in the billing payment module to persist and retrieve payment data using Spring's JdbcTemplate. The implementation includes a payment entity (PaymentJdbc) that manages payment states (new, requested, collected) and publishes domain events, alongside repository classes (CollectPaymentJdbc, FindPaymentsJdbc, PaymentsJdbc) that handle the actual database interactions. A configuration class wires these components as Spring beans, enabling the application to store and query payment records via JDBC.

src/main/java/com/ttulka/ecommerce/billing/payment/jdbc · high confidence

Introduce warehouse domain model and event infrastructure

The warehouse module now includes a formal domain model for tracking stock levels, order fetching, and inventory removal, alongside explicit domain event types. Users can now interact with warehouse operations such as checking stock availability, adding or removing inventory, and fetching goods for orders. The introduction of the DomainEvent interface and specific events like GoodsFetched and GoodsMissed enables the system to react to warehouse state changes, supporting future decoupled processing of these events.

src/main/java/com/ttulka/ecommerce/warehouse · high confidence

Introduced core order domain model and use cases

The system now defines the foundational structure for managing orders, including the Order and PlaceableOrder entities, the OrderId domain primitive, and the FindOrders and PlaceOrder use-case interfaces. This establishes the basic capability to represent an order's state (items, total) and the actions to place an order, while explicitly excluding shipping concerns from this layer.

src/main/java/com/ttulka/ecommerce/sales/order · high confidence

JDBC implementation for catalog queries

Added JDBC implementations for the FindCategories, FindProducts, and FindProductsFromCategory use cases. This introduces the Spring-based data access layer for the catalog module, including entity classes (Category, Product), domain primitives (Title, Description, Money), and repository interfaces that map to database tables.

src/main/java/com/ttulka/ecommerce/sales/catalog · high confidence

Behavioural changes

OrderPlacedListener converted to Spring component

The OrderPlacedListener is now a Spring-managed @Component, enabling asynchronous processing via @Async and transactional event handling. This change ensures the listener is properly integrated into the Spring lifecycle, allowing it to process OrderPlaced events in a background thread while maintaining transactional consistency.

src/main/java/com/ttulka/ecommerce/billing/payment/listeners · medium confidence

Warehouse listeners decoupled into dedicated Spring components

The warehouse module now uses dedicated Spring @Component listeners for order and delivery events, replacing previous inline or coupled implementations. OrderPlacedListener handles fetching goods asynchronously via @Async, while DeliveryDispatchedListener removes fetched goods upon dispatch. Both listeners are now independent components with custom bean names to avoid collisions, improving separation of concerns and allowing asynchronous processing of warehouse operations.

src/main/java/com/ttulka/ecommerce/warehouse/listeners · medium confidence

Test coverage

Added JDBC integration tests for warehouse operations; Added SQL test data fixtures for billing, orders, and products; Added architectural and workflow tests for the ecommerce application; Added tests for payment domain and billing services; Added tests for sales domain components; Added tests for shipping delivery domain and infrastructure; Added tests for shipping dispatching components; Added unit and integration tests for warehouse domain primitives; Added unit tests for Money and Quantity primitives; Added unit tests for portal web controllers and services; Added unit tests for warehouse listeners.

Dependencies

Upgrade to Spring Boot 3.2 with Java 17

The project has been updated to use Spring Boot 3.2.0 as the parent, which includes dependencies for Spring Web, Thymeleaf, JDBC, and H2. The build is now configured to compile against Java 17, and includes test dependencies for Rest Assured and ArchUnit.

(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

Score

  • CAI 43 → 46 (+2.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 99 (-0.8)
  • Architecture 100 → 95 (-4.9)
  • Maturity 46 → 46 (+0.0)
  • Readiness 26 → 32 (+6.4)
  • Security 99 → 99 (+0.0)
  • Accessibility 42 → 42 (+0.0)

Resolved (6)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • No exposed public API
  • Scanner failed to run — not a clean result
  • Test reliability not included
  • single-maintainer — knowledge-concentration (bus factor) risk

New (54)

  • Coverage not measured — no coverage collector is wired up
  • Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
  • Documentation: no architecture or design documentation (README.md)
  • Duplicated block (11 lines × 12) (src/main/java/com/ttulka/ecommerce/billing/payment/PaymentId.java)
  • Duplicated block (11 lines × 3) (src/main/java/com/ttulka/ecommerce/sales/cart/item/Title.java)
  • Duplicated block (7 lines × 2) (src/main/java/com/ttulka/ecommerce/sales/catalog/jdbc/FindCategoriesJdbc.java)
  • Duplicated block (8 lines × 2) (src/main/java/com/ttulka/ecommerce/billing/payment/jdbc/PaymentsJdbc.java)
  • Duplicated block (9 lines × 2) (src/main/java/com/ttulka/ecommerce/billing/payment/jdbc/PaymentsJdbc.java)
  • No assertions: all_deliveries (src/test/java/com/ttulka/ecommerce/shipping/delivery/rest/DeliveryControllerTest.java)
  • No assertions: all_payments (src/test/java/com/ttulka/ecommerce/billing/payment/rest/PaymentControllerTest.java)
  • No assertions: billing_payment_domain_has_no_dependency_to_its_implementation (src/test/java/com/ttulka/ecommerce/CleanModulesArchTest.java)
  • No assertions: billing_payment_service_has_no_dependencies_on_others_except_events (src/test/java/com/ttulka/ecommerce/CleanModulesArchTest.java)
  • No assertions: catalog_service_has_no_dependencies_on_billing (src/test/java/com/ttulka/ecommerce/CleanModulesArchTest.java)
  • No assertions: categories_are_on_every_page (src/test/java/com/ttulka/ecommerce/portal/web/WebLayoutAdviceTest.java)
  • No assertions: categorize_noop (src/test/java/com/ttulka/ecommerce/sales/catalog/jdbc/UnknownProductTest.java)
  • No assertions: category_has_products (src/test/java/com/ttulka/ecommerce/portal/web/CatalogControllerTest.java)
  • No assertions: delivery_by_order (src/test/java/com/ttulka/ecommerce/shipping/delivery/rest/DeliveryControllerTest.java)
  • No assertions: error_is_shown_for_no_items (src/test/java/com/ttulka/ecommerce/portal/web/OrderControllerTest.java)
  • No assertions: error_message_is_shown (src/test/java/com/ttulka/ecommerce/portal/web/OrderControllerTest.java)
  • No assertions: index_has_products (src/test/java/com/ttulka/ecommerce/portal/web/CatalogControllerTest.java)
  • …and 34 more

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

Survey your own repository

ttulka/ddd-example-ecommerce 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 22 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 b48268eacfb2940d4d1237cfae09acea3bcc779e — 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-90d5d2fe38ee.