Skip to content

Cratis Platform learning paths

Choose a route for the work in front of you: reading a first projection, building a feature, evaluating a component, or operating a deployment. Each path orders the guides you need; you do not need to learn the whole platform before starting.

To see how events become a view, begin with First projection, a source walkthrough with TypeScript, Elixir, and C# tabs. Follow library events into a read model, a view shaped for a particular question. To build a working API and UI, go straight to Build a full-stack app. To assess one change without starting a rewrite, use Evaluate Cratis and Adopting Cratis. Operators, React developers, and contributors have their own routes below.

If you need to erase protected personal values while retaining event history, read Event sourcing and GDPR and Chronicle compliance for the mechanism and the responsibilities it leaves with your team. To set a stopping point for agent work and inspect the evidence behind progression, read the Cratis Direct overview; access opens in stages to enabled accounts, and the public Direct docs cover the Direct Agent Runner. These are focused explanations, not prerequisites for the learning paths.

Before implementing a feature, put the expected behavior where developers, domain experts, and product owners can discuss it. Commands, events, read models, and Given/When/Then scenarios can live together in a Screenplay model; supported scenarios run in its in-memory reference evaluator. Those checks do not verify the eventual application code.

  1. Read Event modeling to map the feature’s information flow.
  2. Use Cratis Screenplay to keep that model in a portable .play file. For collaborative editing, Cratis Studio is an optional paid workspace, not a requirement for the other paths.
  3. Follow Spec-driven development to connect model scenarios to separate implementation specifications.

A library records that a book arrived, was borrowed, and came back. The librarian wants a simpler answer: which books are on loan now? Follow how Chronicle derives that view from recorded facts. Each fact is appended with an event source id identifying the book; a projection uses those facts to build its read model. Appending records the fact, while projection processing happens asynchronously. Wait for processing before reading a result that must include your change, then append another fact with the same id to change the view again.

The tabs below cover TypeScript, Elixir, and C#, using existing examples from the Chronicle tutorial. They are source excerpts, not a standalone application. To run them, first follow Chronicle getting started and your client’s setup guide. For other languages, choose a client there and check the support matrix; not every client supports the projection and completion APIs shown here.

The first fact records a book’s title and ISBN:

using Cratis.Chronicle.Events;
[EventType]
public record BookAdded(string Title, string Isbn);

View C# snippet source on GitHub

Borrowing records the member’s name. Returning needs no payload: the book’s event source id tells Chronicle which book came back.

using Cratis.Chronicle.Events;
[EventType]
public record BookBorrowed(string MemberName);
[EventType]
public record BookReturned;

View C# snippet source on GitHub

The read model describes the answer you want to query. Its projection maps the title and ISBN from the first fact, sets the loan flag when the book is borrowed, and clears that flag when it is returned. The book id connects all three facts to the same model instance.

using Cratis.Chronicle.Projections.ModelBound;
[FromEvent<BookAdded>]
public record Book(
BookId Id,
string Title,
string Isbn,
[SetValue<BookAdded>(false)]
[SetValue<BookBorrowed>(true)]
[SetValue<BookReturned>(false)]
bool OnLoan,
[SetFrom<BookBorrowed>(nameof(BookBorrowed.MemberName))]
string? BorrowedBy);

View C# snippet source on GitHub

Keep the id returned by this example. It is the event source id for later facts about this book, not a new id for each event.

using Cratis.Chronicle;
public static class TutorialFirstEventAppend
{
public static async Task<BookId> AddBook(IEventStore eventStore)
{
var book = BookId.New();
await eventStore.EventLog.Append(book, new BookAdded("The Pragmatic Programmer", "978-0135957059"));
return book;
}
}

View C# snippet source on GitHub

Distinguish append success from projection readiness

Section titled “Distinguish append success from projection readiness”

The append above records the book; it does not wait for its read model. When the caller needs to read its own change, check append success, wait for processing, and check the completion result before reading. A failed append has nothing to process, so a successful wait alone does not establish that the fact was recorded.

The following separate example shows the completion API with a generic event. Use this waiting pattern at the book append, rather than treating the append-only example as ready to read. In TypeScript, also check appendResult.isSuccess before calling waitForCompletion; that excerpt shows the completion check but omits the append-success check. Elixir combines append and wait in one call and returns either a completion result or an error.

