Brief
DeepWork is a structured focus session timer that works identically on your phone, your laptop, and your browser tab. The core insight was simple: timer logic is platform-agnostic. Session states, transitions, interruption handling, and accounting live in a single shared TypeScript package. Each platform — React Native for mobile, Electron for desktop, Chrome Extension for browser — consumes this core and handles its own OS integrations: notifications, badge counts, idle detection. One bug fix in the core propagates everywhere. One test suite covers all three platforms.
Challenge
- Timer logic duplicating and drifting independently across three separate platform codebases
- Chrome MV3 service worker lifecycle incompatible with long-running timer state
- Monorepo module resolution conflicts across Expo, Electron, and Node environments
Approach
- Extracted a shared TypeScript core (finite state machine) consumed by all three platforms
- MV3 extension uses alarm API to survive service worker restarts without losing session state
- Turborepo with unified build pipeline and resolved Expo + Node version conflicts
Outcome
- Single source of truth for all timer logic — consistent behavior across mobile, desktop, and browser
- Stable builds from one unified monorepo
- Consistent session accounting and interruption handling on all three platforms
