Back to Transmissions
UPDATE • ENGINEERING

Offline-First Calisthenics App Architecture

How we engineered Flowzy for 0ms latency, service worker media caching, and local-first browser state sync.

MV

Marco Vance

Principal Systems & PWA Architect

June 28, 2026 10 min read
Executive Key Takeaways
  • Local-First architecture guarantees 0ms latency for all UI interactions
  • IndexedDB & localStorage serve as the instant client-side source of truth
  • Workbox Service Worker caches static app shell and exercise videos
  • Web Audio API synthesizes zero-latency workout tones without external audio assets

When training at a calisthenics park, gym basement, or outdoor field, internet connectivity is notoriously unreliable. Requiring an active cloud network request just to log a set of push-ups or check a skill tree creates unnecessary friction.

In building Flowzy, we made an architectural commitment: The client browser is the source of truth.

---

1. High-Level System Architecture

Flowzy utilizes a three-tier local storage architecture:

  • Layer 1: React Component State (Instant UI re-render)
  • Layer 2: Browser Local Storage / IndexedDB (Persistent 0ms client write)
  • Layer 3: Background Network Sync (Idempotent cloud reconciliation)

---

2. Service Worker & App Shell Caching

Using Workbox with Next.js App Router, the application pre-caches the complete App Shell (HTML, CSS, JS bundles, icons, and core fonts) during initial load.

Exercise videos are cached on-demand using a CacheFirst strategy with a 30-day expiration window.

---

3. Synthesizing Zero-Latency Tones via Web Audio API

Instead of loading external MP3 audio files for workout countdown timers and rep cues (which can fail to buffer offline), Flowzy synthesizes audio frequencies natively using the Web Audio API.

When a timer triggers, an AudioContext oscillator is created dynamically, generating a clean 880Hz sine wave tone directly through the device speaker with zero network dependency.

---

4. Key Performance Metric Comparisons

Performance MetricTraditional Web AppFlowzy Local-First PWA
**Cold Boot Load Time**1.8s - 3.2s**< 350ms**
**Rep Log Latency**200ms - 800ms (API dependent)**0ms (Instant)**
**Offline Capability**Broken / White screen**100% Fully Functional**
**Bundle Size**15MB+ native app binary**< 280KB gzipped**

---

5. Lessons Learned & Best Practices

  • Idempotent Mutations: Design local state updates so they can be replayed safely during background network reconciliation.
  • Optimistic UI: Never block the user interface with loading spinners for simple input actions. Render the updated state immediately.
  • Graceful Fallbacks: If Web Audio or Haptics APIs are unsupported on older browser engines, swallow errors silently without breaking execution.
Frequently Asked Questions

Why build a Progressive Web App instead of a Native iOS/Android app?

PWAs deliver instant loading, zero app store installation friction, seamless cross-device compatibility, and 100% offline capability without requiring heavy 100MB downloads.

How does Flowzy sync data when reconnecting to the internet?

When a network online event fires, the background sync manager reconciles local client state with the cloud database via idempotent merge algorithms.

Will my workout data be saved if I close the browser tab offline?

Yes. All progression state is persisted to IndexedDB and localStorage instantly upon rep entry, ensuring zero data loss.

Train these protocols in Flowzy OS

Interactive skill trees, custom workout builder, Mifflin-St Jeor TDEE macro tracking, and real-time AI coaching — 100% free and offline.