A static React + TypeScript web app for solo Japanese shiritori.
This repository is open source under the MIT license. See LICENSE for the code license and NOTICE.md for third-party data attribution and redistribution notes.
- Player vs AI gameplay (dictionary-backed validation)
- Input field with automatic romaji-to-kana conversion via
wanakana.js(Shift/uppercase for katakana) - Configurable per-word timer (default 10s, range 5-30s)
- Optional no-timer mode with manual end-game control
- Rule toggles for normalization and repeat handling
- Light/Dark/System theme preference with persistent override
- Local persistence for settings and aggregate stats
- JMdict attribution page
- React 18 + TypeScript + Vite
- Vitest + Testing Library
- Static deployment target: Vercel
src/lib/kana.ts: input canonicalization + kana boundariessrc/lib/validator.ts: player-word validation logicsrc/lib/ai.ts: AI move selectionsrc/lib/dictionary.ts: dictionary loading/indexingsrc/lib/storage.ts: localStorage persistence (versioned keys)src/game/state.ts: reducer/state transitionssrc/components/*: gameplay/settings/stats/history UIsrc/pages/AboutAttribution.tsx: JMdict/EDRDG creditsscripts/build-dictionary.ts: JMdict-to-playlist build pipelinepublic/data/*.json: prebuilt dictionary assets shipped to the browser
- Install dependencies:
npm install- Start dev server:
npm run dev- Run tests:
npm test- Build production bundle:
npm run buildThe app ships with generated dictionary assets in public/data/.
To rebuild from JMdict:
- Place JMdict files in
public/data/raw/(default input:public/data/raw/JMdict_e). - Run:
npm run dict:buildOptional flags:
npm run dict:build -- --input public/data/raw/JMdict_b --output-dir public/data --min-length 2
npm run dict:build -- --include-all
npm run dict:build -- --pos-filter allDefault behavior:
- filters to noun entries only (
--pos-filter noun, default) - filters to common-priority entries (
news/ichi/spec/gaitags) - writes
public/data/dictionary.v1.jsonandpublic/data/index-by-start.v1.json
- Import this repo into Vercel.
- Build command:
npm run build - Output directory:
dist - Optionally add a custom domain for your own deployment.
- Configure DNS records in your DNS provider as prompted by Vercel.
vercel.json includes:
- SPA rewrite for client-side routing
- Cache headers for dictionary JSON assets under
/data/*
- Code license: MIT
- Dataset attribution and redistribution notes: see
NOTICE.md - Security reporting: see
SECURITY.md - Contribution guide: see
CONTRIBUTING.md
- JMdict / EDRDG: https://www.edrdg.org/jmdict/j_jmdict.html
- EDRDG: https://www.edrdg.org/