Overview
Welcome to Emmett's documentation!

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
| Feature | Description |
|---|---|
| Event-Centric Modeling | Structured approach to modeling business processes through events |
| Multiple Event Stores | Built-in support for PostgreSQL, EventStoreDB, MongoDB, SQLite, and In-Memory storage |
| Command Handling Patterns | Standardized approach with the Decider pattern |
| Read Models | Built-in projections to build read models from events |
| Workflows | Coordinate multi-step processes with durable execution |
| Type Safety | First-class TypeScript support with structural typing |
| Web Framework Integration | Seamless integration with Express.js and Fastify |
| Comprehensive Testing | BDD-style testing with DeciderSpecification and ApiSpecification |
| TestContainers Support | Docker-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.
- Quick Intro - Core concepts in 5 minutes
- Getting Started - Build your first app
Guides
Learn key patterns and techniques.
- Read Models - Build read models
- Testing - Test strategies
- Error Handling - Handle errors gracefully
- Workflows - Multi-step processes
Event Stores
Choose your persistence layer.
- Comparison - Which one to use?
- PostgreSQL - Production-ready
- EventStoreDB - Native Event Sourcing
- MongoDB - Document storage
- SQLite - Development & testing
Resources
Learn more and get help.
Video Introduction
Watch a full introduction on building applications with Emmett:
Getting Help
- Discord: Join the Emmett Community for questions and discussions
- GitHub Issues: Report bugs at event-driven-io/emmett
- Articles: Browse blog posts for in-depth tutorials
Core Building Blocks
The API reference covers Emmett's core abstractions:
| Concept | Description |
|---|---|
| Event | Immutable facts that happened in your system |
| Command | Requests to change state |
| Event Store | Persistence layer for event streams |
| Command Handler | Processes commands into events |
| Decider | Pattern for business logic (decide + evolve) |
| Projections | Build read models from events |
| Workflows | Coordinate multi-aggregate processes |
Documentation Structure
This documentation follows the Diataxis framework:
| Type | Purpose | Examples |
|---|---|---|
| Tutorials | Learning-oriented, step-by-step | Getting Started |
| How-to Guides | Task-oriented, problem-solving | Testing, Read Models |
| Reference | Information-oriented, technical | API Reference |
| Explanation | Understanding-oriented, concepts | Choosing an Event Store |
Featured Articles
- Announcing Emmett! - Introduction and design philosophy
- Event Sourcing on PostgreSQL - Setting up PostgreSQL
- Testing Event Sourcing - Comprehensive testing guide
See all blog articles for more tutorials and deep dives.