A production-ready Clean Architecture template for Go services with REST, gRPC, AMQP, and NATS RPC servers.
Go Clean Template is a starter project that demonstrates Clean Architecture principles for building scalable and maintainable Go microservices. It provides a structured foundation with clear separation of concerns to prevent spaghetti code, keep business logic independent of external tools, and manage growth effectively. The template includes four server types (REST API, gRPC, AMQP RPC, and NATS RPC) and three fully implemented example domains (authentication, task management, and translation).
Go developers and teams building microservices who need a production-ready, scalable foundation that enforces Clean Architecture principles. It is particularly suited for projects requiring multi-transport support (REST, gRPC, AMQP, NATS) and clear separation between business logic and infrastructure.
Developers choose this template because it provides a battle-tested, opinionated structure that implements Clean Architecture with real-world examples across multiple transports. Its unique selling point is the inclusion of four server types and three fully functional domains, all demonstrating dependency injection and separation of concerns, which reduces initial setup time and ensures maintainability as the service grows.
Clean Architecture template for Golang services
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports REST, gRPC, AMQP RPC, and NATS RPC out of the box, with all three example domains available across each transport, as detailed in the Domains section.
Includes fully implemented authentication, task management, and translation services with real-world features like JWT auth and status transitions, providing a practical learning and extension base.
Business logic is decoupled via interfaces, enabling easy mocking and unit testing, as demonstrated in the UseCase structures where repositories and web APIs are injected.
Integrates Swagger for API docs, Prometheus for metrics, structured logging with Zerolog, and database migrations, making it deployable with minimal additional setup.
Enforces Clean Architecture layers (entities, use cases, controllers, repositories) to prevent spaghetti code, as outlined in the Project Structure and Clean Architecture sections.
Requires running multiple external services like Postgres, RabbitMQ, and NATS via Docker Compose for full functionality, adding complexity to local development and testing environments.
The strict adherence to Clean Architecture and dependency injection can be overwhelming for developers new to these concepts, with a layered structure that may seem over-engineered for simple tasks.
The template's focus on multi-transport support and separation of concerns might be excessive for small or single-protocol services, leading to unnecessary boilerplate code.
Enforces a specific architectural pattern that may not align with all team preferences or project requirements, making it less flexible for those who prefer alternative approaches like MVC or serverless.