MCPcopy Index your code
hub / github.com/dogmatiq/dogma

github.com/dogmatiq/dogma @v0.25.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.25.0 ↗ · + Follow
309 symbols 546 edges 33 files 186 documented · 60%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dogma

Build message-driven, event-sourced applications in Go.

Documentation Latest Version Build Status Code Coverage

Overview

Dogma is a comprehensive suite of tools for building robust message-driven applications in Go.

It provides an abstraction for describing your application's business logic with strict separation from the "engine" responsible for message delivery and persistence.

Features

  • Event sourcing — Dogma records every state change as an immutable event. This enables comprehensive auditing and allows you to build or rebuild read-optimized views from the event history at any time.

  • Grounded in Domain-Driven Design — Dogma adopts core concepts from DDD to guide how developers decompose application logic and how messages flow between components.

  • High-level testing — Dogma's testkit module encourages behavior-driven testing by helping you make assertions about message flow rather than application state. It integrates seamlessly with Go's standard testing package.

  • Native introspection — Dogma's static analysis tools visualize message flow and application structure, enabling discovery of domain events across large codebases and multi-application projects.

  • Domain and infrastructure separation — Dogma's API enforces a clean separation between application logic and infrastructure concerns such as message delivery, persistence, and telemetry.

  • Type-agnostic — Dogma lets you represent messages and application state using any Go types that implement the standard [BinaryMarshaler] and [BinaryUnmarshaler] interfaces.

  • Flexible persistence — Dogma supports a range of storage options including PostgreSQL and Amazon DynamoDB, enabling use across diverse environments.

Ecosystem

Dogma is a collection of Go modules that together provide the tools needed to build, test, analyze, and run message-driven applications.

  • dogma — Defines the API for building applications.
  • testkit — Utilities for testing Dogma applications.
  • projectionkit — Utilities for building projections in popular database systems.

Engines

An important Dogma concept is that of the engine — a Go module embedded within your application binary that orchestrates message delivery, state persistence, and the execution of application logic.

  • verity — The original Dogma engine, designed for typical application loads in smaller deployments. While production-ready, it doesn't support scaling of a single application across multiple machines.

  • runkit — The next-generation Dogma engine built for horizontal scalability and distributed workloads. The Dogma maintainers intend for runkit to fully replace Verity, becoming the production Dogma engine.

  • testkit — A set of tools for testing Dogma applications. It includes an in-memory engine that allows inspection of application behavior without persisting state.

Why Dogma?

The name is a tongue-in-cheek nod to the project's strong opinions about how best to structure message-driven applications. It's not about rigid rule-following, but about embracing consistent patterns that enable rich tooling and clarity in complex systems — without sacrificing flexibility where it matters.

Getting started

If you're new to Dogma, we recommend starting with the concepts document to gain a solid understanding of the core ideas and terminology used throughout the ecosystem.

You can also explore the example application for a practical, working implementation that demonstrates key concepts in action.

For reference material, please see the API documentation and glossary.

Extension points exported contracts — how you extend this code

MessageRoute (Interface)
MessageRoute is an interface for types that describe a relationship between a message handler and a specific message typ [5 …
messageroute.go
HandlerRoute (Interface)
HandlerRoute is an interface for types that represent a relationship between the [Application] and a message handler. U [4 …
handlerroute.go
ProcessRoute (Interface)
ProcessRoute describes a message type that's routed to or from a [ProcessMessageHandler]. [3 implementers]
process.go
ExecuteCommandOption (Interface)
ExecuteCommandOption is an option that modifies the behavior of [CommandExecutor].ExecuteCommand. [2 implementers]
executor.go
Application (Interface)
An Application defines a collection of message handlers that work together to implement a specific business domain. An [2 …
application.go
AggregateRoute (Interface)
AggregateRoute describes a message type that's routed to or from a [AggregateMessageHandler]. [2 implementers]
aggregate.go
IntegrationRoute (Interface)
IntegrationRoute is an interface for types that represent a relationship between an [IntegrationMessageHandler] and a me [2 …
integration.go
ProjectionRoute (Interface)
ProjectionRoute describes a message type that's routed to a [ProjectionMessageHandler]. [1 implementers]
projection.go

Core symbols most depended-on inside this repo

GoType
called by 11
messagetyperegistry.go
Handler
called by 8
handlerroute.go
New
called by 8
process.go
qualifiedNameOf
called by 6
messagetyperegistry.go
Type
called by 5
messageroute.go
HandleDeadline
called by 5
process.go
WithEventObserver
called by 4
executor.go
UnwrapHandler
called by 4
handler.go

Shape

Method 156
Function 60
Interface 52
Struct 38
TypeAlias 2
FuncType 1

Languages

Go100%

Modules by API surface

process.go44 symbols
messageroute.go28 symbols
aggregate.go27 symbols
messagetyperegistry.go23 symbols
projection.go22 symbols
handlerroute.go22 symbols
message.go20 symbols
process_test.go18 symbols
executor.go12 symbols
handler.go11 symbols
aggregate_test.go11 symbols
integration.go10 symbols

For agents

$ claude mcp add dogma \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact