finds.dev← search

// the find

diego3g/node-microservices-ddd

★ 528 · TypeScript · updated Dec 2022

🚢 Node.js microservice structure with DDD & Monorepo

A study project showing how to structure Node.js microservices with DDD in a Lerna/Yarn Workspaces monorepo. It implements the full DDD vocabulary — Aggregates, Value Objects, Domain Events, Use Cases, Repositories — across three services (atlas, umbriel, mercury) communicating via Kafka. This is explicitly a learning exercise, not a production-ready framework.

The _shared package nails the DDD building blocks: Entity, AggregateRoot, ValueObject, Result, and Guard are all present and correctly separated. Domain events are dispatched in-process through DomainEvents.ts before being published to Kafka, which is the right sequencing. Repository interfaces live in the domain layer with Prisma implementations in infra — the dependency inversion is applied correctly. The use case folder structure (controller / use case / DTO / errors / index per operation) is consistent and easy to navigate.

Abandoned in 2022 and uses Prisma 2.x with the old migration format (schema.prisma per migration, not the current single prisma/migrations/ SQL approach) — running this today requires downgrading or migrating the ORM setup. Kafka is wired up but the consumer in mercury/src/consumer.ts is essentially a stub; there's no real cross-service event contract or schema registry, so the async communication is mostly theoretical. No authentication middleware is shown in the routes despite auth being part of the atlas service, which is the thing most people would clone this to learn. The `hermod` service has no implementation at all — just an index.ts entry point.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →