// the find
GSabadini/go-clean-architecture
Simple API for banking routines using a Clean Architecture in Golang :credit_card: :moneybag: :money_with_wings:
A Go HTTP API that models a toy bank: create accounts, check balances, move money between accounts, and list transfers. It is a reference implementation of Clean Architecture for Go developers who want to see the layers in a working service, not a production banking system.
- The layers are real directories (domain/, usecase/, adapter/, infrastructure/). The router (Gin or Gorilla Mux), logger (Logrus or Zap), and database (Postgres or MongoDB) each have a factory in infrastructure/ that picks the implementation, and the repositories have matching Postgres and MongoDB versions under adapter/repository/.
- Every use case, HTTP action, and presenter has a neighbouring _test.go file, so each layer is tested on its own rather than only through the HTTP surface.
- The Makefile wraps test, local test, and coverage targets, and a GitHub Actions workflow is included, so the suite runs with one command, either in Docker or locally.
- The README's sample responses don't match its own requests. An account created with balance 100 comes back with balance 1, and a transfer of 100 comes back with amount 1. Anyone checking the API against the docs will think it is lossy or broken.
- The documented API has no authentication. GET /v1/accounts returns every account with its CPF (Brazilian tax ID) and balance, and nothing suggests POST /v1/transfers requires any credentials, so anyone who can reach the server can move money between accounts.
- The README doesn't say whether a transfer debits and credits in one database transaction, or how two concurrent transfers on the same account are serialized. For a banking example, that is the question that matters most, and the docs don't answer it.
- The last push was March 2024, the status line says 'Development', and the build badge links to travis-ci.org, which stopped running builds for open-source projects years ago. Read it as a snapshot of a 2020-era design, not maintained code.