finds.dev

amitshekhariitbhu/go-backend-clean-architecture

A Go (Golang) Backend Clean Architecture project with Gin, MongoDB, JWT Authentication Middleware, Test, and Docker.

View on GitHubHomepage ↗

★ 6,056GoApache-2.0updated Feb 2026

// the take

A Go project template implementing Clean Architecture with Gin, MongoDB, and JWT auth. It layers Router → Controller → Usecase → Repository → Domain with each concern in its own package. Aimed at developers who want a starting point for a Go API without making architectural decisions from scratch.

The layer separation is genuine — domain interfaces are defined in the domain package and implemented in repository/usecase, which makes swapping implementations testable without heroics. Mockery is wired up correctly and the generated mocks are checked in, so you can run tests immediately without a setup ritual. The refresh token flow is implemented properly with separate access/refresh tokens rather than the common mistake of just re-signing the same claim. Docker Compose setup is straightforward and the environment config via Viper is sensible.

MongoDB is baked in at every layer — the repository interfaces return mongo-specific types in places, so swapping to Postgres isn't just 'implement the interface'. The test coverage is shallow: one controller test, one repository test, one usecase test, all against a trivially simple task entity. There's no error handling strategy beyond returning error strings — no typed errors, no distinction between validation failures and infrastructure failures. The domain is anemic; it's mostly struct definitions with no business logic, which makes the usecase layer just thin CRUD wrappers around the repository.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
6,056
Forks
657
Language
Go
License
Apache-2.0
Last commit
5 Feb 2026

// nearby

If go-backend-clean-architecture isn't quite it.

All repos →