A guided track through @sotajs/ddd. Each part builds on the previous one.
Read in order if you’re new to the library — or jump to what you need.
Core workflow
- Creating Entities — Zod schema → rich domain entity
- Reading and Mutating State — props, auto-setters, identity
- Actions — business logic with validation and guard clauses
- Computed Properties — derived values from entity state
Domain integrity
- Invariants — cross-field consistency rules
- Value Objects — structural equality for values without identity
- Branded IDs — compile-time safety for entity identifiers
End-to-end
- Building Aggregates — transactional boundaries, nested entities, events
- Testing — unit-test domain logic without mocks
Other sections
- Core Concepts — all four building blocks side by side (coming soon)
- How It Works — internals: freeze, auto-setters, invariants mechanism
- Style Guide — rules with priorities: Essential / Recommended / Suggested
- API Reference — full config reference for every function
- ORM Integration — Prisma, Drizzle, Knex
- FAQ — answers structured by topic