Case Study

Fitness Subscription App with Workout Tracking & Live Classes

How we built a fitness subscription app with on-demand and live video classes, workout tracking, and offline mode — serving 80K+ subscribers, 2M+ workouts logged, and a 4.8 app store rating.

Industry
Health & Wellness
Duration
7 Months
Services
Mobile · Video · Subscriptions
Markets
United States

Fitness App · Live & On-Demand

80K+
Subscribers
2M+
Workouts Logged
4.8
App Rating
Live
Classes

The Client's Vision

A fitness brand with a loyal following wanted to transition from in-person studio classes to a digital subscription model. They had a library of recorded workouts and plans to add live classes with real-time instructor interaction. Their existing app was a simple video player — no workout tracking, no progress history, and no offline support. Subscribers complained about buffering during peak hours and the inability to workout in gyms or outdoors without Wi‑Fi.

They needed a React Native app with high-quality video streaming (on-demand and live), workout tracking that synced progress across devices, subscription management via Stripe with trials and upgrades, and an offline mode that let users download classes for use without connectivity. The app had to feel native — smooth scrolling, quick load times, and a 4.8+ rating target. Live classes required low-latency streaming; we evaluated Agora and Twilio for real-time video.

What Was Breaking

Video Streaming

On-demand videos buffered during morning and evening rush. Live classes had 5–10 second latency — by the time users saw the move, the instructor was already on the next one. No adaptive bitrate for varying connections.

Workout Sync

Users logged workouts on one device and switched to another — progress didn't follow. No cross-device history. Recommended “next workout” logic didn't account for completed sessions.

Subscription Management

Trials, monthly, and annual plans lived in separate flows. Upgrades and cancellations required support. Webhook handling was incomplete — some cancellations didn't revoke access promptly.

Offline Mode

Many users worked out in gyms with poor cell service or ran outdoors without data. There was no way to download classes. The app was unusable without connectivity — a major churn driver.

The Architecture We Built

We built a React Native app with a Node.js backend. On-demand video uses HLS via AWS MediaConvert and CloudFront; we added adaptive bitrate so mobile users get lower quality during slow connections. Live classes use Agora (with Twilio fallback) for sub-second latency. Workout tracking stores completed sessions in PostgreSQL and syncs via a REST API with conflict resolution. Stripe powers subscriptions with a single webhook handler that updates access and triggers in-app notifications. Offline mode downloads encrypted video segments to local storage; the app checks entitlement before playback.

System Architecture

React Native — iOS & Android App
Video player (HLS + offline), workout tracking UI, subscription management, and live class viewer. Native modules for background download and storage
Node.js API & Auth
User auth, workout sync, subscription status, and content metadata. Integrates Stripe webhooks, Agora/Twilio tokens, and AWS signed URLs
Video Pipeline — HLS & Live (Agora/Twilio)
On-demand: AWS MediaConvert + CloudFront HLS. Live: Agora SDK for low-latency streaming. Token-based access control
PostgreSQL — Users, Workouts & Content
Users, workouts, content catalog, and subscription state. Workout sync with last-write-wins and timestamp reconciliation
Stripe — Subscriptions & Entitlements
Monthly and annual plans with trials. Webhook handler for subscription lifecycle. Access grants and revocations in real time

Offline mode was the most complex piece. We built a download manager that fetches HLS segments, stores them encrypted, and registers them in a local SQLite index. The video player checks the index first — if segments exist locally, playback is from disk. Entitlement is checked at download time and at playback; expired subscribers lose access to downloaded content. We added a 48-hour grace period for subscriptions that failed to renew, reducing involuntary churn.

Tech Stack

React Native
Node.js
PostgreSQL
AWS
Stripe
Agora/Twilio
HLS
SQLite

How We Delivered It

Phase 1 — Weeks 1–4
Discovery & Video Strategy

Audited existing video library and live class requirements. Evaluated Agora vs. Twilio for live streaming. Designed HLS pipeline and offline download architecture. Defined workout tracking schema and sync protocol.

Phase 2 — Weeks 5–14
Core App & Video Playback

Built React Native app with video player (HLS.js / exo). Implemented Node.js API for content and auth. Integrated Stripe subscriptions with webhooks. Added workout tracking and sync.

Phase 3 — Weeks 15–24
Live Classes & Offline Mode

Integrated Agora for live streaming. Built offline download manager with encrypted storage. Added subscription grace period and entitlement checks. Optimized for performance and battery.

Phase 4 — Weeks 25–28
Polish, Launch & Scale

Beta with 2K users. Fixed playback and sync edge cases. Launched to 80K+ subscribers. Monitored retention and churn. Achieved 4.8 app store rating and 2M+ workouts logged.

The Impact

Buffering complaints
Adaptive HLS
Smooth playback on varying connections
No offline
Download & go
Work out anywhere without connectivity
5–10s live latency
Sub-second
Agora-powered real-time classes
Support-driven subs
Self-service
Stripe + webhooks for instant access
“We went from a basic video app to a full fitness platform. Our subscribers can now workout in the gym without Wi‑Fi, join live classes without lag, and see their progress across devices. The 4.8 rating and 2M+ workouts logged speak for themselves.”
— Head of Product, Fitness Brand

What Made This Work

Fitness apps live or die by video quality and offline support. Users work out in environments with unreliable connectivity — gyms, parks, hotels. Adaptive bitrate HLS eliminated buffering complaints. Offline downloads were a top feature request; we built a background download manager that respects storage limits and battery. Users can queue classes before a trip and watch without data. That drove significant retention improvement.

Live classes needed sub-second latency. Pre-recorded HLS has 10–30 second delay, which is fine for on-demand but unusable for live. Agora gave us real-time streaming with interactive features (chat, reactions). We added Twilio as fallback for regions where Agora has issues. The live class adoption exceeded expectations — 30% of subscribers joined at least one live session per week.

Workout sync had to be seamless. Users switch between phone and tablet; progress must follow. We use last-write-wins with server timestamps — conflicts are rare (same user, same workout) but we handle them gracefully. The “next workout” recommendations use completed sessions to avoid repetition and encourage variety. That drove engagement: users who tracked 5+ workouts had 2x retention vs. those who didn't.

Building a Fitness or Wellness App?

We help health & wellness brands build subscription apps with video, tracking, and offline. Let's talk about your architecture.

Book Strategy CallCase Studies