Delivered remotely for a business based in Berlin, Germany. Names withheld by agreement.
Project Overview
Sprint interval training leaves zero margin for clunky interfaces. When an athlete is executing repeated 15-to-60-second maximal efforts separated by strict recovery windows, looking down at a phone screen or fighting delayed audio cues breaks pacing and compromises session quality. The goal of this engagement was to deliver a cohesive training platform where athletes configure structured sprint protocols on their phone, execute them hands-free on their wrist or in-ear, and review granular performance trends afterward.
We engineered a multi-tier fitness system uniting a React Native mobile app, native smartwatch companions in Swift (watchOS) and Java (Wear OS), and a Laravel PHP backend backed by MySQL and MariaDB. By giving each hardware tier clear responsibilities, the system delivers millisecond-reliable cues on the track while centralizing program management, historical analytics, and push engagement in the cloud.
The Operational Gap
Many interval apps fail under real athletic conditions because they treat the smartwatch as a passive notification mirror or rely on continuous phone-to-watch connectivity. On an outdoor track or turf field, athletes frequently leave phones in a bag, cross dead cellular zones, or run with background music playing. If a countdown timer pauses when the screen locks, misses a transition cue while music ducks, or drops heart-rate samples when Bluetooth temporarily disconnects, the training log becomes unusable.
On the backend side, ingesting high-resolution time-series splits alongside configurable interval pyramids, warm-up blocks, and cool-down phases requires a schema and sync pipeline capable of handling intermittent bursts of offline data without duplicating sessions or blocking mobile responsiveness.
Architectural Strategy
We structured the platform around local-first execution at the edge and idempotent synchronization in the cloud:
- Autonomous wearable execution: Both the Swift watchOS app and Java Wear OS app maintain a complete local copy of the athlete's selected interval workout and execute their own monotonic state machines, decoupled from the phone's lifecycle.
- Unified mobile command hub: React Native powers workout authoring, structured program libraries, session visualizations, and account management across iOS and Android while bridging to native watch modules via clean platform channels.
- Resilient API & relational store: Laravel exposes versioned REST endpoints backed by MySQL/MariaDB to store interval templates, workout summaries, and sampled telemetry points, while Firebase handles push notifications and mobile diagnostics.
Core Capabilities
- Structured Interval Builder: Athletes and coaches assemble multi-block sprint sessions with configurable work durations, active/passive rest intervals, set counts, warm-up/cool-down stages, and target intensity zones.
- Wrist-First Execution & Haptic Guidance: Distinct vibration patterns and crisp high-contrast wrist displays signal sprint start, recovery transitions, and final-set countdowns without forcing the runner to break stride.
- Background Audio & Voice Cues: On the phone client, audio coaching cues briefly duck active music playback rather than pausing playlists, maintaining rhythm throughout high-effort sets.
- Continuous Heart-Rate & Recovery Tracking: Captures intra-interval peak heart rate and post-sprint heart-rate recovery curves via native watch health sensors, surfacing conditioning progress across weeks.
- Offline-Capable Session Queueing: Completed workouts queue locally in persistent storage on both watch and phone, syncing automatically to Laravel once connectivity returns.
Technical Architecture
Flow: React Native phone app <-> Native Swift (watchOS) / Java (Wear OS) companions -> WatchConnectivity / Wearable Data Layer -> Laravel REST API -> MySQL / MariaDB & Firebase.
Before a session starts, the React Native client downloads updated training plans from Laravel and pushes active workout definitions to the paired smartwatch over Apple WatchConnectivity or Android's Wearable Data Layer API. During execution, the watch starts a privileged native workout session, locks onto monotonic clock timestamps for every phase boundary, and samples heart-rate and split events into a compact local log.
Once the athlete finishes and returns within range of the phone, the watch transfers the finalized session payload. A native bridge module surfaces the payload to React Native, which displays immediate post-run metrics while dispatching an idempotent POST request (keyed by a client-generated UUID) to the Laravel API. Laravel validates the payload, writes normalized session and interval records inside a MySQL/MariaDB transaction, updates athlete progression metrics, and uses Firebase Cloud Messaging to coordinate cross-device alerts and reminders.
Technology Stack
| Category | Technology detail |
|---|---|
| Backend framework | Laravel (PHP) REST API, authentication, and workout sync engine |
| Mobile application | React Native cross-platform client for iOS and Android |
| Apple Watch companion | Swift native watchOS app using WatchConnectivity and HealthKit |
| Wear OS companion | Java native Android Wear app using Wearable Data Layer API |
| Primary database | MySQL / MariaDB for athlete profiles, interval templates, and session telemetry |
| Messaging & telemetry | Firebase Cloud Messaging, Crashlytics, and mobile analytics |
| Audio & haptic cues | Native wrist haptic engines and background audio ducking on mobile |
| Sync transport | Chunked JSON session uploads with idempotent workout identifiers |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Live Bluetooth streaming from watch to phone vs. standalone watch state machine | Implemented autonomous execution in Swift and Java on the watch so intervals, haptics, and heart-rate logging continue accurately even when the phone is out of Bluetooth range. |
| Single cross-platform timer in JS vs. native platform clock anchoring | Anchored all interval transitions to monotonic native system clocks rather than JS setInterval ticks, eliminating timer drift across long multi-set workouts and background transitions. |
| Storing raw per-second telemetry in JSON blobs vs. hybrid relational tables | Stored structured session and interval summaries in relational MySQL/MariaDB columns for fast filtering while compactly storing high-frequency heart-rate arrays for chart rendering. |
| Phone-triggered push reminders vs. server-scheduled Firebase delivery | Centralized reminder logic inside Laravel scheduled jobs dispatching via Firebase Cloud Messaging so notification cadence respects athlete timezone changes and recent workout completions. |
Security & Data Integrity
Biometric workout logs and heart-rate metrics require careful access control and reliable data ownership boundaries. The Laravel API secures all endpoints with token-based authentication, strict athlete-scoped authorization policies, and request schema validation. Every wearable-to-phone transfer relies on OS-verified companion pairing channels rather than unauthenticated local sockets.
To protect telemetry integrity across flaky stadium Wi-Fi or cellular dead zones, uploads employ transactional database writes paired with idempotency keys. Retried requests never create phantom duplicate workouts, and partial session state on the mobile client is preserved locally until the server confirms persistence. Firebase Crashlytics captures anonymized native and JavaScript stack traces across Swift, Java, and React Native layers without logging sensitive personal health identifiers.
Timing Precision & Offline Scale
Real-time sports utilities live or die by perceived responsiveness. Starting an interval session on the watch triggers immediately without waiting on network round-trips, and screen layouts intentionally minimize layout recalculations during active sprints so battery draw remains predictable across back-to-back training blocks.
On the backend, Laravel caches read-heavy training program libraries and user profile metadata while indexing workout history tables by athlete ID and completion timestamp. This keeps historical trend queries and leaderboard/progression views snappy even as athletes accumulate hundreds of multi-interval sessions over successive training seasons.
Operational Outcomes
Athletes gained a dependable, wrist-first conditioning tool capable of running full sprint protocols without carrying a phone on the track. Native Swift and Java companions eliminated mid-workout timer freezes and cue delays, while automatic background synchronization into Laravel and MySQL/MariaDB ensured every training effort flowed cleanly into longitudinal recovery and progression tracking. For the product team, decoupling the React Native interface from native watch engines created a maintainable architecture where training programs evolve rapidly on the server without destabilizing real-time wearable timing.