Skip to content
CAI
Software that uses CAICheck a score

chatbotgang/go-clean-arch

68.9

Adequate · 21 September 2026

1.7k

lines of production code

Go

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a barter exchange platform that enables traders to register, authenticate, and manage goods for exchange. It provides a RESTful API for user authentication and barter operations, backed by a PostgreSQL database that stores trader and good entities. The application follows a clean architecture with distinct layers for domain logic, application services, and infrastructure adapters.

Features

Add PostgreSQL repository implementations for Goods and Traders

The system now supports persisting and retrieving Goods and Traders via a new PostgresRepository. The implementation provides Create, Get, List, and Update operations for both entities, including a batch update for Goods. Corresponding unit tests verify the repository's behavior against a real PostgreSQL database.

internal/adapter/repository · high confidence

Add barter HTTP server entry point

A new command-line application named 'crescendo-barter' has been added, providing a standalone HTTP server entry point. This includes configuration parsing for environment, logging, database, and token settings, along with graceful shutdown handling for the HTTP service.

cmd · high confidence

Add dummy authentication server implementation

A new file, auth\_server\_dummy.go, introduces a placeholder AuthServer that implements RegisterAccount and AuthenticateAccount methods. These methods return dummy values (a generated UUID and nil error) without performing real authentication, serving as a simplified implementation for the clean architecture template.

internal/adapter/server · high confidence

Add trader registration, login, and barter exchange capabilities

The auth service now supports registering and logging in traders, including generating and validating trader tokens. The barter service introduces new capabilities for managing goods: posting, listing, and removing goods, as well as exchanging goods between traders. These changes add the core business logic for user authentication and the barter exchange workflow.

internal/app/service · high confidence

Introduce API endpoints for trader authentication and barter operations

Added new router handlers and middleware to support trader registration, login, and token-based authentication. The /api/v1/auth namespace now exposes endpoints for registering and logging in traders, returning authentication tokens. The /api/v1/barter namespace, protected by a Bearer token middleware, provides endpoints to create, list, and remove goods, as well as to exchange goods between traders. A health check endpoint is also available at /api/v1/health.

internal/router · high confidence

Introduce application bootstrap with Auth and Barter services

The application entry point (internal/app/application.go) has been added to initialize the core services. This includes the Auth service, which manages authentication and token generation, and the Barter service, which handles barter-related logic. Both services are wired to a PostgreSQL repository and the Auth service is connected to an Auth server, establishing the foundational structure for the application's internal architecture.

internal/app · high confidence

Introduce barter domain models and token generation

Added domain models for Trader, Good, and the exchange logic, enabling users to represent goods and perform barter transactions. The Trader model now includes JWT-based token generation and parsing, allowing authenticated traders to securely obtain and validate access tokens.

internal/domain/barter · high confidence

Introduce structured domain error handling

Developers can now use a structured \DomainError\ type for domain-level failures, which provides clear client messages, HTTP status codes, and optional details. The error system includes predefined codes for common scenarios such as authentication failures, resource not found, and internal process errors, making it easier to map domain exceptions to appropriate HTTP responses.

internal/domain/common · high confidence

Behavioural changes

Added database migrations for trader and good tables

The application now includes SQL migration scripts to initialize the database schema. A new 'trader' table is created with fields for user ID, email, and name, along with a unique index on the user ID. Additionally, a 'good' table is introduced, which includes a foreign key relationship to the 'trader' table, establishing the data structure for goods and their owners.

migrations · high confidence

Test coverage

Added test data fixtures for trader and good entities

New test data files have been introduced to support unit tests for the trader and good repositories. This includes YAML fixtures (testdata/trader.yml, testdata/good.yml) containing sample records, a SQL script (testdata/init\_local\_dev.sql) for local development database initialization, and a Go helper (testdata/testdata.go) to resolve file paths for these fixtures.

testdata · high confidence

Dependencies

Updated Go dependencies

The project's go.mod and go.sum files have been updated to include a new set of direct and indirect dependencies. Key additions include gin v1.8.1, testify v1.8.0, and various Docker and Azure-related packages, establishing the current dependency graph for the application.

(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

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

Lenses

  • Code Health 98 → 99 (+0.4)
  • Architecture 100 → 86 (-13.7)
  • Maturity 65 → 61 (-4.1)
  • Readiness 64 → 68 (+4.0)
  • Security 42 → 80 (+37.4)
  • Domain Modelling 75 → 79 (+3.8)

Resolved (37)

  • Coverage not included — suite not readable by the collector
  • Critical CVE: [GHSA redacted] (go.mod)
  • Critical CVE: [GHSA redacted] (go.mod)
  • Critical CVE: [GHSA redacted] (go.mod)
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (10 lines × 2) (internal/adapter/repository/postgres/good_repository.go)
  • Duplicated block (12 lines × 3) (internal/router/handler_auth_trader.go)
  • Duplicated block (15 lines × 2) (internal/router/handler_barter_good.go)
  • Duplicated block (19 lines × 2) (internal/router/handler_barter_good.go)
  • Duplicated block (8 lines × 2) (internal/router/param_util.go)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 17 more

New (58)

  • Critical CVE: [GHSA redacted] (go.mod)
  • Critical CVE: [GHSA redacted] (go.mod)
  • Critical CVE: [GHSA redacted] (go.mod)
  • Deprecated module: github.com/bxcodec/faker/v3
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (10 lines × 4) (internal/router/handler_auth_trader.go)
  • Duplicated block (11 lines × 2) (internal/router/handler_auth_trader.go)
  • Duplicated block (12 lines × 2) (internal/adapter/repository/postgres/good_repository.go)
  • Duplicated block (12 lines × 2) (internal/router/param_util.go)
  • Duplicated block (18 lines × 2) (internal/router/handler_barter_good.go)
  • Duplicated block (21 lines × 2) (internal/router/handler_barter_good.go)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High CVE: [GHSA redacted] (go.mod)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 38 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

chatbotgang/go-clean-arch 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 3fdb0fbc8ab3deaab55d31f6cbdfcacf122ecfb8 — 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-fa71c66cabd8.