What it is
Dragon's Lair is the app we use at our D&D table (5.5 rules): everyone has their sheet on the phone, the master has his tools on the laptop, and the campaign lives in one place. We play in person: maps, miniatures and dice stay on the table. It is not a virtual tabletop.
What it does
- Computed sheet. Armor Class, hit points, rolls, spells, resources: the app counts the numbers from the rules, and each says where it comes from. Only the master can force them, and the override stays on record.
- Characters. Guided level 1 creation, levelling up that keeps your choices, a printout on two A4 pages like the Player's Handbook sheet.
- The evening. Prepared encounters, initiative and turns, effects that expire by themselves, the Concentration save asked on the player's phone, proposals between players that the master accepts or refuses, loot.
- The campaign. Codex, journals, an atlas with fog, messages, a searchable compendium of the books.
- Who sees what. Every log line has a version for the master and one for the others. The master hides codex entries, parts of the compendium, secrets and masked items; to someone who shouldn't know, the app answers 404, as for a thing that doesn't exist.
- Assistant. An MCP server: an AI assistant reads the compendium and works on the campaign under the master's rules, and every change can be undone.
Italian and English; the books' data stays in English.
Architecture
format → engine → contract → api → web, in one repository:
- format: the schemas of the
.lairformat (12 kinds of entry, the rules' bricks, a small formula language). A book is a package of JSON files, validated before it reaches the table. - engine: the rules engine, pure code with no I/O: it takes the character and the packages and returns every number with its reason.
- contract: the API's endpoints and answers, described with zod.
- api: Hono on Postgres.
- web: React + Vite. The web never recomputes a rule: it shows the engine's numbers. A CI check makes sure the boundaries between packages stay where they are.
Stack
TypeScript, Deno, Hono, React + Vite, Postgres, zod.
In numbers
| Area | Lines of TypeScript (tests excluded) |
|---|---|
| engine | ≈ 16,600 |
| format | ≈ 10,900 |
| contract | ≈ 14,600 |
| api | ≈ 60,100 |
| web | ≈ 76,100 |
| Total | ≈ 178,000 |
Deploy
Coolify on my server: database, API and web. The development branch is the test environment with an invented demo campaign (the one behind the link) and updates by itself when CI is green. release is the table: I publish it myself, after a backup; database backups are automatic.
Licence and rights
The code is AGPL-3.0. The app, the engine and the format are public. The books are not: the text comes from 5etools and the rights belong to Wizards of the Coast. The book packages live in a private repository and never enter the public repository or the app's images. The mechanics in the packages are mine; this presentation shows only names and formulas, never the books' text.
What stays private
The books, and the campaign's and players' data.