Skip to content

Overview

Welcome to Emmett's documentation!

Emmett logo

What is Emmett?

Emmett is an opinionated yet flexible framework that implements Event Sourcing for Node.js applications. It focuses on composition rather than magic, providing lightweight abstractions and clear patterns that make Event Sourcing accessible and maintainable.

Main Features

FeatureDescription
Event-Centric ModelingStructured approach to modeling business processes through events
Multiple Event StoresBuilt-in support for PostgreSQL, EventStoreDB, MongoDB, SQLite, and In-Memory storage
Command Handling PatternsStandardized approach with the Decider pattern
Read ModelsBuilt-in projections to build read models from events
WorkflowsCoordinate multi-step processes with durable execution
Type SafetyFirst-class TypeScript support with structural typing
Web Framework IntegrationSeamless integration with Express.js and Fastify
Comprehensive TestingBDD-style testing with DeciderSpecification and ApiSpecification
TestContainers SupportDocker-based testing with pre-configured containers

Why Use Emmett?

Storage is cheap, but information is priceless.

Event Sourcing keeps all the facts that happened in your system as events. This provides observability of business processes and enables event-driven capabilities like building read models and easier integration between components.

However, implementing Event Sourcing can be challenging:

  • Learning curve for new developers
  • Uncertainty about code structure
  • Implementing event storage from scratch
  • Setting up proper testing strategies
  • Integrating with existing frameworks

Emmett solves these problems:

  • Reduces boilerplate with pragmatic abstractions
  • Provides clear patterns (Decider, Command Handler, Projections)
  • Includes ready-to-use event store implementations
  • Offers comprehensive testing utilities
  • Integrates with Express.js and Fastify

Quick Navigation

Getting Started

New to Emmett? Start here.

Guides

Learn key patterns and techniques.

Event Stores

Choose your persistence layer.

Resources

Learn more and get help.

Video Introduction

Watch a full introduction on building applications with Emmett:

Getting Help

Core Building Blocks

The API reference covers Emmett's core abstractions:

ConceptDescription
EventImmutable facts that happened in your system
CommandRequests to change state
Event StorePersistence layer for event streams
Command HandlerProcesses commands into events
DeciderPattern for business logic (decide + evolve)
ProjectionsBuild read models from events
WorkflowsCoordinate multi-aggregate processes

Documentation Structure

This documentation follows the Diataxis framework:

TypePurposeExamples
TutorialsLearning-oriented, step-by-stepGetting Started
How-to GuidesTask-oriented, problem-solvingTesting, Read Models
ReferenceInformation-oriented, technicalAPI Reference
ExplanationUnderstanding-oriented, conceptsChoosing an Event Store

See all blog articles for more tutorials and deep dives.