Working Out Offline

What happens when your gym has no signal — and how the app catches up later.

client guide/workout-tracker
What this is for: Don't lose your workout log just because the gym basement has no Wi-Fi.

How it works

EvoFit Trainer is a Progressive Web App with offline support:

  • The Service Worker caches the app shell + your most recent data on every load.
  • When you go offline mid-workout, set logs are written to IndexedDB locally.
  • When the device comes back online, a SyncManager flushes pending writes to the server.

You should never lose a set log because of bad signal.

What you see

  • An OfflineBanner appears at the top of the screen when you go offline.
  • A SyncStatus indicator shows pending sync count (e.g. "3 sets waiting to sync").
  • Once back online, the indicator turns green and shows "Synced".

What works offline

ActionWorks offline?
Read today's workout (if visited online recently)Yes
Log setsYes — queued in IndexedDB
Mark workout completeYes — queued
Substitute exercisePartial — alternatives need network
Log a mealYes — queued
Log a measurementYes — queued
View exercise libraryCached only — full library needs network

What doesn't work offline

  • New programs / new check-ins (push from server requires network).
  • WhatsApp button (opens external app).
  • Push notifications.

Conflict resolution

If you log a set offline and your trainer edits the same workout template online before you sync, the system uses last-write-wins with a server-side timestamp tie-breaker. Conflicts are rare in practice (trainers rarely edit a workout you're mid-way through).

Step-by-step

  1. Walk into the gym basement (no signal).
  2. Open EvoFit. The cached app loads.
  3. Start your workout. Log sets normally. The OfflineBanner shows.
  4. After the workout, walk back outside. SyncStatus turns green.
  5. Open the app — your trainer can now see the session.

Common pitfalls

Where to find this

  • Component: OfflineBanner, SyncStatus, OfflineIndicator.
  • Storage: IndexedDB with fake-indexeddb for tests.
  • Sync: lib/offline/sync-manager.ts with exponential backoff.
Was this article helpful?