Docs

Guides

One task per page, each with code that compiles against the lith of this site's commit and runs in its tests.

The guides follow one app: boards of lanes that hold cards, the domain of lith's own benchmarks. Its code is in site/internal/docs/example in lith's repository, compiled and tested with the site: board holds the commands, the queries and the schema, web the handlers, the views and the page, tenants a pool of databases, and backup the Litestream wiring, in a module of its own. A listing with a file name above it is a piece of that code, of lith's template or of this site, and the docs' tests fail when the file no longer holds it.

Guide What it covers
Commands and the writer Send, Do, DoValue, validation, topics, refusals, op ids with Once and OnceResult, AfterCommit, in-process listeners with Publish and Subscribe, the statement cache
Event sourcing streams and event types, deciders with Execute, expected versions, inline and catch-up projectors, rebuilds, reads as of a position, upcasting, retention, eventstest
Migrations, jobs and imports the schema's files, Exclusive, bulk imports, background jobs, sweeps, checkpoints
Reads View and ViewValue, query code shared through sqlite.Querier, WithTx, Uncached, caches against a version, the read pool
Views and the hub keys and topics, a topic hierarchy, topics declared with Depends, a tab that navigates, Presence, Every, Watch and Unwatch, Spec.WriteTick, the heartbeat signal, MaxStreams
Pages and Datastar the document, the fat morph, tab state in SQLite, op ids and pending, reconnecting after a deploy
Streams and compression zstd and brotli, windows, the memory budget, hibernation, NoCompression, slow links
The request edge sessions, CSRF, the CSP and its nonce, client addresses, slow links, rate limits, compression, static files, health
One database per account tenant.Pool, a writer per account, views across accounts, erasure
Backups VACUUM INTO copies, Litestream with the backup module, restores
Metrics and monitoring lith/prom, dbmetrics, the Grafana dashboard, alerts, logs, probes, the files each app installs on a shared host
Deploying the systemd unit, Caddy, the deploy script with rollback, memory settings, the host's folders
Load testing loadtest.Run with an app's own views and commands, and how to read its report

The first command and view builds a smaller feature from scratch, and the package reference has every exported name.