The Open Source Projects that implemented Hexagonal Architecture successfully

Discover open source projects like Hexagon, Typescript DDD Example, and Go Clean Template that effectively use hexagonal architecture to build scalable, maintainable software with technologies like Kotlin, TypeScript, and Go.

Hexagonal Architecture: The Pattern Behind These Projects

Hexagonal architecture—often called Ports and Adapters—is a design pattern that isolates business logic from external systems. It does this through well-defined interfaces, known as ports, and their implementations, known as adapters.

The payoff is real: loose coupling, testability, and scalability. That combination has made the pattern a popular choice in modern software development.

And it works in practice. Several open source projects have implemented hexagonal architecture successfully, demonstrating its benefits in real-world applications. Below, we explore notable examples—looking at their key technologies and how each uses the pattern to build robust, maintainable systems.

Hexagon: A Microservices Toolkit in Kotlin

Hexagon is a microservices toolkit written in Kotlin. It targets web applications and APIs running on cloud platforms.

The toolkit follows hexagonal architecture. Business logic stays separate from infrastructure concerns, which keeps dependencies few and services scalable.

Ports define how the application talks to external systems, such as databases or HTTP clients. Adapters supply the implementations: one connects to MongoDB, another serves requests via Ktor.

Because the design is modular, developers can swap adapters without touching core logic. That makes Hexagon a good fit for cloud-native environments like Kubernetes. The clear split between business rules and infrastructure also makes testing and maintenance easier.

Hexagon has shipped over 100 releases, with active community contributions as of its latest update in 2023. Its simplicity and flexibility have made it a go-to choice for developers building microservices.

TypeScript DDD Example: A Comprehensive Reference

The TypeScript DDD Example is a complete reference implementation combining hexagonal architecture with Domain-Driven Design (DDD), CQRS, and Event-Driven Architecture. The backend is built with TypeScript and NestJS.

Its goal is to keep business logic isolated. Ports define interfaces for operations such as data retrieval or event publishing, while adapters handle the technologies — MongoDB for persistence and RabbitMQ for messaging.

The project shows developers how to apply DDD and hexagonal architecture together. The codebase is well documented and includes examples of aggregates, domain events, and dependency injection, making the code easier to test and extend. ESLint and Prettier keep code quality high and maintainability consistent. With an active community and regular updates, the project serves as a practical guide for building robust, scalable applications.

Go Clean Template: A Minimalist Approach

The Go Clean Template is a Go-based boilerplate for building REST APIs with hexagonal architecture. It integrates Gin for HTTP routing, GORM for database interactions, and Swagger for API documentation, all while maintaining a clean separation between business logic and infrastructure. Ports define interfaces for data access or external services, and adapters handle specific implementations, such as connecting to MySQL or Docker.

This project’s minimalist design makes it an excellent starting point for developers new to hexagonal architecture in Go. It supports features like pagination and JWT authentication, demonstrating how to apply the pattern in a production-ready API. The use of dependency injection ensures testability, allowing developers to mock external dependencies easily. With recent commits and a focus on clean code principles, Go Clean Template is a practical example of how hexagonal architecture can streamline backend development.

Hexagonal Architecture Frontend: Adapting to the Frontend

The Hexagonal Architecture Frontend project applies hexagonal architecture to frontend work. It uses JavaScript and TypeScript, with examples built in React and Vue. Its goal is to decouple business logic from framework code. This matters because frontend ecosystems change fast.

Ports define interfaces for tasks like data fetching or state management. Adapters handle framework-specific details. For example, HTTP requests go through Axios.

Dependency injection and a modular structure keep the domain layer framework-agnostic. Developers can switch between React, Vue, or even React Native without rewriting business logic. ESLint and Prettier keep the code consistent. Alias-based imports simplify development.

This project shows how hexagonal architecture can improve frontend maintainability. It suits apps that need frequent framework updates.

Key Takeaways

These projects show hexagonal architecture working in very different settings. Hexagon uses Kotlin for cloud-native microservices. The TypeScript DDD Example pairs DDD with CQRS for a robust backend. Go Clean Template is a minimalist API in Go. Hexagonal Architecture Frontend brings the same pattern to React.

What they share is TypeScript-style discipline applied through ports and adapters: business logic stays isolated, interfaces stay clear, and adapters absorb the dependencies. The result in each case is loose coupling and easy testing.

If you want to adopt the pattern, these repositories are good starting points. Their code is well documented and their communities are active. For the foundations, read Alistair Cockburn's original article and the detailed guide on hexagonal architecture.