---
title: The Chronicle Web template
description: A minimal ASP.NET Core application wired to Chronicle — events in over HTTP, projections out, no frontend.
---


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.

```bash
dotnet new cratis-chronicle-web -n MyApi
```

These 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

A `Program.cs` with the Cratis middleware wired and two minimal API endpoints:

```csharp
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

Start the infrastructure, run the app, and hit the two endpoints:

```bash
docker-compose up -d
dotnet run

curl http://localhost:5000/           # appends a TestEvent to the log
curl http://localhost:5000/projection # reads the projected read model
```

## 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](/templates/cratis-web/) template.

## 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](/cli/) is installed, then run:

```bash
cratis ai update
```

That 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](/cli/ai/) for the full command reference.
