Skip to content

Latest commit

Β 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“œ Know the Law

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.

CI E2E CodeQL License: MIT Dataset: CC BY 4.0 PRs welcome Conventional Commits Code style: Prettier TypeScript PWA

β–Ά Live demo: https://goshrum.github.io/zakon-quest/


Table of contents

Why this project

Legal-literacy material is scarce, fragmented, and rarely available as open, machine-readable, citable data. Know the Law tackles both halves of that problem:

  1. 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.
  2. 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.

Features

  • 🎯 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 open dataset

The question bank is a first-class artifact, not hard-coded strings:

Validate it anytime:

npm run validate:data

Reuse it in your own project, cite it (see CITATION.cff), and contribute corrections β€” citation-backed fixes are fast-tracked.

πŸš€ Quick start

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 server

Build and preview a production bundle:

npm run build
npm run preview

πŸ“² Install & offline

The 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.

Project scripts

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

Architecture

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/.

Contributing

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.

Governance & maintainers

This project has documented governance and a maintainers list describing roles, decision-making, releases, and how to become a maintainer.

Security

Found a vulnerability? Please report it privately β€” see SECURITY.md. Dependencies are monitored with Dependabot and the code is scanned with CodeQL.

Roadmap

See ROADMAP.md for what's planned and where help is most useful.

License

About

πŸ“œ Know the Law β€” an open, schema-validated dataset of legal-literacy questions plus a privacy-first, offline quiz game that runs entirely in the browser.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages