App
Trivia Atlas is a fully static SvelteKit single-page application. It uses adapter-static with index.html as the SPA fallback. There is no application backend and no registered service port; nginx serves the generated files directly.
Build-time corpus
The build begins by running scripts/build-corpus.mjs. It reads the atlas repository and writes src/lib/corpus.json, then Vite bundles that generated file into the static app.
The generated object has this contract:
| Property | Contents |
|---|---|
built_at | ISO-8601 timestamp for snapshot generation. |
run | corpus_run_id and as_of_date copied from meta/run.json. |
categories | Ordered category slugs from meta/taxonomy.json. |
difficulties | easy, normal, and hard. |
buckets | Every <category>/<difficulty> key with accepted, remaining, and status. |
cards | Accepted public cards, each augmented with sources. |
Source entries retain only url and domain. They are joined to cards by ID from meta/verification.jsonl; a card without a matching sidecar record receives an empty source list.
Because corpus.json is generated before bundling, the deployed app is a snapshot rather than a live view of repository files.
Seeded runs
Quiz order is deterministic for a given seed:
xmur3hashes the seed string to a 32-bit number.mulberry32turns that number into the pseudorandom stream used for Fisher–Yates card shuffling.- Each card’s choices use a separate seed formed from the run seed and card ID.
The daily seed is exactly:
'daily:' + new Date().toISOString().slice(0, 10)The date is UTC, so every player receives the same ordered daily run of up to 10 cards on a given day. Bucket and mixed runs use fresh random UUID seeds instead.
Browser-local progress
The app stores progress in two best-effort localStorage records:
| Key | Value |
|---|---|
triv.v1.history | Per-card seen and correct totals, keyed by card ID. |
triv.v1.daily | Daily score and total, keyed by UTC date. |
Read failures return empty records and write failures are ignored, so storage restrictions do not prevent play. Progress is local to the current browser profile; there is no account or server synchronization.
Rebuild after corpus changes
cd /home/loca/dev/triv && npm run buildThe app snapshots the corpus at build time. Run this command after every accepted corpus change before publishing the refreshed static build.
See Corpus for the public card schema and Pipeline for the acceptance path that produces it.