How yasirawan4831/keyboard-tester works
Keyboard Tester combines browser-side physical-key diagnostics, a timed typing test, and locally persisted performance history. The main workflow runs from the user’s key presses or typed input through the relevant test logic to live feedback and results; the Statistics page reads saved results. Separate API routes provide health, result-payload validation, and a local-only leaderboard response. The README documents broader UI capabilities, but unsampled component wiring is shown only where supported by the tree and documentation.
Main entry points: TypingTest.tsx Typing test UI · KeyboardTester.tsx Keyboard tester · useKeyboard.ts Keyboard session · useTypingTest.ts Typing session
Components 24
Keyboard diagnostics
- Home page
app/page.tsx - Keyboard tester
components/keyboard/KeyboardTester.tsx - Keyboard session
hooks/useKeyboard.ts - Key diagnostics
lib/keyboard.ts - Keyboard layout
components/keyboard/KeyboardLayout.ts - Virtual keyboard
components/keyboard/Keyboard.tsx - Diagnostics panel
components/keyboard/Diagnostics.tsx
Typing and results
- Typing test page
app/typing-test/page.tsx - Typing test UI
components/typing/TypingTest.tsx - Typing session
hooks/useTypingTest.ts - Countdown timer
hooks/useTimer.ts - Typing calculations
lib/typing.ts - Test results
components/typing/TypingResults.tsx
History and statistics
- History access
hooks/useLocalStorage.ts - Local history
lib/storage.ts - Statistics page
app/stats/page.tsx - Stats views
components/stats
API routes
- Health endpoint
app/api/health/route.ts - Results endpoint
app/api/results/route.ts - Payload validation
lib/validation.ts - Leaderboard endpoint
app/api/leaderboard/route.ts
Other components
- Visitor
- Physical keyboard
- API consumer
Connections 24
- Visitor → Home page: opens
- Home page → Keyboard tester: renders
- Physical keyboard → Keyboard session: key events
- Keyboard tester → Keyboard session: uses session
- Keyboard session → Keyboard layout: loads layout
- Keyboard session → Key diagnostics: updates state
- Keyboard tester → Virtual keyboard: renders
- Keyboard tester → Diagnostics panel: renders
- Visitor → Typing test page: opens
- Typing test page → Typing test UI: renders
- Visitor → Typing test UI: types input
- Typing test UI → Typing session: uses session
- Typing session → Countdown timer: controls timer
- Typing session → Typing calculations: calculates results
- Typing test UI → Test results: shows results
- Typing test UI → History access: records result
- History access → Local history: reads and writes
- Visitor → Statistics page: opens
- Statistics page → History access: loads history
- Statistics page → Stats views: renders
- API consumer → Health endpoint: requests health
- API consumer → Results endpoint: submits result
- Results endpoint → Payload validation: validates payload
- API consumer → Leaderboard endpoint: requests leaderboard