Personal project · 2026
TypeMachine
Typing trainer for programmers
Offline typing trainer for programmers: you type real code snippets under real code rules, and it shows which keys and bigrams slow you down.
Overview
TypeMachine is a typing trainer for programmers. It is a single page app that works offline as a PWA, and its main view looks like a code editor: you type snippets from a catalogue of 40 across several languages, and the app keeps your history locally to show where you actually lose time.
The problem
Typing trainers measure prose. Code is not prose: it is indentation, brackets, punctuation and closers, and the characters that slow a programmer down are the ones a prose test almost never asks for.
On top of that, comparing character by character punishes things that are not mistakes. Pressing Tab, using two spaces where the snippet had four, or leaving a closing bracket hanging on its own line are all legitimate ways of writing the same code, and a strict trainer marks them wrong and ruins the run.
Decisions
- The typing engine is a pure module, written and tested before any UI: comparison happens over tokens instead of raw characters, through a registry of rules, so what counts as correct is data and not an if buried in a component.
- Real code rules in that registry: Tab indents, spacing and punctuation are flexible, closers can hang on their own line. The trainer adapts to how code is written instead of demanding a transcription.
- Ghost text realigned as you type, plus an IDE style mirror pane with its own highlighting: you see what you are writing the way you would see it in your editor, not as a plain paragraph.
- Local history in Dexie over IndexedDB, with export and import: the data belongs to whoever typed it, the app keeps working with no network, and nothing needs an account. Session replay is compressed and opt in.
- Ranking per key and per bigram: a global words per minute number does not tell you what to practice, a ranking of your weak keys and pairs does.
- Configuration in a modal whose switches run the real engine on their examples: instead of explaining what a rule does, the setting shows it working.
- CSS in variables split across files, no Tailwind: the app has a Windows 7 style window frame, a taskbar with programs as its shell, a menu on the logo, four view modes and a resizable divider, and that kind of chrome comes out cleaner as plain CSS with tokens.
- Built in phases 0 to 7 over about two weeks, with parallel AI subagents working on disjoint file sets: splitting the work by files that do not touch each other is what makes running several agents at once safe.
- A continuous single words mode next to the snippets, for practicing raw speed without the structure of a code block.
Result
TypeMachine is online at typemachine.me, installable, and fully usable with no connection. It ships with 1161 unit tests and 58 end to end tests, including one that verifies the app still works offline as a PWA.
What it proved is the value of writing the engine first: with the comparison logic pure and covered, every later feature (modes, ranking, replay, settings) was a consumer of that module, and the window shell on top could change freely without touching a single typing rule.