The Chronicle Web template
The cratis-chronicle-web template is a minimal ASP.NET Core application connected to Chronicle. It is deliberately small: two endpoints, one event, one projection — the server-side skeleton without Arc, without a frontend, and without anything else in the way.
dotnet new cratis-chronicle-web -n MyApiThese templates scaffold a Chronicle client — pass --Database (MongoDB by default, or PostgreSQL, MsSql, SQLite) to choose which database the Chronicle kernel in docker-compose.yml persists to.
What you get
Section titled “What you get”A Program.cs with the Cratis middleware wired and two minimal API endpoints:
var builder = WebApplication.CreateBuilder(args) .AddCratisChronicle();
var app = builder.Build();
app.UseCratisChronicle();
app.MapGet("/", (IEventLog log) => log.Append(Guid.NewGuid().ToString(), new TestEvent("Hello, Chronicle!")));app.MapGet("/projection", (IReadModels readModels) => readModels.GetInstances<TestProjection>());
app.RunAsync();Run it
Section titled “Run it”Start the infrastructure, run the app, and hit the two endpoints:
docker-compose up -ddotnet run
curl http://localhost:5000/ # appends a TestEvent to the logcurl http://localhost:5000/projection # reads the projected read modelWhat it is for
Section titled “What it is for”Use this template when you know you want Chronicle inside an ASP.NET Core service and you would rather grow the application yourself. When you want model-bound commands and queries with routes and TypeScript proxies handled for you, that is the Cratis Web Application template.
AI assistance
Section titled “AI assistance”The scaffolded project includes a .cratis/ai.json with the Cratis AI profiles, languages, and coding agent harnesses for this template — the Chronicle-on-.NET selection. Make sure the Cratis CLI is installed, then run:
cratis ai updateThat installs the AI rules, skills, and harness integration for the coding agents you selected — AGENTS.md instructions plus .claude/, .cursor/, .github/, .opencode/, and .pi/ integration — and records what it installed in .cratis/ai.manifest.json. dotnet new prints this reminder after scaffolding, and re-running the command only refreshes Cratis-managed files, never yours. See the CLI AI documentation for the full command reference.