Skip to content
CAI
Software that uses CAICheck a score

gvolpe/pfps-shopping-cart

50.2

Weak · 20 September 2026

2.4k

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Scala-based e-commerce backend service that manages core shop operations including user authentication, product catalog management, shopping carts, and order processing. It exposes these capabilities via an HTTP API secured with JWT tokens and persists data using PostgreSQL and Redis. The codebase emphasizes robust testing through integration suites for storage layers and property-based tests for domain logic.

How it got here

2019 — v2.0 architecture migration

12 changes.

The project underwent a major structural overhaul to version 2.0, migrating core libraries to Cats Effect 3 and http4s 0.23 while replacing the build toolchain and test framework. Legacy in-memory services, manual JSON codecs, and newtype wrappers were removed in favor of a modular design using Skunk for database access and automated derivation for serialization.

2021 — comprehensive test coverage expansion

10 changes.

This period focused on establishing robust test infrastructure and expanding test coverage across the application. Significant work included adding unit, property-based, and integration tests for HTTP routes, domain logic, storage backends, and external client interactions. New base classes and utilities were introduced to support these testing efforts, ensuring reliability for core features like authentication, cart management, and checkout processes.

Features

Initial core module structure and domain definitions

This change introduces the foundational structure for the shop's core module, including domain models for users, items, brands, categories, carts, orders, and payments, along with configuration loading via Ciris and database schema definitions in tables.sql. It establishes the HTTP API layer using Http4s with routes for authentication, admin management, and customer-facing operations, wired together through module composition in Main.scala. The implementation also adds security features like JWT token handling and password encryption, as well as health check endpoints and logging configuration.

modules/core · high confidence

Repository initialization with configuration, CI, and development tooling

The repository is initialized with essential configuration and tooling files. A \.env\ file is added to define environment variables for authentication secrets, database passwords, and application settings. CI automation is configured via \.mergify.yml\ to automatically merge Scala Steward dependency updates, while \.scala-steward.conf\ excludes \scalafmt-core\ from automatic updates. Code formatting and import organization are managed by updated \.scalafmt.conf\ and a new \.scalafix.conf\. Development environment setup is provided through \shell.nix\ (using GraalVM CE) and an updated \.gitignore\ for Metals and Bloop artifacts. Additionally, \docker-compose.yml\ is introduced to run PostgreSQL and Redis services with health checks, and \insomnia.json\ provides pre-configured API request examples for testing endpoints like authentication, cart management, and item retrieval.

(repo-wide) · high confidence

Removals

Removal of authentication, token, and admin route implementations

The HTTP route definitions for authentication, token management, and administrative endpoints have been removed from the application. Specifically, the files handling user registration and login (AuthRoutes), token creation (TokenRoutes), and admin operations for brands, categories, and items (AdminBrandRoutes, AdminCategoryRoutes, AdminItemRoutes) have been deleted. This eliminates the currently implemented endpoints for user access control and admin resource management.

src/main/scala/shop/http/routes · high confidence

Removal of in-memory service implementations

The in-memory implementations for core domain services have been removed from the application. This includes the authentication service (previously handling user lookup and login stubs), the shopping cart service (managing cart state via references), and the read-only services for brands, categories, and items (which previously returned hardcoded lists or generated dummy data). Additionally, supporting infrastructure services for JWT token creation and UUID generation have been deleted, indicating a shift away from these self-contained, stateful in-memory providers.

src/main/scala/shop/services · high confidence

Removal of legacy application entry point and configuration module

The legacy \Main.scala\ entry point and \config.scala\ configuration module have been removed from the \src/main/scala/shop\ directory. This deletion eliminates the previous application startup logic that initialized the HTTP server via Blaze and the old JWT-based configuration loading mechanism, indicating a structural shift in how the application is bootstrapped and configured.

src/main/scala/shop · high confidence

Removal of legacy authentication role definitions

The file defining specific authentication roles, including AdminRole, UserRole, and associated JWT auth wrappers (AdminJwtAuth, UserJwtAuth), has been removed from the codebase. This eliminates the previous hardcoded role structure and user identity types (UserId, UserName, LoggedUser) from the http/auth module, indicating a shift in how authentication and authorization are handled.

src/main/scala/shop/http/auth · high confidence

Behavioural changes

Removal of legacy HTTP API and services module scaffolding

The legacy \HttpApi\ and \Services\ modules have been removed from the codebase. This deletion eliminates the previous implementation of HTTP route composition, JWT authentication middleware, and service instantiation logic, indicating a structural shift in how the application's API layer and service dependencies are managed.

src/main/scala/shop/modules · high confidence

Removal of legacy JSON serialization module

