Skip to content

Motivation ​

Domain-Driven Design has good ideas: aggregates that protect invariants, events that record what happened, reactions that describe what happens next. It also has a reputation for ceremony.

Accord keeps the ideas and drops the ceremony.

What Accord gives you ​

  • A small, explicit API. You define business rules with ordinary classes or functions. No base repositories, no buses to configure, no decorators.
  • Failures as values. A business refusal like InsufficientFunds is a tagged value, not an exception. Operations return [value, null] or [null, error], so the compiler reminds you to look at the error. See Tuples, not throws.
  • One commit boundary. A successful command saves the new state, the emitted events, and a receipt together. A rejection or exception discards the working copy.
  • Reactions that rebuild. Views and projections fold events and can replay history. Policies react to new events only. See Events and delivery.
  • Optional everything else. The core has no runtime dependencies. SQLite persistence and Effect integration are separate entry points you import only when you need them.

The building blocks ​

PrimitiveWhat it is for
aggregateState plus the methods that change it and emit events
event, rejectionTagged, schema-validated facts and refusals
voValue objects with validation and domain methods
viewRead models folded from events
policy"When X happens, do Y"
projectionReplayable writes to another store
service, externalTyped dependencies and adapters
workflowCheckpointed steps with compensation (in memory)
model, wireRegister everything and get a typed runtime
apiExpose selected commands and views over HTTP
storyScenario tests

When not to use it (yet) ​

Accord v0.1 is an in-process runtime. There's no background scheduler, no distributed workflow engine, and no automatic migrations. If you need those today, read Limits of v0.1 first.

Accord is currently UNLICENSED. No open-source license has been selected yet.