API Reference vicander v#0.1.1

Copy Markdown View Source

Modules

DDD

The Domain-Driven Design framework: entities, aggregates, value objects, specifications, commands, events and the outbox. It knows nothing about any application built on it.

Behaviour and macros for Domain-Driven Design Aggregate Roots.

Macro for declaring a Bounded Context.

A command is the input of one use case, and it carries its own handler.

The framework's application configuration, in one place.

The few things that differ between databases.

Behaviour and macros for Domain Events.

Marker for Domain Services — stateless, domain-logic-only modules.

Behaviour and macros for Domain-Driven Design Entities.

Structured error produced by the framework.

Simple in-process pub/sub event bus.

A handler for domain events delivered through the outbox.

A small, safe filter language that becomes a SQL WHERE, for the listing functions of DDD.Repository.Ecto adapters and DDD.Projections (list/1, page/1, slice/1, count/1).

A health check for the parts of the framework that can fall behind silently: the database, the outbox and the projections.

DDD.Health.check/0 as a DDD.Query, so it can be listed in an MCP server (or anywhere a query is accepted)

Identities of entities and aggregates, and generating them.

Generic in-memory repository adapter. Ideal for tests.

The listing functions shared by repository adapters (DDD.Repository.Ecto) and projections (DDD.Projection): list/1, page/1, slice/1 and count/1.

The application as a Model Context Protocol server: an AI client can call its commands and queries as tools and read its aggregates as resources.

Turns the JSON arguments of a tool call into the typed attributes of a command or query.

Turns the result of a command, query or repository lookup into JSON.

What an MCP server exposes, checked once when the server is built.

JSON Schema for the input of a command or query, built from its declared fields.

Declares which commands, queries and aggregates an application offers over MCP.

The stdio transport: one JSON-RPC message per line on standard input, one reply per line on standard output. Standard output carries only protocol messages, so anything that logs must write to standard error (mix vic.mcp arranges that).

Snapshot-based migration generation for aggregates stored by DDD.Repository.Ecto.

An amount of money in one currency, as a value object.

A supervised process that applies a DDD.Outbox.DeadLetterPolicy to dead-lettered events.

Decides what to do with a dead-lettered event.

The recommended default: keep every dead letter. The failure has already been logged at error level and emitted as a [:ddd, :outbox, :dead_letter] telemetry event, so someone looks at it and replays it by hand (mix vic.outbox.replay).

Inspect and resolve dead-lettered outbox events.

A row of event_deliveries: which handler already processed which event, and how.

A row of the domain_events outbox table (see mix vic.gen.outbox_migration).

GenServer that delivers the events in the domain_events outbox table to their handlers.

Prunes the outbox on a timer (DDD.Outbox.Retention). Started by DDD.Supervisor when it is given retention: [older_than_days: 30]; :every_ms sets how often (default: hourly).

Deleting old events from the outbox, so domain_events doesn't grow forever.

One numbered page of a listing, with the totals. Returned by page/1 on repository adapters and projections

The declared input of a use case: the fields, descriptions and validation that DDD.Command and DDD.Query share.

A read model: a denormalized table kept up to date by domain events.

A query is the input of one read use case, and it carries its own handler.

Port (interface) for DDD Repositories.

Auto-generates a full Ecto repository adapter from a DDD.Repository port.

Converts nested entities to JSON-ready maps and back.

A window of a listing that continues from a cursor (keyset pagination). Returned by slice/1 on repository adapters and projections

Specification pattern: a named, reusable, composable business rule.

Starts what the framework needs at runtime, in the right order: the event bus, the handler subscriptions, the outbox poller and the dead-letter handler. Put it in your supervision tree after your repo

The :telemetry events the framework emits, in one place.

Helpers for testing an application built on the framework.

The field types of entities, aggregates and value objects, and everything the framework does with them: checking a value, storing it in Postgres, and writing it as JSON.

Ecto type behind the :json field type: any JSON term (map or list) in a jsonb column. Ecto's own :map refuses lists.

Behaviour and macros for Domain-Driven Design Value Objects.

Mix Tasks

Generates the Ecto migration for an aggregate stored by DDD.Repository.Ecto.

Generates an Ecto migration for the DDD outbox domain_events table.

Prints DDD.Health.check/1 and exits non-zero unless everything is ok, so it can run as a deploy gate or a container health probe.

Serves a DDD.MCP.Server module as a Model Context Protocol server on standard input and output, for an AI client to launch

Lists events the outbox gave up delivering (infrastructure failures that kept recurring).

Resolves a dead-lettered event as discarded: it stays in the table for the record, but nothing will deliver it.

Deletes events older than a number of days from the outbox (DDD.Outbox.Retention).

Makes the outbox retry dead-lettered events from scratch.

Empties a projection's table and replays every stored event into it, in order.