Documentation
How lith works, how to start a project on it, and the rules its apps follow.
lith is a Go module for web apps that keep their state in one SQLite file and draw their pages on the server. Its packages work together and are imported one by one: sqlite opens the database, writer applies every change, live renders the views and streams them, sse formats and compresses the streams, and edge handles a request before and after its handler.
lith owns that runtime and nothing above it. Routing stays with net/http, HTML with templ, and each app keeps its own pages and domain model. In the browser, Datastar sends the actions and morphs the HTML that the server streams back into the page.
Where to start
- Getting started makes a project from lith's template and runs it.
- Concepts explains the four ideas in the name: Linear writes, Immediate mode, Ticks, Hypermedia.
- The guides take one task each, from a command with an op id to a deploy with a rollback, with code that compiles against this site's lith.
- The Datastar notes list what goes wrong in the browser, and the review checklist what to look for before a release.
- Performance has the measured numbers, and the package reference every exported name.
- The demos run on this server, on lith, each with the code that does it.
Getting started
Make a project from lith's template, run it, and find your way around it.
Concepts
Linear writes, Immediate mode, Ticks, Hypermedia: what each idea means, and the package that keeps it.
Guides
One task per page, each with code that compiles against the lith of this site's commit and runs in its tests.
Datastar notes
The Datastar behaviours that cost the lith projects time, each with what you see, why it happens, and what to do. Written against Datastar 1.0.4, the version the template and this site vendor.
Performance
The numbers to plan a lith app with, measured on one machine in process, the settings they led to, and the commands that measure them again.
Package reference
Every exported name of lith's packages, with its signature and its doc comment.
Review checklist
What to check in a lith app before a release, and on every change to the database, a stream or a handler. Each check names the mistake, what it does in production, and an rg command that finds it.
Credits
The projects lith learned from and builds on, and what this site is made of.
Changelog
What each release of lith changed.