using Cratis.Chronicle.Events;
using Cratis.Chronicle.EventSequences;
using Cratis.Chronicle.Observation;
[EventType]
public record ObservingAppendsSomeEvent(string Data);
public class ObservingAppendsCompletionWaiter(IEventLog eventLog)
{
public async Task AppendAndWait(EventSourceId eventSourceId)
{
var appendResult = await eventLog.Append(eventSourceId, new ObservingAppendsSomeEvent("example"));
// A failed append has nothing to wait for, and waiting on it reports success.
if (!appendResult.IsSuccess)
{
return;
}
var completion = await appendResult.WaitForCompletion();
if (!completion.IsSuccess)
{
foreach (var failedPartition in completion.FailedPartitions)
{
Console.WriteLine($"Observer {failedPartition.ObserverId} failed partition {failedPartition.Partition}");
}
}
}
}

View C# snippet source on GitHub

Do not continue to the read when append or completion fails. Waiting for observer completion explains timeouts and client differences: TypeScript and Elixir waits can include unrelated observers, so filtered observers can hold up a wait.

Read the model, then change it with another fact

Section titled “Read the model, then change it with another fact”

Once processing completes, query the read model. This query returns only books on loan: a newly added book is not in that result yet. The C# excerpt queries the MongoDB sink directly and needs the tutorial’s MongoDB client setup; TypeScript and Elixir read through the Chronicle client and filter the returned models.

using MongoDB.Driver;
public class Books(IMongoCollection<Book> collection)
{
public IEnumerable<Book> OnLoan() => collection.Find(b => b.OnLoan).ToList();
}

View C# snippet source on GitHub

Now follow the read-model chapter: append the borrowing fact with the same book id and a member’s name, wait for successful processing, and query again. The book is now on loan and appears in the result. Append the return fact with that id, wait again, and it leaves the on-loan result. The book remains in the catalog; the query filters it out because the projection cleared its loan flag. The recorded history still explains both changes.

For a different domain, the C# cart console example follows item counts and checkout through the same append, wait, and read sequence. Use its setup instructions and step README to run it.

If you have built applications that create, read, update, and delete records (CRUD), this path shows what changes when events become the source of truth. Work through a small domain, derive read models from its facts, and use the trade-off guides to decide where event sourcing is the wrong tool.

  1. Read Why event sourcing for the argument, then CRUD, EF Core, and Chronicle to map tables and SaveChanges onto events.
  2. Read Event modeling. It gives you the notation the rest of the docs use for commands, events, and read models.
  3. Build the Chronicle tutorial. It adds one concept at a time to a small library domain.
  4. Read Consistency and When to use event sourcing.
  5. Bring a modeling question to Community and help. Include the business decision you need to support and the facts you already have so others can follow the problem.

Finish one feature that records a change and shows its projected result in a live React screen, then extend it with validation and specifications. Use Chronicle for history, Arc for commands, queries, and generated contracts, and Components for React. The first guide offers C#, Kotlin, Java, and TypeScript backends; the later C# links below explain the .NET integration.

  1. Follow Build a full-stack feature. Use its backend-specific setup to add one slice end to end; the TypeScript path uses a sample rather than the .NET or JVM templates.
  2. Read Vertical slices to see why the feature lives in one folder.
  3. Work through the Arc tutorial for validation, related slices, live queries, and authorization. It runs over a plain database, which keeps the focus on commands, queries, and generated proxies.
  4. Read Add event sourcing to an Arc slice to see what changes when a slice’s writes move to Chronicle, and what does not.
  5. Continue with the vertical slices scenario for the state view, automation, and translation patterns, and Testing with Cratis for specs.
  6. Read Generate values with Screenplay, Stage and Arc to follow server-owned identifiers through the historical Shop sample and its pinned specifications. Check its toolchain limits before applying the example to a newer release; the recorded results are not a run of your application.

For Spring Boot setup, the Cratis Kotlin and Cratis Java templates scaffold the full-stack application. The Arc tutorial shows its main slice examples in Kotlin as well as C#; some backend snippets remain C# only. Use the matching backend guide rather than assuming every example has an equivalent.

