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
SyncManagerflushes 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
| Action | Works offline? |
|---|---|
| Read today's workout (if visited online recently) | Yes |
| Log sets | Yes — queued in IndexedDB |
| Mark workout complete | Yes — queued |
| Substitute exercise | Partial — alternatives need network |
| Log a meal | Yes — queued |
| Log a measurement | Yes — queued |
| View exercise library | Cached 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
- Walk into the gym basement (no signal).
- Open EvoFit. The cached app loads.
- Start your workout. Log sets normally. The OfflineBanner shows.
- After the workout, walk back outside. SyncStatus turns green.
- Open the app — your trainer can now see the session.
Common pitfalls
Where to find this
- Component:
OfflineBanner,SyncStatus,OfflineIndicator. - Storage: IndexedDB with
fake-indexeddbfor tests. - Sync:
lib/offline/sync-manager.tswith exponential backoff.
Was this article helpful?
