How ahmedkhaleel2004/leftright works
Left-Right Typing Test is a client-driven Next.js typing application. The user selects a keyboard layout and word/time mode, types generated text, and receives accuracy plus separate left/right WPM and balance feedback. Completed tests submit a validated hand-speed ratio to Redis-backed community statistics and retrieve the updated average. The sampled code directly supports the typing, layout, metrics, community API, and analytics paths; other UI details remain unsampled.
Main entry points: page.tsx Typing Interface · route.ts Ratio API · providers.tsx Analytics Provider · layout.tsx App Shell
Components 11
Typing Experience
- Typing Interface
src/app/page.tsx - Results View
src/app/page.tsx
Typing Domain
- Text Generator
src/app/commonWords.ts - Keyboard Layouts
src/app/keyboardLayouts.ts - Session Metrics
src/app/page.tsx
Community Statistics
- Ratio API
src/app/api/ratio/[layout]/route.ts - Community Redis
Application Platform
- App Shell
src/app/layout.tsx - Analytics Provider
src/app/providers.tsx
Other components
- Typist
- PostHog Analytics
Connections 12
- Typist → Typing Interface: types and selects
- Typing Interface → Text Generator: generates prompts
- Typing Interface → Keyboard Layouts: reads layout
- Typing Interface → Session Metrics: tracks input
- Session Metrics → Results View: computes feedback
- Typing Interface → Ratio API: submits ratio
- Typing Interface → Ratio API: fetches average
- Ratio API → Community Redis: reads ratios
- Ratio API → Community Redis: writes ratios
- Ratio API → Typing Interface: returns statistics
- App Shell → Analytics Provider: wraps application
- Analytics Provider → PostHog Analytics: captures pageviews