Practice in logic and debate on the "path of reasoning" (rigs lam), for Dudra and Tarig, a few minutes at a time. Relations compares two terms (pick the relation, then give an example for each case that exists); Pervasions asks the four debate questions about a pair; Find a pair turns the first round around (a relation is named, you name two terms that have it); Syllogisms takes a subject, a predicate and a reason; Categories and Find an instance work from one example; Sprint is an option that puts a clock on each step.
One source builds two things:
| Build | What it is | Command | Output |
|---|---|---|---|
| PWA | The installable app: works offline, keeps answers on the device (IndexedDB), self-hosted fonts. | npm run build:pwa |
dist/pwa/ |
| Artifact | The same page as one self-contained HTML file for the Claude artifact frame, where design and logic are iterated through comments and Claude's own db and sample capabilities. |
npm run build:artifact |
dist/artifact/index.html |
nvm use # Node 22
npm ci
npm run dev # the PWA with hot reload at http://localhost:5173 (open it once as .../#k=<key> to unlock the definitions);
# Explain and the chat work with a stand-in for the model, ?ai=off shows the app without it
npm run build # both builds (the artifact build needs the course data, see docs/DATA.md)
npm test # builds, then unit tests and browser tests (needs Chromium: npx playwright install chromium)
npm run check:fast # lint, typecheck and unit tests: seconds, no browser
npm run check # lint, typecheck + everything aboveIn the Claude desktop app, "Preview" starts the same dev server and shows it in the Browser pane (.claude/launch.json).
index.html PWA entry (the page markup is included from src/app/markup.html)
src/app/ the page, shared by both builds: app.js (entry), state.js, feature modules in folders, app.css (an index of styles/*.css), markup.html
src/data/ the open term data (the definitions and notes are on the server, docs/DATA.md)
src/ai-shared/ the tutor's card, prompts and lookup tools as pure TypeScript functions of the term data (used by the page; a server can use them too)
src/domain/ the rules of the practice (pairs and their draw, grading, Claude's verdicts) as pure TypeScript functions of the term data
src/platform/ the Platform interface (data, `db`, `sample`, `account`) that each build implements
src/account/ optional accounts on the device: the contract with the server, the sync engine, the passkey code (docs/SERVER.md)
src/pwa/ PWA only: platform adapter, local `db` (IndexedDB), account client, key dialog, service worker registration, fonts
src/artifact/ artifact only: platform adapter (embedded data, `window.claude`), head (title, font links)
worker/ the server: a Cloudflare Worker for /api/* (tutor access check, spend budgets, optional passkey accounts and document sync, flag reports and their scheduled review), D1 schema
src/ai/ the contract between page and server (protocol, access proof), shared by both
scripts/ build-artifact, artifact-verify, data (key, import, export), fonts, icons, social (the hero pictures and the link preview), Vite plugins
tests/unit/ Vitest unit tests (artifact comparison, artifact and PWA build contracts, the data tiers, the shape of src/app, the tutor code in src/ai-shared, the rules in src/domain)
tests/worker/ Vitest tests of the server with stand-ins for D1 and the model API
tests/e2e/ Playwright: the PWA specs and the parity of the two builds
public/ icons
docs/ developing, architecture, term data and key, artifact loop, deploy, releasing, testing; images/ has the README hero and the link preview picture
.github/workflows/ CI, release
- Developing: where a change goes, the rules the tests enforce, what to run before a pull request.
- Architecture: how one source becomes two builds, the runtime seam, data, storage.
- The artifact loop: how iterating in the Claude artifact keeps working, and how changes flow into this repo.
- Testing: the layers, how to run them.
- The term data: open and course parts, the Magic Key, how to refresh them.
- Deploy: hosting, previews, one-time setup.
- The server: the tutor Worker, access proof, budgets, accounts and sync, setup, tests.
- Releasing: conventional commits and release-please.
Released: the version is in the app (Settings, About) and each release is on the releases page. Answers stay on the device; an optional account (a passkey) keeps them in step between devices. The definitions and notes are not in this repository: a device that has the Magic Key gets them from the server (docs/DATA.md), and the same server answers the features that ask Claude (explanations, checking an answer, the chat), takes flag reports and reads aloud (docs/SERVER.md). Without the key the app works with the open term data only.
It is a personal project: it does not replace practicing together or with a teacher, it is not affiliated with any course and not endorsed by any organization, and its mistakes are the author's.
Licence: AGPL-3.0, see LICENSE. The self-hosted fonts in src/pwa/fonts (Inter, EB Garamond, Sorts Mill Goudy, Merriweather, Noto Sans Math, Noto Serif Tibetan, Noto Serif Devanagari, Noto Serif SC) are distributed under the SIL Open Font License 1.1 by their authors, via Google Fonts; their notices and the licence text are in public/licenses/fonts-OFL.txt, which the app serves at licenses/fonts-OFL.txt.