Skip to content

Choose a Cratis sample

Cratis Samples gives you local examples to follow a recorded event, build a view from its history, or connect a typed backend to React. Choose the result you want below, then open that sample’s README for its setup and run commands.

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.

What you want to do Sample and repository path What to expect
Record a fact and read its history Chronicle Backend — Chronicle/Backend A small HTTP API, without projections or a frontend.
Turn the same events into views and a follow-up event Chronicle Processing — Chronicle/Processing Compare a projection that maps events into a view, a reducer that folds them into state, and a reactor that responds with another event.
Connect a typed backend to React without an event history Idea Loom — Arc/React Capture an idea and watch the board update. Its in-memory store clears when the backend restarts; it does not use Chronicle.
Follow one event-backed feature through to a React screen Author registration — Capstone Register an author and see the list update after Chronicle builds the read model, the view queried by the screen.
Explore separate applications in one local composition Library — Library Lending and membership applications with React, Arc, Chronicle, MongoDB, and local authentication. Not every backend flow has a screen.
Inspect a known processing failure Operations Diagnosis — Chronicle/OperationsDiagnosis Create a deliberate reactor failure, then inspect it with the Cratis command-line interface (CLI) and Workbench. The exercise stops before repair.

These six sample applications use C# backends. If that is your host and you are new to Chronicle, start with Backend before Processing. For a guided implementation with TypeScript, Kotlin, Java, and C# backends, follow Build a full-stack feature. For a smaller first example in TypeScript or Elixir without the .NET SDK, use First event and First projection.

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

The six examples above use the .NET 11 SDK. Their React frontends also need Node.js 23 or newer: Idea Loom and Library use the repository’s Yarn toolchain, while Capstone uses npm. Chronicle examples need Docker; Processing, Capstone, and Operations Diagnosis use Docker Compose. Backend, Processing, and Operations Diagnosis use curl for their HTTP calls. Library also needs Bash for its launch script. Operations Diagnosis requires a Cratis CLI version supporting the commands in its README.

Use the selected README for the working directory, infrastructure, and startup order. These differ between samples; Idea Loom, for example, needs no Chronicle container. The full catalog below comes from the repository’s samples.json and lists prerequisites for the other examples. Open each sample’s README for its limits.

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 Terminal

Learning path

Learn event sourcing step by step: append events, project a read model, serve it through Arc, react to checkout, specify behavior, evolve events, protect commands, and prepare for production.

ChronicleArc
  • Append events to the event log and read one event source's history back
  • Declare a projection with model-bound attributes and read the read model it builds
  • Turn the same events and read model into an Arc command and query API
Console · ASP.NET Core · 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
Focused Workbench and CLI

Chronicle Projection Styles

Build one order four ways and see where event counters differ from state-derived line counts.

ChronicleFundamentals
  • Compare model-bound attributes, a fluent projection, a stream-local reducer, and a PDL declaration
  • Join product names into keyed order lines and update the root timestamp from child-only events
  • Specify duplicate adds, quantity changes, removals, and cancellation without Docker
In-process read-model scenarios · ASP.NET Core · Chronicle Workbench

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
Focused React

Full-stack author registration

Register an author and watch the projected list update in a React screen.

ArcChronicleComponentsFundamentals
  • Return AuthorRegistered from the RegisterAuthor command
  • Project AuthorRegistered into an observable Author read model
  • Use generated command and query proxies in a React screen
ASP.NET Core · React · Chronicle · MongoDB

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

Event-model views

View an application's event model and review a model generated from source.

Focused Event-model board

Coffee counter — Arc runtime event model

Open an Arc + Chronicle application's embedded event model in the browser.

ArcChronicleScreenplayCratis CLI
  • Map the viewer explicitly in Development
  • Explore commands, events, and an orders projection
  • Use cratis view without starting the application or Chronicle
ASP.NET Core · Chronicle · MongoDB
Focused Event-model board

Community kitchen — from Marten and Wolverine

Generate, validate, and review an event-model starting point from original C# source.

