finds.dev

Sairyss/domain-driven-hexagon

Learn Domain-Driven Design, software architecture, design patterns, best practices. Code examples included

View on GitHub

★ 14,705TypeScriptMITupdated Jun 2024

// the take

A reference implementation combining DDD, Hexagonal Architecture, Clean Architecture, and CQRS in NestJS/TypeScript. It's a learning resource first, a starter template second — the code is deliberately over-engineered to show patterns in isolation. Aimed at mid-to-senior developers who want to see these concepts wired together in one place before applying a fraction of them to real projects.

The layering is genuinely clean: domain objects know nothing about NestJS, ports are properly inverted, and the mapper pattern keeps persistence concerns out of entities. The README is unusually honest — it explicitly lists cons and warns you not to use all of this on a CRUD app. Value objects enforcing invariants at construction time (no invalid state ever exists) is the right approach and the examples show it clearly. The vertical slice structure inside modules (one folder per use case) scales better than the usual 'controllers/', 'services/', 'repositories/' top-level split.

Last commit was June 2024 and NestJS, TypeORM, and Slonik have all moved; there's no indication this tracks upstream. The wallet module is a thin demo that doesn't stress-test the aggregate boundaries — in a real system with money involved you'd immediately hit questions about concurrency and the examples don't answer them. There are two database access patterns in the same repo (Slonik raw SQL for queries, TypeORM-style for commands) without a clear explanation of why, which will confuse someone learning from this. The e2e test setup requires a live database but the docker-compose and setup docs are minimal enough that getting tests green locally takes real effort.

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
14,705
Forks
1,556
Language
TypeScript
License
MIT
Last commit
11 Jun 2024

// nearby

If domain-driven-hexagon isn't quite it.

All repos →