Skip to content

Latest commit

 

History

1,702 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cratis Samples

Runnable event sourcing and CQRS samples for the Cratis stack

From a small Chronicle event-sourcing process to a React application composed with Arc, Components, and Aspire — covering the Chronicle event store, Arc CQRS for ASP.NET Core, React Components, the CLI, Workbench, and the model-first Screenplay and Stage (experimental).

Build Update dependencies Documentation

Explore the samples · Run locally · Browse the documentation


Pick a sample

Sample Experience Products Start here
Chronicle Backend HTTP API Chronicle Append one immutable fact and read an event source's history.
Chronicle TypeScript Client Terminal Chronicle Append a fact from Node.js, let a reactor respond, and read the history.
Chronicle Processing HTTP API Chronicle, Fundamentals Compare a projection, reducer, and reactor on one event stream.
Idea Loom — Arc + React React Arc, Components, Fundamentals Follow a typed command and observable query from C# to a polished UI.
Chronicle Multi-Tenancy HTTP API Arc, Chronicle, Fundamentals Isolate the same typed workflow across tenant namespaces.
Chronicle Cross-Store HTTP API Chronicle, Fundamentals Connect two event stores through an outbox, inbox, and local translation.
Chronicle Operations Diagnosis CLI + Workbench Chronicle, CLI, Fundamentals Create one known failure and learn to inspect it before repair.
Chronicle with ASP.NET Core HTTP API Chronicle Host Chronicle through dependency injection and expose focused endpoints.
Model-First Library Executable model Screenplay, Stage Compile one modeled workflow and run its accepted and rejected examples.
Library React + APIs Arc, Chronicle, Components Explore separate lending and membership applications under one local composition.

Tip

Start with Chronicle Backend for the smallest HTTP path, then open Chronicle Processing to compare projections, reducers, and reactors. Move to Library when you want generated TypeScript contracts and React.

What the journey looks like

Arc:         command → current-state store → observable query → React
Chronicle:   append → event history → projections / reactions → views
Model-first: .play model → Screenplay compiler → Stage specifications

Choose the path matching what you want to learn. The focused samples keep one idea in view; Library brings several paths together in a larger application.

  • Arc — CQRS for ASP.NET Core: typed commands, observable queries, and TypeScript proxy generation. Arc documentation
  • Chronicle — the event store: append immutable events, then build projections and reactions over the history. Chronicle documentation
  • Model-first (experimental) — describe a workflow in a Screenplay model and let Stage render it into a runnable application.

Run locally

You will need

  • .NET 10 SDK
  • Docker or another compatible container runtime
  • Node.js 23 or newer for the React applications
  • Corepack/Yarn for frontend work

Clone the repository and validate the catalog:

git clone https://github.com/Cratis/Samples.git
cd Samples
corepack enable
yarn install
yarn samples:validate
yarn lint:ci
yarn build

Build the .NET samples:

dotnet restore Samples.slnx
dotnet build Samples.slnx --configuration Debug
dotnet test Samples.slnx --configuration Debug --no-build
dotnet build Samples.slnx --configuration Release -p:CratisProxiesOutputPath=

Each sample README contains its own infrastructure and run commands, a short tour of the code, and ideas to try next.

How the repository is organized

Arc/             standalone Arc and React samples
Chronicle/       focused Chronicle samples
ModelFirst/      executable Screenplay and Stage samples
Library/         the larger React and multi-service showcase
samples.json     the catalog used by repository checks and the documentation site
scripts/         catalog and repository checks

The catalog is deliberately machine-readable. The Cratis documentation sample roster is generated from it so descriptions and source links stay aligned with the runnable projects. A sample can add previewUrl and previewLabel when a real read-only experience, such as an event-model viewer, is available.

Samples are for learning

These projects favor clarity and visible behavior. They demonstrate exact, documented combinations of Cratis packages and local infrastructure; they are not production templates or support commitments. Every sample calls out the pieces it intentionally leaves out.

Contributing a sample

A sample should be enjoyable to explore and easy to understand:

  1. Give it one clear learning goal.
  2. Keep it independently runnable.
  3. Include an inviting README.md with an architecture sketch, exact commands, expected behavior, and a few ideas to try.
  4. Add tests for the behavior the sample teaches.
  5. Add the entry to samples.json.
  6. Run yarn samples:validate and the sample's own build and test commands.

The wider Cratis ecosystem

These samples are part of Cratis — free, MIT-licensed tools for building event-sourced and CQRS applications.

Everything Cratis publishes today is MIT licensed and free to use.


Build something, change it, and watch the model and runtime tell the same story.

About

Runnable event sourcing and CQRS samples for the Cratis stack — Chronicle, Arc, Components, CLI, and Workbench.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages