An open, schema-validated dataset of legal-literacy questions and a privacy-first quiz game that runs entirely in your browser β no server, no accounts, no tracking, works offline.
βΆ Live demo: https://goshrum.github.io/zakon-quest/
- Why this project
- Features
- The open dataset
- Quick start
- Install & offline
- Project scripts
- Architecture
- Contributing
- Governance & maintainers
- Security
- Roadmap
- License
Legal-literacy material is scarce, fragmented, and rarely available as open, machine-readable, citable data. Know the Law tackles both halves of that problem:
- An open dataset of legal-literacy questions β every entry carries a citation to a verifiable, stable source, validated by a JSON Schema in CI, and published under CC BY 4.0 so anyone can reuse it.
- A delightful way to learn it β a fast, accessible, offline-capable quiz game that turns the dataset into practice, with scoring, streaks, levels, spaced repetition, and a study/browse mode.
The quiz engine is deliberately jurisdiction-agnostic: the current dataset
covers the Russian legal system (in English), and the project is structured so
contributors can add other jurisdictions as separate datasets. See
docs/adding-a-jurisdiction.md.
βοΈ Educational only β not legal advice. Norms change over time; every question cites its source so you can verify it. See
docs/CONTENT_POLICY.md.
- π― Four question types β pick the governing code, guess the article, true/false legal myths, and short case scenarios.
- π₯ Game feel β combo multipliers, optional timer + speed bonus, XP, ranks, and a results screen.
- π§ Spaced repetition β questions you miss come back; a dedicated review your mistakes mode.
- π Study mode β searchable, pressure-free browse of every question with its answer, explanation, and citation.
- π Lifetime stats β accuracy overall and per legal branch.
- βΏ Accessible β keyboard support, focus management, ARIA live regions, reduced-motion support, skip link.
- π Private & offline β 100% client-side, installable PWA, progress stored only in your browser.
The question bank is a first-class artifact, not hard-coded strings:
- Canonical data:
src/data/questions.json - Contract:
src/data/questions.schema.json(JSON Schema, draft 2020-12) - Docs:
docs/data-schema.md - License: CC BY 4.0 β
LICENSE-DATA
Validate it anytime:
npm run validate:dataReuse it in your own project, cite it (see CITATION.cff), and
contribute corrections β citation-backed fixes are fast-tracked.
Requires Node 18, 20, or 22 (see .nvmrc).
git clone https://github.com/goshrum/zakon-quest.git
cd zakon-quest
npm install
npm run dev # start the dev serverBuild and preview a production bundle:
npm run build
npm run previewThe app is a Progressive Web App. Open the live demo and use your browser's Install action to add it to your device. Once loaded, it works fully offline β the service worker precaches the app shell, and there are no network calls at runtime.
| Script | What it does |
|---|---|
npm run dev |
Start the Vite dev server |
npm run build |
Type-check and build for production |
npm run preview |
Preview the production build |
npm test |
Run unit tests (Vitest) |
npm run test:coverage |
Unit tests with coverage thresholds |
npm run e2e |
End-to-end tests (Playwright) |
npm run lint |
ESLint |
npm run format |
Format with Prettier |
npm run typecheck |
TypeScript, no emit |
npm run validate:data |
Validate the dataset against the schema |
A pure, unit-tested core (src/lib) with a thin DOM shell (src/main.ts) over
an open dataset (src/data). Full write-up in
docs/ARCHITECTURE.md; decisions are recorded as ADRs in
docs/adr/.
Contributions of all kinds are welcome β code, accessibility, docs, and
especially citation-backed question fixes and additions. Start with
CONTRIBUTING.md and the
Code of Conduct. We use
Conventional Commits and automate releases
with release-please.
This project has documented governance and a maintainers list describing roles, decision-making, releases, and how to become a maintainer.
Found a vulnerability? Please report it privately β see
SECURITY.md. Dependencies are monitored with Dependabot and the
code is scanned with CodeQL.
See ROADMAP.md for what's planned and where help is most useful.