AI and agents2 filesInfrastructure2 filesDevelopment3 filesAbout2 files

TrainerPad — a CRM for personal trainers that works offline and resolves its own sync conflicts

  • offline
  • sync
  • IndexedDB

TrainerPad — a CRM for personal trainers that works offline and resolves its own sync conflicts

Personal trainers manage clients and sessions from the gym floor, where the connection is either absent or unreliable. A standard PWA with a cache doesn’t solve that: once two devices diverge offline, the data has to be reconciled, and there’s no off-the-shelf way to do it.

I built the product alone, from scratch: 626 commits over about six months, January through July 2026, roughly 67,000 lines of TypeScript. At its core is a custom sync engine, 646 lines: a change queue in IndexedDB with its own merge rules (create followed by update collapses into create, update followed by delete collapses into delete), a sync loop every 30 seconds plus an immediate run when a tab regains focus, a navigator.locks guard so two open browser tabs don’t drift into conflict, a server pull with a two-second overlap that favors local data, a forced resync, and a client balance recalculated locally instead of trusted from the server.

The product runs in production: the site answers over HTTPS with proper security headers, alongside a live admin panel and its own error monitoring.