How xiaolai/type-review works
TYPE is a privacy-focused typing-practice web app. A typist enters practice, keyboard input reaches the session, and the engine evaluates the run, computes metrics, and records results for adaptive planning and statistics. Passage selection supports adaptive drills, generated benchmarks, curated text, and user text. The UI also exposes settings, keyboard and sound options, shareable results, and in-app reading. The graph follows the README and sampled entry points; unsampled feature wiring is shown only where documented.
Main entry points: App.tsx App shell · session.ts Session · key-event-bus.ts Key event bus · session-adapter.ts Session corpus adapter
Components 26
App experience
- App shell
src/ui/App.tsx - Hash router
src/ui/router.ts - Practice stage
src/ui/components/PracticeStage.tsx - Results view
src/ui/Results.tsx - Text library
src/ui/Library.tsx - Articles
src/ui/articles/ArticleView.tsx - Settings
src/ui/Settings.tsx
Typing engine
- Session
src/engine/session/session.ts - Text input
src/engine/typing/text-input.ts - Adaptive planner
src/engine/adaptive/index.ts - Run metrics
src/engine/metrics/run-metrics.ts
Passage sources
- Corpus engine
src/engine/corpus/index.ts - Session corpus adapter
src/io/corpus/session-adapter.ts - Curated sources
src/io/corpus/composite.ts - User text store
src/io/corpus/user-corpus-store.ts
Device services
- Keyboard input
src/io/input-handler.ts - Key event bus
src/io/key-event-bus.ts - Profile persistence
src/io/persistence/index.ts - Key sounds
src/io/key-sounds.ts - On-screen keyboard
src/ui/components/OnScreenKeyboard.tsx
Stats and sharing
- Statistics dashboard
src/ui/Stats.tsx - Share card
src/ui/Share.tsx - Site statistics
src/ui/SiteStats.tsx - Stats endpoint
functions/api/stats.ts
Other components
- Typist
- Cloudflare Analytics
Connections 31
- Typist → App shell: uses
- App shell → Hash router: navigates
- App shell → Practice stage: renders
- App shell → Results view: renders
- App shell → Text library: renders
- App shell → Settings: renders
- App shell → Articles: renders
- Typist → Key event bus: presses keys
- Key event bus → Keyboard input: dispatches events
- Keyboard input → Session: sends keystrokes
- App shell → Session: bootstraps
- Session → Text input: feeds characters
- Session → Session corpus adapter: requests passages
- Session corpus adapter → Curated sources: selects entries
- Curated sources → User text store: reads user text
- Session corpus adapter → Corpus engine: generates fallback
- Session → Adaptive planner: plans lessons
- Session → Run metrics: computes results
- Session → Results view: provides run state
- App shell → Profile persistence: loads and saves
- App shell → Statistics dashboard: renders
- Statistics dashboard → Session: reads run history
- App shell → Share card: renders
- App shell → Site statistics: renders
- Site statistics → Stats endpoint: requests counts
- Stats endpoint → Cloudflare Analytics: queries metrics
- App shell → On-screen keyboard: configures
- Key event bus → On-screen keyboard: dispatches events
- App shell → Key sounds: configures
- Key event bus → Key sounds: dispatches events
- App shell → User text store: manages uploads