What is rich-domain?
@woltz/rich-domain is a TypeScript library that provides building blocks for implementing Domain-Driven Design (DDD) patterns with minimal boilerplate and maximum type safety.Type-Safe
Full TypeScript support with inference for field paths, filters, and
operations
Validation Agnostic
Works with Zod, Valibot, ArkType, or any Standard Schema compatible library
Automatic Change Tracking
Track changes across nested entities and collections without boilerplate
ORM Independent
Use with Prisma, Drizzle, TypeORM, or any persistence layer
Core Concepts
Entities & Aggregates
Entities have identity and lifecycle. Aggregates are consistency boundaries that manage related entities.Value Objects
Immutable objects compared by value, not identity.Change Tracking
Automatically track all changes for efficient persistence.Repository & Criteria
Type-safe queries with a fluent API.Requirements
- Node.js >= 20
- TypeScript >= 4.7