GSabadini/go-clean-architecture
56.4
Adequate · 7 November 2026
2.6k
lines of production code
Go
primary language
7
measurements over time
What this system is
This system is a Go-based banking service that manages accounts and monetary transfers using a clean architecture. It provides HTTP APIs for creating accounts, executing transfers, and querying balances, backed by dual database support for both PostgreSQL and MongoDB. The application enforces domain logic for balance checks and currency handling while offering configurable logging and router implementations.
Features
Added database initialization scripts for MongoDB and PostgreSQL
New initialization scripts have been added to set up the 'bank' database schema for development environments. The MongoDB script (\_scripts/mongodb/init.js) creates a 'dev' user with root privileges, initializes the 'bank' database, and defines 'accounts' and 'transfers' collections with a unique index on the CPF field. The PostgreSQL script (\_scripts/postgres/init.sql) grants privileges to the 'dev' user and creates corresponding 'accounts' and 'transfers' tables with specified columns and constraints.
_\scripts · high confidence
Initial domain model for accounts, transfers, and money
The domain layer now defines the core entities for the banking application, including Account, Transfer, and Money. The Account entity encapsulates balance management with Deposit and Withdraw methods that enforce sufficient balance checks, while the Transfer entity models transactions between accounts. A dedicated Money type is introduced to handle currency values internally as integers (cents), and UUID generation utilities are provided for entity identification.
domain · high confidence
Initial project scaffolding with multi-database support and Docker tooling
The repository is initialized with a Go application implementing a clean architecture for banking operations (account management and transfers). The project now supports both PostgreSQL and MongoDB, configured via environment variables in .env.example. A multi-stage Dockerfile and docker-compose.yml are provided to run the application alongside its database dependencies, along with a Makefile for managing builds, tests, and container lifecycle.
(repo-wide) · high confidence
Introduce Gin HTTP server implementation with graceful shutdown
The router infrastructure now includes a new Gin-based HTTP server implementation (infrastructure/router/gin.go) alongside the existing Gorilla Mux version. This new server supports graceful shutdown via signal handling and exposes the same API endpoints (/v1/transfers, /v1/accounts, /v1/health) as the Gorilla Mux server, allowing users to switch to the Gin framework for potentially better performance or different middleware capabilities.
infrastructure/router · high confidence
Introduces configurable logging with Zap and Logrus backends
The infrastructure/log package now provides a factory-based approach to logger instantiation, allowing the application to switch between Zap and Logrus implementations via the NewLoggerFactory function. This change adds concrete adapters for both Zap (using production configuration) and Logrus (with JSON formatting), along with a LoggerMock for testing purposes, enabling users to configure their preferred logging backend at startup.
infrastructure/log · high confidence
New API actions, presenters, and repository adapters for account and transfer operations
The adapter layer now includes HTTP action handlers for creating accounts, creating transfers, finding account balances, and listing all accounts and transfers, along with corresponding presenter components that map domain entities to use-case outputs. Repository implementations for both PostgreSQL (SQL) and MongoDB (NoSQL) are added to persist accounts and transfers, supporting operations like creation, balance updates, and retrieval. A middleware logger is introduced to capture request and response details, and standardized response and error handling structures are provided for consistent API communication.
adapter · high confidence
New use-case implementations for account and transfer operations
The usecase package now includes complete implementations and unit tests for five core business capabilities: creating a new account, executing a money transfer (with database transaction support), finding a specific account's balance, listing all accounts, and listing all transfers. Each use case defines its own input/output structures, presenter interfaces, and interactor logic, wired to the domain repositories.
usecase · high confidence
Support for PostgreSQL and MongoDB database backends
The application now supports connecting to both SQL (PostgreSQL) and NoSQL (MongoDB) databases. This change introduces configuration handling for both database types via environment variables, factory methods to instantiate the appropriate database handlers, and specific handler implementations that provide data access capabilities including transactions for PostgreSQL and session-based transactions for MongoDB.
infrastructure/database · high confidence
Dependencies
Initial Go module setup with web, database, and logging dependencies
The project initializes its Go module (go.mod) with Go 1.21 and introduces a set of core dependencies: the Gin web framework and Gorilla Mux for HTTP routing, the MongoDB Go driver and lib/pq for database connectivity, Logrus and Zap for logging, and go-playground/validator for input validation. Indirect dependencies include standard library extensions for compression, JSON handling, and cryptography.
(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 55 → 56 (+1.2)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (+0.0)
- Architecture 80 → 79 (-1.7)
- Maturity 53 → 58 (+4.9)
- Readiness 37 → 37 (+0.0)
- Security 91 → 94 (+2.9)
- Domain Modelling 100 → 100 (+0.0)
New (2)
- High interface indirection
- Scattered collaborators
Architecture
- Unchanged — 0 containers · 1 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
GSabadini/go-clean-architecture 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 7 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 d88092281c40d8e0305bc1c8ce9019909e41fada — 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.