The \src/main/scala/shop/http/json.scala\ file, which previously contained manual Circe encoders and decoders for domain types such as Item, Cart, and authentication credentials, has been removed. This change indicates that the application has migrated to a different JSON serialization strategy (likely leveraging the newly added \circe-refined\ and \chimney\ libraries mentioned in the commit history), resulting in the deletion of the old, manually defined codec implementations.

src/main/scala/shop/http · medium confidence

Simplified domain model by removing newtype wrappers

The domain layer in src/main/scala/shop/domain has been refactored to remove the \io.estatico.newtype\ library and its associated type wrappers. Files defining entities such as \auth\, \brand\, \cart\, \category\, and \item\ have been deleted, indicating that domain types (e.g., \UserName\, \Brand\, \ItemId\) are no longer distinct newtypes but are likely represented by their underlying base types (e.g., \String\, \UUID\). This change simplifies the domain model by removing the explicit type distinctions previously enforced by newtypes.

src/main/scala/shop/domain · high confidence

Test coverage

Added HTTP route tests for Brands, Items, and Cart; Added integration tests for Postgres and Redis storage layers; Added property-based test generators for domain models; Added property-based tests for domain optics and money monoid; Added test suite base classes for HTTP and resource management; Added test utilities for background scheduling effects; Added tests for PaymentClient HTTP interactions; Added tests for admin brand and item creation routes; Added tests for checkout retry and error handling logic; Added tests for retry behavior handling; Added tests for the Crypto interpreter.

Dependencies

Major dependency upgrades and build toolchain updates

This change upgrades the project's core Scala libraries to newer major versions, including Cats Effect 2→3, http4s 0.21→0.23, fs2 2→3, and circe 0.12→0.14. It also introduces new libraries such as Skunk (database client), Monocle (optics), and derevo (typeclass derivation), while replacing the Blaze HTTP server/client with Ember. The build toolchain is updated to sbt 1.6.2, and several SBT plugins (sbt-tpolecat, sbt-native-packager, sbt-scalafix, sbt-scalafmt) are upgraded or added. The test framework is switched from ScalaTest to Weaver.

project · high confidence

Upgrade to Scala 2.13.8 and restructure project modules

The build system has been upgraded from Scala 2.13.0 to 2.13.8, and the project version has been bumped to 2.0.0. The codebase has been restructured into separate \core\ and \tests\ modules, with the test suite now utilizing the Weaver framework instead of ScalaTest. Several dependencies have been added or updated, including the introduction of Skunk for database access, Redis support via redis4cats, and various utility libraries like Derevo, Monocle, and Cats-Retry, while removing older or unused dependencies like circe-generic-ext and ciris-cats-effect.

(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

Baseline

  • First survey — no prior run to compare against. CAI 50.

Lenses

  • Code Health 99
  • Architecture 86
  • Maturity 57
  • Readiness 38
  • Security 49
  • Domain Modelling 81

Changes since last survey

  • 300 commits — 294 feature/other, 6 fixes

By area

  • (repo) — 147 commits
  • project/Dependencies.scala — 105 commits
  • project/plugins.sbt — 26 commits
  • project/build.properties — 9 commits
  • modules/core — 5 commits
  • (root) — 4 commits
  • modules/tests — 4 commits

Notable commits

  • fix: Fix GET items by brand test
  • fix: Fix cats badge
  • fix: Merge pull request #450 from gvolpe/fix/remove-classtag
  • fix: Merge pull request #453 from gvolpe/fix/item-routes-suite
  • fix: Merge pull request #481 from gvolpe/fix/cats-retry
  • fix: Merge pull request #623 from yoohaemin/haemin/fix-typoe
  • change: Fix minor typo
  • change: Merge branch 'second-edition' into update/skunk-circe-0.2.1
  • change: Merge pull request #423 from scala-steward/update/semanticdb-scalac-4.4.20
  • change: Merge pull request #424 from scala-steward/update/ciris-2.0.1
  • change: Merge pull request #425 from scala-steward/update/sbt-scalafix-0.9.29
  • change: Merge pull request #426 from scala-steward/update/sbt-1.5.3
  • change: Merge pull request #427 from scala-steward/update/sbt-tpolecat-0.1.20
  • change: Merge pull request #428 from scala-steward/update/skunk-circe-0.2.0
  • change: Merge pull request #429 from scala-steward/update/semanticdb-scalac-4.4.21
  • change: Merge pull request #430 from gvolpe/feature/config-decoder-derivation
  • change: Merge pull request #431 from scala-steward/update/sbt-1.5.4
  • change: Merge pull request #432 from scala-steward/update/semanticdb-scalac-4.4.22
  • change: Merge pull request #433 from scala-steward/update/weaver-cats-0.7.4
  • change: Merge pull request #434 from scala-steward/update/semanticdb-scalac-4.4.23
  • …and 280 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

gvolpe/pfps-shopping-cart 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 20 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 bb03088114a23137404c0af4c29719858bdca37e — 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-b51f968c9b10.