How to build a fitness and yoga coaching video app
A fitness and yoga coaching video app needs one thing a recorded workout cannot give: a trainer who can see the member and correct them live. This guide covers the architecture, the three formats most apps sell (1:1 personal training, small live group classes and voice check-ins with a dietician), the per-minute maths, a no-backend start with Quick mode, and how to lock classes to members who booked. At the list price a 45-minute class with a trainer and 8 members costs ₹81 ($0.9315) in call minutes.
This guide is the engineering side of our video SDK for fitness and yoga apps page. If you sell one-to-one sessions with a coach in other fields too, see coaching apps; for talks and workshops to a larger crowd, see events and webinars.
Architecture of a fitness and yoga video app
A live fitness product has two apps and, later, a small backend. The video layer carries the class and nothing else: plans, payments, bookings and streaks stay with you.
| Part | Runs where | What it does |
|---|---|---|
| Member app | Android, iOS or a browser | Browses the timetable, books, pays, joins the class, chats with the trainer. |
| Trainer app or trainer web panel | A phone on a tripod, or a laptop | Starts the batch, sees every member in a grid, mutes or removes someone, shares the plan. |
| Your backend (optional at first) | Your servers | Timetable, bookings, subscriptions, payments, attendance, trainer payouts. In production it also keeps the Titli project key. |
| Titli media servers | India | Carry live audio and video between everyone in the class. Nothing is recorded or stored. |
| Titli webhooks (optional) | Titli to your backend | Signed events when someone joins or leaves and when the class ends, with a receipt of who was connected and for how long. |
| Titli Chat (optional) | In both apps | Batch groups, plan sharing, diet charts as files, reminders and call invites. |
On day one you can skip the backend entirely: both apps hold the App Key and the trainer’s app starts the call. Move class creation to a server when you need to enforce bookings.
- Member appBook a classThe member picks the 7:00 morning yoga batch and pays for it or uses a class from a subscription. All of this is your own code.
- Trainer appStart the batchA few minutes early, the trainer opens the class. In Quick mode the app starts a video call; in production your server creates it with a time cap.
- Both appsShare the call idMembers learn the call id from your push message, your database, or the batch’s group chat.
- Member appsJoinEach member joins with the call id (Quick mode) or a token from your server. Billing runs only while two or more people are connected.
- Trainer appCoachThe trainer sees every member, calls out names, and removes a disruptive member if needed.
- Titli → your serverCount attendanceJoin and leave events, then the receipt when the class ends, feed streaks, packs and the trainer’s payout.
Formats: 1:1 training, live group classes and voice check-ins
Most fitness and yoga apps end up selling three formats on the same account and the same prepaid balance.
- 1:1 personal training. One trainer, one member, a private video call. This is the premium tier: the trainer watches form, counts reps and changes the plan on the spot. It works on the default room size of two.
- Small live group classes. A trainer and a batch of members, where the trainer sees everyone. Yoga, Zumba, HIIT, pilates and prenatal classes all work like this. Rooms above two people are set for your account on request, up to 50, so ask support before you launch group batches. Most trainers find that 8 to 15 members is the most they can genuinely watch.
- Voice check-ins with a dietician or coach. A weekly call about food, sleep and progress does not need a camera. Create it as an audio call: it costs ₹0.05 per participant-minute instead of ₹0.20.
What this API is not: a one-to-many broadcast to hundreds of viewers who cannot be seen. If you want a celebrity trainer streaming to a large audience, that is a different product; large-audience broadcast is not self-serve here. Keep this design for classes where seeing the member is the point.
What a class costs: the per-minute maths
Titli bills your app per participant-minute: one person connected for one minute. A class with 9 people connected for 45 minutes uses 9 × 45 = 405 participant-minutes, whatever each member’s camera is doing; a member who turns the camera off is still connected. Billing is per second, and only while at least two people are in the call, so a trainer who opens the room five minutes early and waits alone is not billed for the wait.
| What you run | Participant-minutes | INR account | USD account |
|---|---|---|---|
| One 45-minute 1:1 personal training session (video) | 2 × 45 = 90 | ₹18 | $0.207 |
| One 45-minute group class, trainer + 8 members (video) | 9 × 45 = 405 | ₹81 | $0.9315 |
| The same class on audio only | 405 | ₹20.25 | $0.2308 |
| One 15-minute voice check-in with a dietician | 2 × 15 = 30 | ₹1.50 | $0.0171 |
| 12 group classes in a day | 4,860 | ₹972 | $11.18 |
| A 30-day month of 12 classes a day (360 classes) | 1,45,800 | ₹29,160 | $335.34 |
List prices are ₹0.20 (video, up to 720p) and ₹0.05 (audio) per participant-minute on Indian accounts, and $0.0023 and $0.00057 on international accounts, excluding taxes. There is no monthly fee; you recharge a prepaid balance by UPI or bank transfer (USD accounts: USDT or bank wire; card payment is not available yet). The smallest recharge is ₹500, which covers 6 such group classes. The pricing page has a calculator for your own class sizes.
What members might pay (example pricing)
Your member prices are yours to set and Titli takes no share of them. The numbers below are examples only, to show how small the calling cost is next to typical Indian fitness pricing. A member’s share of one class, trainer included, is ₹81 ÷ 8 = about ₹10.13.
| Example product | Example price to the member | Your calling cost | Share of the price |
|---|---|---|---|
| Drop-in group class, 8 members | ₹199 each, ₹1,592 for the class | ₹81 | 5.1% |
| Monthly subscription, 12 group classes | ₹999 a month | 12 × ₹10.13 = ₹121.50 | 12.2% |
| Pack of 4 personal training sessions, 45 minutes each | ₹2,999 | 4 × ₹18 = ₹72 | 2.4% |
Trainer fees, payment gateway charges and taxes on your own sales are separate and not shown. One more limit worth planning for: a new account can run 5 calls at the same time. 12 batches spread over a day fit easily, but if more than 5 trainers start a batch at the same 6:00 slot, ask support to raise it first.
Quick mode: add your App Key, make a call in 5 minutes
No backend needed: add your App Key in the app and start calling. A server is optional, for production hardening.
- Get your App Key. In the console, open Projects → Quick mode and add your app's package name (Android) and bundle ID (iOS). Your App Key is shown there.
- Install the package from pub.dev (the console download is only a fallback).terminal
flutter pub add titli_video_sdk # or in pubspec.yaml dependencies: titli_video_sdk: ^0.2.0 - Init with the App Key, then start or join a call. That is all: no server, no tokens.lib/main.dart
import 'package:titli_video_sdk/titli_video_sdk.dart'; // 1. Once, at app start: your App Key and your own user id. No server needed. await TitliVideo.init(appKey: 'tak_…', userId: 'user-42', userName: 'Asha'); // 2. Start a video call (you are the caller and the payer)... final call = await TitliVideo.startCall(type: TitliCallType.video); // share call.callId with the other person your own way (push, your chat, Titli Chat) // 3. ...and on the other phone, join it. await TitliVideo.joinCall(callId);
The App Key is publishable, not a secret: it can only reach the app-facing routes, it is bound to your package name, bundle ID or website, and spend and usage caps fence it. The binding is a deterrent, not a lock (a determined attacker can copy an app's identity), so the caps are what limit the damage. For strict control, add server tokens (production hardening below). Quick mode: bindings, caps and error codes · Read the Client API (Quick mode).
Quick mode notes for a fitness app
- Who starts the call. Let the trainer’s app start it, a few minutes before the batch. The trainer is then the caller, and members join.
- How members learn the call id. Without a backend, post it where the batch already talks: a group conversation per batch in Titli Chat (it has call invites), or your own push message. With a backend, store it against the class and show a Join button on the timetable.
- Room size. Quick mode uses the same room size as the rest of your account: two by default. Ask support to raise it before the first group class, or the third person cannot join.
- Set the Quick-mode limits for real teaching days. In the console under Projects → Quick mode you set the longest Quick-mode call, the minutes one user may use in a day, and a daily spend cap for the project. A trainer who teaches six batches is connected for 270 minutes in a day, so the per-user daily minutes must sit above that, or the sixth class is cut. 12 classes a day cost about ₹972, so set the daily spend cap above that too.
- Same SDK on the web. A trainer who teaches from a laptop, or a member who joins from a TV browser, uses the web SDK with the same App Key and the same call id.
Production hardening (optional): server tokens
You do not need a server to start: Quick mode works with the App Key alone. Add a server when you want strict control over every call (who joins which call, for how long, in which role): keep the project key on your server and mint a short-lived join token per person there. The app uses the same SDK and hands it a token instead of the App Key. Both ways can run side by side.
For a fitness app the trigger is usually booked-only classes. In Quick mode anyone who has the call id and your app can join, which is fine for a free community class and not fine for a paid batch. With server tokens, your server creates one call per class and mints a token only for the trainer and for members who have a booking.
// class-call.js (Node 20+). Runs on YOUR server; the project key never ships in an app.
const API = 'https://api-videosdk.titliapp.com';
const AUTH = 'Basic ' + Buffer.from(`${process.env.TITLI_KEY_ID}:${process.env.TITLI_KEY_SECRET}`).toString('base64');
const titli = async (method, path, body) => {
const r = await fetch(API + path, { method, headers: { Authorization: AUTH, 'Content-Type': 'application/json' }, body: body && JSON.stringify(body) });
const j = await r.json();
if (!r.ok) throw Object.assign(new Error(j.error?.code || String(r.status)), { status: r.status });
return j;
};
// 1. A few minutes before the batch: one call per class, capped at the class length plus a short grace.
export async function openClass(cls) {
const call = await titli('POST', '/v1/calls', { type: 'video', max_duration_seconds: (cls.minutes + 10) * 60 });
await db.classes.update(cls.id, { callId: call.id });
return call.id;
}
// 2. When someone taps Join: the trainer gets the host role; a member gets a token only if they booked.
export async function joinToken(cls, person) {
const isTrainer = person.id === cls.trainerId;
if (!isTrainer && !(await db.bookings.exists(cls.id, person.id))) throw new Error('not_booked');
return titli('POST', `/v1/calls/${cls.callId}/tokens`, {
end_user_id: person.id, role: isTrainer ? 'host' : 'user', name: person.firstName, ttl_seconds: 300,
}); // -> { token, livekit_url, expires_at, ... } send it to THIS person only
}
// 3. Someone is disrupting the class: take that one member out. The class carries on.
export const removeMember = (cls, memberId) => titli('POST', `/v1/calls/${cls.callId}/participants/${memberId}/remove`);The trainer gets the host role and members the default user role. The time cap is the class length plus 10 minutes of grace, here max_duration_seconds = 3300, so a class can never run into the next batch’s slot. Tokens expire after 10 minutes by default; that limits when someone can join, not how long they stay. Mint them when the member taps Join, not the night before. In the app, a token replaces the App Key:
import 'package:titli_video_sdk/titli_video_sdk.dart';
// token and livekitUrl came from YOUR backend (joinToken above), after it checked the booking.
final call = await TitliCall.connect(url: livekitUrl, token: token, video: true);Attendance from the join and leave webhooks
Streaks, class packs and trainer payouts all depend on who actually turned up and for how long. Do not count that in the app. Titli sends your backend a signed event when each person joins and leaves, and a call-ended event with a receipt that lists every session and its billable seconds.
// attendance.js: called from your webhook receiver AFTER the signature check.
// name = the Titli-Event header; dedupe on the Titli-Delivery header, because deliveries are retried.
export async function onTitliEvent(name, data) {
if (name === 'participant.joined') await db.attendance.open(data.call_id, data.end_user_id, data.at);
if (name === 'participant.left') await db.attendance.close(data.call_id, data.end_user_id, data.at);
if (name === 'call.ended') {
// The signed receipt lists every session with its billable seconds: the final word for streaks,
// class packs and the trainer's payout. Keep the receipt and its signature with the class.
const { call, receipt, receipt_signature } = data;
for (const p of receipt.participants) await db.attendance.settle(call.id, p.end_user_id, p.billable_seconds);
await db.classes.update(call.id, { status: 'done', receipt, receiptSignature: receipt_signature });
}
}Webhook deliveries are signed with HMAC and retried after 10 seconds, 1 minute, 5 minutes and 30 minutes, so the same event can arrive twice: dedupe on the delivery id. A member who drops and rejoins shows up as two sessions; add them up. A rule such as “counts as attended after 30 connected minutes” is yours to choose. Signature checks and receipt verification are in Webhooks and signed receipts.
Camera placement and weak networks
Video quality in a fitness class is mostly about where the phone stands, not about the network. Put this advice in your app’s pre-class screen.
- Whole body in frame. Phone in landscape, two to three metres away, at hip height, propped on a stand or against a wall. For yoga the trainer needs to see the feet and the head in one frame.
- Light in front, not behind. A window behind the member turns them into a silhouette. Face the light.
- Front or back camera. The back camera usually has the better lens; the front camera lets the member see the screen. Let them choose.
- Trainer on a laptop or a tablet. A grid of 8 members is easier to watch on a bigger screen, and the web SDK runs in a current browser.
On the network side, members join from home Wi-Fi shared with a family streaming cricket, or from 4G on a terrace.
- Adaptive video, up to 720p. Video tops out at 720p, which is enough to see posture on a phone or laptop, and steps down when the network is weak. Each device receives the video its screen and network can take, so one member on a slow connection does not freeze the class for everyone.
- Voice first. When the network cannot carry video, voice keeps going, so the member can still follow the count.
- Short drops are absorbed. The SDK reports a reconnecting state while it recovers, and rejoining continues the same class. If everyone drops, the call stays open for 30 seconds.
- Data use. Turning the camera off saves the member’s data, but they are still connected and still counted as a participant.
Safety and the medical disclaimer
A live class puts real people through real exercise at home, with nobody in the room. Your app should own these parts:
- A short health questionnaire before the first class, and a clear note that members with a heart condition, pregnancy, recent surgery or injury should consult a doctor first.
- Modifications shown by the trainer for beginners and older members, and a way for a member to say privately in chat that something hurts.
- Verified trainer credentials, and a reporting and removal flow for anyone who behaves badly in a class.
- Terms that say the classes are general fitness guidance, not medical treatment.
This guide is engineering guidance, not medical or legal advice. Titli is a calling platform, not a medical service. If your app gives physiotherapy, clinical nutrition or other health advice, the professional and data protection rules for that are yours to meet; see the telehealth guide for the patient-data side.
What Titli does not do
- No recording and no replays. Classes are not recorded or stored, so you cannot sell replays from our platform.
- No large-audience broadcast as a self-serve API. Rooms go up to 50 people on request. A one-to-many live stream with co-host seats is an integration package we build per project, not something you switch on.
- No screen share or whiteboard claims. Share workout plans and diet charts in chat instead.
- No payments from your members. Subscriptions, packs and trainer payouts run through your own payment provider. Titli bills only you, from your prepaid balance.
- No phone-number calling, no uptime SLA and no certifications such as SOC 2 or ISO 27001 today. Video is capped at 720p.
Frequently asked questions
How do I build a live fitness class app with video calls?
Start with Quick mode: put your App Key in the member and trainer apps, let the trainer start a video call when the batch begins, and let members join with the call id. Ask support to raise your room size above two people (up to 50). For booked-only classes, add server tokens later so only members who booked can get in.
Can the trainer see every member in a group class?
Yes. It is two-way video: every member’s camera reaches the trainer, and members can see each other too. The media server sends each phone a version of each video that suits its screen and network, so a trainer looking at a grid of 8 small tiles is not pulling 8 full-size streams.
What does a 45-minute live group class cost?
A trainer and 8 members for 45 minutes is 9 × 45 = 405 participant-minutes. At the list price that is ₹81 on video ($0.9315 on a USD account). A 1:1 personal training session of the same length is 90 participant-minutes: ₹18 ($0.207).
Do members pay per minute?
That is your decision. Most fitness apps sell drop-in classes, monthly subscriptions or packs of personal sessions. Titli bills only you, the app, for the minutes people are connected, and never collects money from your members.
Can I record classes and sell replays?
Not through Titli. There is no recording: audio and video pass through the media servers in real time and are not stored. If replays are part of your product, record your own studio sessions with a separate tool.
Can members join from a laptop or a TV browser?
Yes, from a current browser through the web SDK. A member on a laptop and a member on a phone can be in the same class. The web SDK is the same App Key and the same call id.
How many people can be in one live class?
Rooms hold two people by default. Support raises the room size for your account on request, up to 50 people per room. Bigger audiences, such as a 500-person yoga day session, are not a fit for this API.
Next steps
- See the product page: video SDK for fitness and yoga apps, and the related coaching and events and webinars pages.
- Make your first call with the Flutter guide or the quickstart, then read Quick mode: bindings, caps and error codes.
- When you add booked-only classes, set up webhooks and read Webhooks and signed receipts.
- Check the price list, and ask support to raise your room size before the first group batch.
