Carpal Tunnel Syndrome Test — mobile diagnostic tool
TL;DR
A mobile web app at carpaltunnelsyndrometest.com that lets anyone screen themselves for carpal tunnel syndrome in 30 seconds. The diagnostic method, thresholds, and clinical interpretation come from peer-reviewed research by Dr. Sebastian Szklener. I built the application — the entire front-end, back-end, and deployment.
Source code: github.com/rafalmcichon/carpaltunnelsyndrometest (MIT license)
Context
- Research: Dr. Sebastian Szklener’s study demonstrated that CTS patients have measurably different tapping patterns (slower hold times, fewer taps, less precise touch positions). He defined the diagnostic thresholds and approved this implementation. (publication)
- My role: design and build the entire application — UX flow, touch-event capture, data pipeline, serverless back-end, deployment
- Stack: vanilla JavaScript (ES modules), Cloudflare Workers, Cloudflare D1 (SQLite), PWA
- Internationalization-ready (i18n framework with full English translation set)
- Mobile-first, touch-event driven with
performance.now()precision timing
The research
Dr. Szklener’s study showed that carpal tunnel patients produce a distinct tapping signature: slower hold times, fewer total taps, and less precise touch positions compared to healthy individuals. The signal is strong enough to detect through a phone screen. The clinical norms (200–400ms average hold time for healthy individuals) and the classification thresholds all come from this research.
The gap: the research existed, but there was no publicly available tool that let someone take the test at home on their own phone.
What I built
A four-step diagnostic flow:
1) Education
Landing page explains the three key CTS symptoms (numbness, lack of precision, weakness) with visual guides. Links to scientific source material for credibility.
2) Preparation
Step-by-step instructions: sit at a desk, place phone in palm, position thumb on screen center. Each step has an illustration. The goal is consistent test conditions.
3) 30-second tapping test
The user taps the screen center with their thumb as many times as possible. The app captures:
- Individual tap timestamps (millisecond precision via
performance.now()) - Touch contact positions (x, y coordinates)
- Hold duration for each tap
- Device orientation (portrait mode enforced)
- Vibration feedback on each tap
4) Results + diagnosis
Displays total taps, average hold duration, and a histogram of tap-time distribution. Compares against the clinical norms from Dr. Szklener’s research. Classification:
- Healthy: average ≤200ms and 80+ taps
- Borderline: average 200–400ms or 50–80 taps — recommends monitoring
- Likely CTS: average >400ms or <50 taps — recommends doctor visit
A persistent banner recommends seeing a doctor for concerning results. A clear disclaimer states no online test replaces a medical examination.
Architecture
- Frontend: vanilla JS modules, no framework, no bundler. Touch events, progress bar, rotation detection, PWA manifest
- Backend: Cloudflare Workers (Pages Functions) with D1 database
- Data captured per test: tap count, average/median/std dev/min/max hold times, full tap-times JSON, touch positions JSON, device info, screen dimensions, language, geolocation (from Cloudflare edge), timestamp
- Rate limiting: max one result submission per 10 seconds
- API key auth for admin data access
What makes it work
- Scientific grounding — the diagnostic method, thresholds, and interpretation come entirely from Dr. Szklener’s peer-reviewed research. My job was to implement it faithfully.
- Precision timing —
performance.now()instead ofDate.now()gives sub-millisecond accuracy, which matters when the diagnostic signal is in hold-duration differences. - Minimal friction — four screens, one action (tap), immediate result. No signup, no app install (PWA-installable optionally).
- Rich telemetry — every test stores enough data for future research: individual tap times, positions, device info, location.
What I took from it
- Building for a medical domain forces responsible design decisions. The disclaimer, the “see a doctor” banner, the conservative thresholds from the research — all necessary. Shipping a health tool that overpromises is worse than not shipping at all.
- Cloudflare Workers + D1 was the right call for something that needs to be globally fast with zero maintenance. No servers to manage, no cold starts, no database connection pools.
- Touch events are surprisingly rich. The difference between a healthy tap pattern and a CTS tap pattern is visible even in raw data — which is what makes the research-based approach work.