Skip to content

Samples

Learn by running

Pick a journey. Open the code. Make it yours.

The samples keep the important parts close together: the intent, the events, the processing, and—where the sample has a frontend—the generated contracts and React experience.

Terminal window
# Choose a sample after cloning the repository
git clone https://github.com/Cratis/Samples.git
cd Samples

Learning track

Getting started

Meet Chronicle in a small application and follow an event from append to observation.

Start here None

Chronicle Backend

Append an immutable fact and read one event source's history through a focused HTTP API.

Chronicle
  • Configure one named Chronicle event store
  • Use ConceptAs and EventSourceId for clear domain values and identities
  • Read the stored history without introducing a projection
ASP.NET Core · Chronicle
Start here Terminal

Chronicle TypeScript Client

Append a fact from Node.js, let a reactor respond, and read the combined history.

Chronicle
  • Connect to Chronicle from Node.js with the @cratis/chronicle client
  • Append an immutable event and wait for its observers to catch up
  • Return a side-effect event from a reactor and read both facts back
Node.js · Chronicle
Start here None

Chronicle with ASP.NET Core

Host the same event-processing concepts behind a small HTTP API.

Chronicle
  • Configure Chronicle through ASP.NET Core dependency injection
  • Register reducers, projections, reactors, and query services
  • Append events through minimal HTTP endpoints
ASP.NET Core · Chronicle · MongoDB

Learning track

Event processing

Turn recorded facts into useful views and follow-up behavior with projections, reducers, and reactors.

Focused None

Chronicle Processing

See one event stream feed a projection, reducer, and reactor without timing guesses.

ChronicleFundamentals
  • Use ConceptAs values and an EventSourceId identity throughout the model
  • Compare a model-bound projection with a prior-state reducer
  • Return a deterministic follow-up event from a reactor
ASP.NET Core · Chronicle

Learning track

Full-stack CQRS

Build typed commands and observable queries from C# through generated contracts to React.

Focused React

Idea Loom — Arc + React

Build a polished command-and-query experience with generated contracts and no event sourcing.

ArcComponentsFundamentals
  • Use ConceptAs values and validators in a model-bound Arc command
  • Generate TypeScript command, query, and read-model contracts
  • Compose React MVVM, an observable query, and a Cratis CommandDialog
ASP.NET Core · React

Learning track

Boundaries and isolation

Keep tenant data and bounded contexts separate while allowing explicit, typed communication.

Focused None

Chronicle Multi-Tenancy

Use Arc header tenancy to isolate the same workflow in separate Chronicle namespaces.

ArcChronicleFundamentals
  • Resolve the tenant from Arc's standard header
  • Map tenant context to Chronicle namespaces
  • Use the same EventSourceId safely in tenant A, tenant B, and Default
ASP.NET Core · Chronicle · MongoDB
Advanced None

Chronicle Cross-Store

Connect two named event stores through a typed outbox, filtered inbox, and local translation.

ChronicleFundamentals
  • Keep Orders and Fulfillment in separate event stores
  • Forward one narrow contract through source outbox and target inbox
  • Translate the contract into a target-owned event and read model
ASP.NET Core · Chronicle

Learning track

Operations

Create a known local symptom and learn to inspect Chronicle before taking action.

Focused Workbench and CLI

Chronicle Operations Diagnosis

Create one deterministic failed partition and find it with the CLI and Workbench.

ChronicleCratis CLIFundamentals
  • Use typed probe identity and name values
  • Create one stable reactor failure
  • Inspect the event, observer, and failed partition without repair actions
ASP.NET Core · Chronicle · CLI · Workbench

Learning track

Model-first

Describe behavior as an executable model, compile it, and run its specifications.

Focused None

Model-First Library

Compile one Screenplay model and run its accepted and rejected examples through Stage.

ScreenplayStage
  • Describe concepts, a command, validation, and an event in one model
  • Keep accepted and rejected examples beside the behavior
  • Compile with Screenplay and run model specifications with Stage
Screenplay compiler · Stage specification runner

Learning track

Full applications

Explore how Cratis products fit together across backend, frontend, runtime, and local composition.

Showcase React

Library

Tour a larger Cratis application with separate lending and membership experiences.

ArcChronicleComponents
  • Organize behavior as cohesive vertical slices
  • Generate TypeScript contracts from backend commands and queries
  • Compose separate lending and membership applications for local development
ASP.NET Core · React · Aspire · Chronicle · MongoDB

At a glance

Compare the samples

Choose by experience, stack, and the tools you already have installed.

Sample Experience Products Runtime Prerequisites
Chronicle Backend None Chronicle ASP.NET Core, Chronicle .NET 10 SDK, Docker, curl
Chronicle TypeScript Client Terminal Chronicle Node.js, Chronicle Node.js 23 or newer, npm, Docker
Chronicle Processing None Chronicle, Fundamentals ASP.NET Core, Chronicle .NET 10 SDK, Docker, curl
Idea Loom — Arc + React React Arc, Components, Fundamentals ASP.NET Core, React .NET 10 SDK, Node.js 23 or newer, Yarn
Chronicle Multi-Tenancy None Arc, Chronicle, Fundamentals ASP.NET Core, Chronicle, MongoDB .NET 10 SDK, Docker, curl
Chronicle Cross-Store None Chronicle, Fundamentals ASP.NET Core, Chronicle .NET 10 SDK, Docker, curl
Chronicle with ASP.NET Core None Chronicle ASP.NET Core, Chronicle, MongoDB .NET 10 SDK, Docker, curl
Chronicle Operations Diagnosis Workbench and CLI Chronicle, Cratis CLI, Fundamentals ASP.NET Core, Chronicle, CLI, Workbench .NET 10 SDK, Docker, Cratis CLI, curl
Model-First Library None Screenplay, Stage Screenplay compiler, Stage specification runner .NET 10 SDK, Built Screenplay checkout, Built Stage checkout
Library React Arc, Chronicle, Components ASP.NET Core, React, Aspire, Chronicle, MongoDB .NET 10 SDK, Node.js 23 or newer, Corepack/Yarn, Docker, Bash
  1. Read its README. Each sample starts with the shape of the application and the shortest path to running it.
  2. Run the happy path. Make one change and follow it through the runtime.
  3. Open Chronicle Workbench when Chronicle is involved. Connect the source code to events, processing, and read-side state.
  4. Change one thing. Add a fact, a view, or a user interaction and see which parts of the slice move together.

A focused sample intentionally leaves things out so one concept stays easy to see. The larger applications show how those concepts meet in a real repository. Neither is a production template: use the exact sample README to understand its scope and local-development assumptions.