Skip to content

Domain-Driven Hexagon

A long, example-driven guide to software design patterns and architecture, with TypeScript code samples.

Stars
15k
Forks
1.6k
Licence
MIT
Language
TypeScript
Last update
2.4 years ago
Type
Learning resource

No commits in over a year — check for forks or alternatives before adopting.

What it is

This is a reference guide, written as a README, that collects recommendations on how to structure software applications. It combines ideas from Domain-Driven Design, hexagonal, clean and onion architecture, SOLID principles and design patterns. Code examples use NodeJS, TypeScript, NestJS and Slonik, but the README says the patterns are meant to apply to any language or framework.

  • Read the layer-by-layer breakdown (application, domain, interface adapters, infrastructure) to plan how to organize a backend
  • Pick individual patterns such as value objects, domain events or repositories to apply to an existing codebase
  • Use the folder structure and file naming recommendations as a starting convention for a new TypeScript project
  • Review the pros and cons section to decide whether a full architecture fits a given project

Great for

  • Developers who want to understand Domain-Driven Design and hexagonal architecture through examples
  • Teams planning a larger application with significant business logic
  • Engineers looking for a checklist of backend design practices to adapt to their project
  • Students learning how layers, ports and adapters fit together

Not ideal for

  • Small CRUD apps, which the README itself says are ill-suited to this full architecture because it adds boilerplate and complexity
  • Readers who want a runnable starter project, since the README is a guide rather than a library or framework
  • Beginners without a basic grasp of SOLID and layered design, which the README says is required to use this approach well
Step-by-step guide: how to use Domain-Driven HexagonInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Read it online

    Clone the repository to read it locally

    git clone https://github.com/Sairyss/domain-driven-hexagon
  2. 2

    Run it

    • Open the README on GitHub or in your local clone.
    • Read the Architecture and Diagram sections for the overall picture.
    • Skim the Pros and Cons to judge whether the approach fits your project.
    • Jump to the layer sections (Application, Domain, Interface Adapters, Infrastructure) that match your current question.
  3. 3

    Get the most out of it

    • Read the 'Everything below is provided as a recommendation, not a rule' note before adopting any pattern.
    • Follow the links in the Additional resources section (Articles, Books, Videos) for deeper study.
    • Compare the Other recommendations section, which covers testing, folder structure and enforcing architecture, with your current project.
    • Check the author's related repositories listed at the top of the README, such as Backend best practices.

Downloads

Strengths

  • Covers many related architectural ideas in one place, with links to further reading
  • Explicitly says patterns are recommendations, not rules, and that most projects will use only part of them
  • Includes an honest pros and cons section that warns against over-engineering small applications

Trade-offs

  • Examples are tied to NestJS, Slonik and TypeScript, so readers using other stacks must translate the code themselves
  • As a long README, it can be hard to know where to start without prior knowledge of the underlying patterns
  • The last push date is June 2024, so it may not reflect the newest framework versions

How it compares

ProjectStarsTypeLevelUpdatedBest for
domain-driven-hexagon (this)15kLearning resourceintermediate2.4 years agoDevelopers who want to understand Domain-Driven Design and hexagonal architecture through examples
modular-monolith-with-ddd14.1kLearning resourceadvanced2.4 years agoDevelopers learning Domain-Driven Design tactical patterns in C#
CleanArchitecture18.5kFrameworkintermediate2 months agoC# developers starting a new ASP.NET Core project who want a structured layout
clean-code-javascript94.7kLearning resourcebeginner2.3 years agoDevelopers who want to improve the readability of their JavaScript code
aspnetboilerplate12kFrameworkadvanced11 days agoC# developers already working in the ASP.NET Core ecosystem
go-clean-arch10.2kLearning resourceintermediate2.5 years agoGo developers who want to see a concrete example of Clean Architecture

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.