Cratis.Chronicle.AspNetCore
15.7.0
Prefix Reserved
dotnet add package Cratis.Chronicle.AspNetCore --version 15.7.0
NuGet\Install-Package Cratis.Chronicle.AspNetCore -Version 15.7.0
<PackageReference Include="Cratis.Chronicle.AspNetCore" Version="15.7.0" />
<PackageVersion Include="Cratis.Chronicle.AspNetCore" Version="15.7.0" />
<PackageReference Include="Cratis.Chronicle.AspNetCore" />
paket add Cratis.Chronicle.AspNetCore --version 15.7.0
#r "nuget: Cratis.Chronicle.AspNetCore, 15.7.0"
#:package Cratis.Chronicle.AspNetCore@15.7.0
#addin nuget:?package=Cratis.Chronicle.AspNetCore&version=15.7.0
#tool nuget:?package=Cratis.Chronicle.AspNetCore&version=15.7.0
<div align="center"> <a href="https://cratis.io"> <img src="full-logo.png" alt="Cratis Chronicle" width="480"> </a>
<h3 align="center">Cratis Chronicle</h3>
<p align="center"> An Event Sourcing database for .NET — built with ease of use, productivity, compliance, and maintainability in mind. <br /> <a href="https://cratis.io"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="https://github.com/cratis/samples">View Samples</a> · <a href="https://github.com/cratis/chronicle/issues/new?labels=bug">Report a Bug</a> · <a href="https://github.com/cratis/chronicle/issues/new?labels=enhancement">Request a Feature</a> · <a href="https://discord.gg/kt4AMpV8WV">Join the Discord</a> </p>
<p align="center"> <a href="https://discord.gg/kt4AMpV8WV"> <img src="https://img.shields.io/discord/1182595891576717413?label=Discord&logo=discord&color=7289da" alt="Discord"> </a> <a href="http://nuget.org/packages/cratis.chronicle"> <img src="https://img.shields.io/nuget/v/Cratis.Chronicle?logo=nuget" alt="NuGet"> </a> <a href="https://hub.docker.com/r/cratis/chronicle"> <img src="https://img.shields.io/docker/v/cratis/chronicle?label=Chronicle&logo=docker&sort=semver" alt="Docker"> </a> <a href="https://github.com/Cratis/Chronicle/actions/workflows/dotnet-build.yml"> <img src="https://github.com/cratis/Chronicle/actions/workflows/dotnet-build.yml/badge.svg" alt="C# Build"> </a> <a href="https://github.com/Cratis/Chronicle/actions/workflows/publish.yml"> <img src="https://github.com/cratis/Chronicle/actions/workflows/publish.yml/badge.svg" alt="Publish"> </a> <a href="https://github.com/Cratis/Documentation/actions/workflows/pages.yml"> <img src="https://github.com/Cratis/Documentation/actions/workflows/pages.yml/badge.svg" alt="Documentation site"> </a> </p> </div>
📖 Table of Contents
- 📖 Table of Contents
- 🧭 About
- ✨ Key Features
- 🚀 Getting Started
- 🏛️ Architecture
- 📚 Documentation
- 🤝 Contributing
- 💬 Support
- 📊 Repository Stats
- 📄 License
- 🙏 Acknowledgements
🧭 About
Cratis Chronicle is an Event Sourcing database that captures every state change in your system as an immutable sequence of events — rather than storing only the current state. This unlocks powerful capabilities like full audit trails, time-travel debugging, and event-driven architectures without the usual complexity.
Chronicle ships with:
- 🖥️ Chronicle Kernel — the server that manages event storage, processing, and querying
- 📦 .NET Client SDK — a rich C# library for interacting with Chronicle from any .NET application
- 🌐 Web Workbench — a built-in management dashboard for monitoring, browsing events, and administration
- 🗄️ MongoDB Backend — optimized storage layer with an extensible model for other data stores
For core values and principles, read our core values and principles.
✨ Key Features
🏗️ Event Sourcing Foundation
| Immutable Event Store | Every state change is persisted as an immutable event — nothing is ever overwritten |
| Event Streams | Organized per aggregate or entity, with full history preservation |
| Schema Evolution | Strongly-typed event definitions with support for evolving schemas over time |
| Rich Metadata | Timestamps, correlation IDs, causation IDs, and custom tags on every event |
🎯 Real-time Processing
| Reactors | React to events as they occur — ideal for side effects and if-this-then-that scenarios |
| Reducers | Imperatively transform events into typed read models, managed by Chronicle |
| Projections | Declarative, fluent read-model builders with join, set, and remove support |
| Observers | Low-level event subscriptions with guaranteed delivery |
🛡️ Enterprise Ready
| Multi-tenancy | First-class namespace support for isolated tenant data |
| Constraints | Server-side integrity rules enforced at append time |
| Compliance | Full audit trails and data lineage for regulatory requirements |
| Revision | Built-in support for correcting past events |
🚀 Developer Experience
| Convention-based | Minimal configuration — artifacts are discovered automatically by naming convention |
| DI Native | First-class support for ASP.NET Core dependency injection |
| Strong Typing | End-to-end C# types from events through projections to read models |
| Testing Utilities | In-memory providers and test helpers for unit and integration testing |
🚀 Getting Started
Prerequisites
Installation
Run Chronicle and MongoDB with Docker Compose:
services:
mongo:
image: mongo:6
ports:
- "27017:27017"
chronicle:
image: cratis/chronicle:latest
ports:
- "35000:35000" # gRPC / API
- "8080:8080" # Web Workbench
environment:
- CONNECTIONSTRINGS__EVENTSTORE=mongodb://mongo:27017
depends_on:
- mongo
docker compose up -d
Add the NuGet package to your .NET project:
# ASP.NET Core
dotnet add package Cratis.Chronicle.AspNetCore
# Console / Worker Service
dotnet add package Cratis.Chronicle
Quick Example
ASP.NET Core setup (Program.cs)
var builder = WebApplication.CreateBuilder(args)
.AddCratisChronicle(options => options.EventStore = "MyApp");
var app = builder.Build();
app.UseCratisChronicle();
app.Run();
Define events
[EventType]
public record UserOnboarded(string Name, string Email);
[EventType]
public record BookAddedToInventory(string Title, string Author, string ISBN);
Append events
// Inject IEventLog or grab it from the event store
await eventLog.Append(Guid.NewGuid(), new UserOnboarded("Jane Doe", "jane@example.com"));
await eventLog.Append(Guid.NewGuid(), new BookAddedToInventory("Domain-Driven Design", "Eric Evans", "978-0321125217"));
React to events (Reactor)
public class UserNotifier : IReactor
{
public async Task Onboarded(UserOnboarded @event, EventContext context)
{
// send welcome email, provision resources, etc.
Console.WriteLine($"Welcome, {@event.Name}!");
}
}
Build read models (Reducer)
public class BooksReducer : IReducerFor<Book>
{
public Task<Book> Added(BookAddedToInventory @event, Book? current, EventContext context) =>
Task.FromResult(new Book(
Guid.Parse(context.EventSourceId),
@event.Title,
@event.Author,
@event.ISBN));
}
Declarative projections
public class BorrowedBooksProjection : IProjectionFor<BorrowedBook>
{
public void Define(IProjectionBuilderFor<BorrowedBook> builder) => builder
.From<BookBorrowed>(from => from
.Set(m => m.UserId).To(e => e.UserId)
.Set(m => m.Borrowed).ToEventContextProperty(c => c.Occurred))
.Join<BookAddedToInventory>(b => b
.On(m => m.Id)
.Set(m => m.Title).To(e => e.Title))
.RemovedWith<BookReturned>();
}
Full working samples are available in the Samples repository.
🏛️ Architecture
┌──────────────────────────────────────────────────────────┐
│ Your .NET Application │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ Events · Reactors · Reducers · Projections │ │
│ └────────────────────────────────────────────────────┘ │
│ │
│ Chronicle Client SDK │
└─────────────────────────────┬────────────────────────────┘
│ gRPC
┌─────────────────────────────┴────────────────────────────┐
│ Chronicle Kernel │
│ │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────┐ │
│ │ Event Store │ │ Projection │ │ Web │ │
│ │ (MongoDB) │ │ Engine │ │ Workbench │ │
│ └────────────────┘ └────────────────┘ └────────────┘ │
└──────────────────────────────────────────────────────────┘
Chronicle follows a client-server model:
| Component | Description |
|---|---|
| Chronicle Kernel | Server that manages event storage, observer dispatch, projection processing, and querying |
| Client SDK | .NET libraries (Cratis.Chronicle / Cratis.Chronicle.AspNetCore) that connect your app to the Kernel |
| MongoDB Backend | Default event and read-model storage; extensible to other providers |
| Web Workbench | Browser-based dashboard available at http://localhost:8080 when running the development image |
📚 Documentation
Full documentation is available at https://cratis.io.
| Section | Description |
|---|---|
| Get Started | Quick-start guides for Console, Worker Service, and ASP.NET Core |
| Concepts | Events, projections, reactors, reducers, constraints, and more |
| Hosting | Production and development deployment options |
| Configuration | Client and server configuration reference |
| Contributing | How to build and contribute to Chronicle |
🤝 Contributing
Contributions are what make the open-source community an amazing place to learn, inspire, and create. Any contribution you make is greatly appreciated!
- Fork the repository
- Create a feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to the branch:
git push origin feature/AmazingFeature - Open a Pull Request
Looking for a good first issue? Check out the contribute page.
For detailed build and development instructions, see the contributing guide.
You can also browse the code directly in your browser:
💬 Support
| Channel | Details |
|---|---|
| 💬 Discord | Join the community on Discord for questions and discussions |
| 🐛 GitHub Issues | Report bugs or request features |
📊 Repository Stats
📄 License
Distributed under the MIT License. See LICENSE for full details.
🙏 Acknowledgements
- MongoDB — the default storage backend powering Chronicle
- Microsoft Orleans — distributed actor framework used in the Chronicle Kernel
- Louis3797/awesome-readme-template — README inspiration
- All our contributors and the open-source community ❤️
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Cratis.Chronicle (>= 15.7.0)
- Cratis.Chronicle.Connections (>= 15.7.0)
- Cratis.Fundamentals (>= 7.7.3)
- FluentValidation (>= 12.1.1)
-
net8.0
- Cratis.Chronicle (>= 15.7.0)
- Cratis.Chronicle.Connections (>= 15.7.0)
- Cratis.Fundamentals (>= 7.7.3)
- FluentValidation (>= 12.1.1)
- System.Text.Json (>= 9.0.13)
-
net9.0
- Cratis.Chronicle (>= 15.7.0)
- Cratis.Chronicle.Connections (>= 15.7.0)
- Cratis.Fundamentals (>= 7.7.3)
- FluentValidation (>= 12.1.1)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Cratis.Chronicle.AspNetCore:
| Package | Downloads |
|---|---|
|
Cratis
Simplified setup for Cratis Arc applications with Chronicle event sourcing and MongoDB storage |
|
|
Cratis.Chronicle.Orleans.InProcess
Package Description |
|
|
Cratis.Chronicle.XUnit.Integration
Package Description |
|
|
Cratis.Chronicle.InProcess
Package Description |
|
|
Cratis.Chronicle.Applications
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 15.7.0 | 41 | 3/19/2026 |
| 15.6.1 | 157 | 3/17/2026 |
| 15.6.0 | 67 | 3/17/2026 |
| 15.5.0 | 253 | 3/12/2026 |
| 15.4.4 | 115 | 3/11/2026 |
| 15.4.3 | 424 | 3/10/2026 |
| 15.4.0 | 186 | 3/9/2026 |
| 15.3.4 | 94 | 3/9/2026 |
| 15.3.3 | 99 | 3/7/2026 |
| 15.3.2 | 445 | 2/28/2026 |
| 15.3.1 | 552 | 2/24/2026 |
| 15.3.0 | 125 | 2/24/2026 |
| 15.2.22 | 339 | 2/24/2026 |
| 15.2.21 | 103 | 2/23/2026 |
| 15.2.20 | 115 | 2/23/2026 |
| 15.2.19 | 128 | 2/23/2026 |
| 15.2.18 | 108 | 2/22/2026 |
| 15.2.17 | 222 | 2/20/2026 |
| 15.2.16 | 120 | 2/20/2026 |
| 15.2.6 | 158 | 2/18/2026 |