Skip to content

Adopting Cratis

Getting oriented

Where to start

Cratis products stand on their own and compose when you want them to. For a new information system, our default is the full loop: Chronicle for event sourcing, Arc for CQRS, Components for React, and AuthProxy at the edge. For an existing system or a bounded current-state slice, you can adopt one piece at a time without losing the path back to the full stack.

Two things decide where you start: what you’re building on — a new codebase or an existing one — and which boundary you are changing first. Event sourcing is the default architecture we recommend for information systems; CQRS, generated contracts, and edge identity can still be adopted independently.

New information system

Bounded CRUD slice

Existing

Frontend/backend glue

Audit & history

New information system

or existing?

Default stack:

Arc + Chronicle + Components

Arc + Components

over MongoDB / EF Core

What hurts

most?

Add Arc to your app

Introduce Chronicle,

one slice at a time

Your situationStart withWhy
New information systemArc + Chronicle + ComponentsThe default Cratis loop: CQRS at the boundary, event history underneath, React generated from C# — the full-stack capstone builds the shape.
Bounded slice where current state is genuinely enoughArc + Components over a databaseTyped commands, queries, and a generated React client with CQRS but no event log — CQRS without event sourcing.
Existing .NET API, frontend glue is the painArc, added to your appA typed TS client for new endpoints, without rewriting what you have.
Existing system, you need history or auditChronicle, incrementallyEvent-source one bounded context; leave the rest as it is.
Need to separate CQRS from event sourcingRead firstCQRS without event sourcing, then Why developers choose Cratis.

A new project is the easy case — nothing to migrate, no constraints. For an information system, start with the whole loop unless you have a clear reason not to:

  • Default to the full experience. Scaffold the stack and follow getting started, then the full-stack capstone. You’ll have the command → event → projection → query → React loop running, with history available from the event log. Scaffolding wires Arc and Chronicle into one host through the Cratis package’s AddCratis/UseCratis.
  • Use Arc-only for deliberate current-state slices. If a bounded part of the app is just reference data, settings, or an adoption step, Arc over a database still gives you CQRS, generated proxies, and live queries. Because adopting Chronicle is a write-side change, that slice can move to events later without touching your queries or frontend.

You rarely get to start clean. Cratis is built to be adopted a slice at a time, alongside code that already works — you don’t rewrite, you grow into it.

If your pain is the frontend-to-backend boundary — hand-written controllers, DTOs duplicated in TypeScript, fetch wrappers that drift out of sync — Arc slots into an app you already have. Register it on your existing host and start expressing new endpoints as commands and queries; Arc generates their typed proxies while your existing controllers keep running untouched.

Arc’s persistence meets your data where it already lives: its MongoDB and Entity Framework integrations read and write the database you already use — EF Core even has a direct-registration path designed for slotting into an existing application without taking over the whole framework. For controllers and MediatR handlers, the MediatR, MVC, and Arc bridge maps familiar concepts onto Arc’s model.

Introduce Chronicle into an existing domain

Section titled “Introduce Chronicle into an existing domain”

If your pain is history — you need an audit trail, a “how did this order get into this state?” view, or a new read model the current schema can’t serve — you don’t have to event-source the whole system in one move. Pick the bounded context where the model is clearest and event-source that first:

  1. Model the facts for that area as events, and append them when the corresponding things happen — for new behavior, append the event; for existing writes, append alongside the current write.
  2. Build projections that fold those events into exactly the read models that context needs. They can sit right next to your existing tables.
  3. Let the rest of the system keep working as it is. Event sourcing earns its place one context at a time, not as a big-bang rewrite.

The CRUD, EF Core, and Chronicle guide maps tables and SaveChanges onto events — that’s the mental shift that makes this click.

However you start, the pieces are designed to be added, not swapped out. The common growth paths:

  • Arc-over-a-database → add Chronicle. Move a slice’s write side from a direct insert to appending an event with a projection behind it. The query and the React don’t change — see the side-by-side in CQRS without event sourcing.
  • Chronicle-only service → add Arc and a frontend. Already event-sourcing from a worker or service? Put Arc in front to expose typed commands and queries, and Components to render them — without changing how your events are stored.
  • Any backend → add Components. The React library consumes Arc’s generated proxies, so adding it is a frontend-only step.