When a command depends on a stock level, a limit, or a document someone else may edit, reading the state is only part of the problem. Another request can change it before yours writes. This path explains how to protect the decision and test two requests racing for the same result. Arc read protection needs Arc 22.106.0 or later, which uses Chronicle 19.71.0 or later.

  1. Read Keeping decisions correct. It explains why a read model can be stale at write time, what read protection does, and which mechanism holds which rule. If you know DCB, KurrentDB, Marten or Axon, read Read this first next.
  2. Follow Getting started with read protection to write your first protected command and see the error the losing request gets. Using Chronicle without Arc? Start from Decision reads instead.
  3. Work through the scenarios from simple to advanced. Each has the rule, the code and the guard it produces.
  4. Adopt it in an existing application with Adopting read protection: Off, then Measure, then On.
  5. Walk the whole stack in Decisions that hold, from model to frontend: one rule from a Screenplay model to an Arc command under read protection, a spec that makes the race happen, and a frontend that handles a lost race. For the idea behind it, read The Dynamic Consistency Boundary.
  6. Keep the reference close: Reads, Validators, Refusals, Pitfalls and the FAQ. For the mechanics, read How guards are derived and Read protection in Chronicle.

Choose your service’s Chronicle client before following the shared examples. This path starts with language-specific setup, then follows the shared flow from connecting to the kernel to appending events and reading their projected state where supported. Check each guide’s capability boundary rather than assuming every client implements the same features.

  1. Read Chronicle in your language to see which clients are published and where each is documented.
  2. Start a local kernel and follow the shared loop on Chronicle getting started. Its examples have a tab for each client that implements them.
  3. Follow your client’s setup guide: TypeScript, Kotlin and Java, Elixir, .NET, or Go. Go supports appends and event history reads, but not projections.
  4. Build the Chronicle tutorial and pick your client’s tab where one exists.

The Python client is not published yet; Event sourcing in Python tracks it.

Choose one feature where you need recorded history, another view of existing facts, or generated frontend contracts. Evaluate that bounded change before deciding whether to adopt more. This route gives architects and team leads the product boundaries, trade-offs, and operational questions to bring to that evaluation. Keep unanswered version and production questions alongside the slice you plan to try.

  1. Read Why developers choose Cratis, including when it is not a good fit.
  2. Read Adopting Cratis to pick an entry point for a new or existing system.
  3. Use Cratis Chronicle comparisons: choose an event-sourcing tool to find the .NET, JVM, or TypeScript comparison. For a specific alternative, read Marten vs Cratis Chronicle or KurrentDB vs Chronicle.
  4. Check the FAQ, Version compatibility, and Production readiness.
  5. Run one sample that matches the shape you would build.
  6. Ask adoption questions in Community and help, or Work with us for a dedicated review.

To deploy and run Chronicle, start with hosting and configuration before moving to diagnostics. This path covers storage and TLS choices, finding failed processing partitions, and planning an upgrade. Use the production checklist before treating a local setup as a deployment plan.

  1. Read Chronicle hosting and Production hosting.
  2. Review Chronicle configuration, including storage.
  3. Learn the CLI and the Workbench, then keep Chronicle troubleshooting close.
  4. Follow Collect Cratis telemetry to configure export from the application and kernel separately. Keep Observability in Cratis close for signal names, privacy boundaries, and client differences.
  5. Use Production readiness as the cross-stack checklist.
  6. Before each upgrade, use Plan an upgrade and What’s new. Follow Security for vulnerability reporting.

To build React forms and tables from backend contracts, or find typed usages affected by a contract change, start at the generated proxy boundary on your Arc-backed frontend. The backend must generate those contracts before Components can use them; this is not a frontend-only integration for an arbitrary API. Then build command forms, dialogs, and live tables without maintaining a second copy of the backend types.

  1. Read Understanding the proxy boundary to see where the generated TypeScript comes from and why you never edit it.
  2. Read Arc frontend.
  3. Build the Components tutorial, then use Choosing a component for new screens.
  4. Browse Storybook for live examples. Coming from PrimeReact? Read Coming from PrimeReact.
  5. Run a sample with a React frontend to see the screen and backend together.

To change Cratis itself, first find the repository that owns the behavior and its contribution rules. The same applies to code, documentation, and design proposals. Follow this route before preparing a pull request so the change and its checks stay with the owning product.

  1. Read Contributing and Governance.
  2. Find the repository that owns the behavior. Product pages are written in each product repository’s Documentation/ folder; only site-level pages such as this one live in the Documentation repository.
  3. Use Feedback and suggestions or Discord for early ideas before opening a large proposal.
  4. Run the owning repository’s build, specs, and documentation checks before opening a pull request.