ScreenplayCratis CLI
  • Generate with the critter-stack provider without starting PostgreSQL
  • Compare unchanged generated output with a separately reviewed model
  • Inspect explicit Marten writes and a Wolverine aggregate handler
ASP.NET Core · Marten · Wolverine · PostgreSQL

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
Focused None

Generated Values Shop

Declare server-owned identifiers once in a model, render them with Stage, write them by hand in Arc, and pin them in specs.

ScreenplayStageArcFundamentals
  • Choose a generation strategy per concept: prefixed ULID, TypeID, NanoID and random bytes
  • Keep generated identifiers out of the request with [GeneratedValue] Handle parameters
  • Use the command's received time for TypeID orders through IGeneratableInContext
Screenplay compiler and evaluator · Cratis CLI renderer · Arc command scenarios

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 11 SDK, Docker, curl
Chronicle TypeScript Client Terminal Chronicle Node.js, Chronicle Node.js 23 or newer, npm, Docker
Learning path Terminal Chronicle, Arc Console, ASP.NET Core, Chronicle .NET 11 SDK, Docker, curl
Chronicle Processing None Chronicle, Fundamentals ASP.NET Core, Chronicle .NET 11 SDK, Docker, curl
Chronicle Projection Styles Workbench and CLI Chronicle, Fundamentals In-process read-model scenarios, ASP.NET Core, Chronicle Workbench .NET 11 SDK, Docker and a browser only for the optional Workbench preview
Idea Loom — Arc + React React Arc, Components, Fundamentals ASP.NET Core, React .NET 11 SDK, Node.js 23 or newer, Yarn
Full-stack author registration React Arc, Chronicle, Components, Fundamentals ASP.NET Core, React, Chronicle, MongoDB .NET 11 SDK, Node.js 23 or newer, npm, Docker
Chronicle Multi-Tenancy None Arc, Chronicle, Fundamentals ASP.NET Core, Chronicle, MongoDB .NET 11 SDK, Docker, curl
Chronicle Cross-Store None Chronicle, Fundamentals ASP.NET Core, Chronicle .NET 11 SDK, Docker, curl
Chronicle with ASP.NET Core None Chronicle ASP.NET Core, Chronicle, MongoDB .NET 11 SDK, Docker, curl
Chronicle Operations Diagnosis Workbench and CLI Chronicle, Cratis CLI, Fundamentals ASP.NET Core, Chronicle, CLI, Workbench .NET 11 SDK, Docker, Cratis CLI, curl
Coffee counter — Arc runtime event model Event-model board Arc, Chronicle, Screenplay, Cratis CLI ASP.NET Core, Chronicle, MongoDB .NET 11 SDK, Docker, Browser
Community kitchen — from Marten and Wolverine Event-model board Screenplay, Cratis CLI ASP.NET Core, Marten, Wolverine, PostgreSQL .NET 11 SDK, VS Code or an MCP Apps-capable chat client or a browser
Model-First Library None Screenplay, Stage Screenplay compiler, Stage specification runner .NET 11 SDK, Built Screenplay checkout, Built Stage checkout
Generated Values Shop None Screenplay, Stage, Arc, Fundamentals Screenplay compiler and evaluator, Cratis CLI renderer, Arc command scenarios .NET 11 SDK
Library React Arc, Chronicle, Components ASP.NET Core, React, Aspire, Chronicle, MongoDB .NET 11 SDK, Node.js 23 or newer, Corepack/Yarn, Docker, Bash

Run the selected sample unchanged first and check the result described in its README. When Chronicle is involved, use Workbench or the CLI to inspect the recorded event. If the sample builds a read model, compare that view with the event history that produced it.

Then change one behavior and follow the sample’s verification commands before running the changed flow again. This lets you see which parts of the backend and screen need to change together.

A focused example keeps one behavior visible. Capstone covers author registration and listing, not a complete library application. Library brings lending and membership together but still uses local development infrastructure. Neither is a production template; follow the selected README’s local-development assumptions before adapting it.

If you encounter a package-version mismatch, report the failure in the Samples repository with the sample path and version details. A successful documentation-site build does not verify your local sample run.