Guide Fitness

How to build a fitness coaching app

Trainer and client screens, plans, sessions and progress tracking, plus the Clean Architecture and BLoC setup behind them.

Short answer

A fitness coaching app is one app with two roles. Trainers build workout and meal plans, schedule and log sessions, and watch each client’s daily progress; clients follow their plans, log meals, workouts, weight and steps, and message their trainer. The hard parts aren’t the workout screens. They’re roles and permissions, plans that change while clients use them, session packages, and the store rules for payments, health data and account deletion. In Flutter, Clean Architecture with BLoC for state management keeps an app of this size testable and easy to change.

I built a trainer-and-client coaching platform for a client: a Flutter app for iOS and Android, built with Clean Architecture and BLoC for state management, on Firebase (Auth, Firestore, Storage and Cloud Functions), plus a React and TypeScript web admin for the shared exercise library.

It covers what a personal-training business actually runs on: finding a trainer, agreements and session packages, workout and meal plans, daily check-ins, progress photos, chat and a shared calendar. Here’s what to build, and the decisions that matter most.

One app, two roles

Trainers and clients use the same app. The account type decides which tabs appear, so both sides share one codebase, one design system and one backend.

TabClient seesTrainer sees
HomeToday’s meals, workouts and trackers, their trainer, and a check-in QR codeEvery client’s day at a glance, and who is on target
PlansTheir workout, meal, macro and habit plans (read-only)Plan editors, templates and the exercise library
Log / SessionsA daily log: meals, exercises, weight, water, sleep, steps and photosSession packages, sessions left and QR check-in
CalendarBooked sessions and their own availabilityDay, week and month views, recurring sessions and working hours
Trainer / ClientsFind a trainer on a map, then their trainer’s profileActive and inactive clients, with details and history

Client screens

Clients open the app for a minute or two a day. Everything they need should be one or two taps from the home screen.

  1. Onboarding. Sign-up questions about goals, body measurements and location, so the trainer starts with real numbers.
  2. Today. The day’s meals, workouts and tracker targets with progress, plus the trainer’s card and a Message button.
  3. Daily log. Tick off meals and exercises, and log weight, water, sleep and steps against the targets the trainer set.
  4. Plans. Workouts with demo videos, meal and macro plans, and habit targets. All read-only, with a “modify my plan” shortcut into the trainer chat.
  5. Find a trainer. Map and list results with filters for services and distance, and public profiles with qualifications, hours and a photo gallery.
  6. Schedule. Upcoming sessions and the client’s own availability, so the trainer can book around it.
  7. Agreements. Accept or decline the trainer’s offer (the package and number of sessions) before coaching starts.
  8. Progress photos. Side-by-side comparisons with date and weight overlays, a natural premium feature.
  9. Chat. Messages with their trainer. Writing to a trainer who isn’t theirs yet becomes a request the trainer can accept or decline.

UX rules for the client side

  • Logging must take seconds. Ticks and steppers, not forms. A missed day should be easy to fill in later.
  • Show progress against a target. “1.6 of 2.5 litres” motivates more than a number on its own.
  • Read steps automatically. From HealthKit on iOS and Health Connect on Android, with the phone’s motion sensors as a fallback.
  • Keep photos private by default. Progress photos are personal. Only the owner should be able to upload them, and nothing should be public.

Trainer screens

Trainers run a business from this side of the app. Speed across many clients matters more than polish.

  • Client overview. Every client’s day on one screen (meals, workouts and trackers), with who is on target and who has gone quiet.
  • Plan builder. Workout, meal and macro plans built from day or program templates, duplicated and assigned to several clients at once.
  • Exercise library. Exercises with demo videos, muscle groups and equipment. Trainers upload their own, and an admin can bulk-import a library from a spreadsheet.
  • Habit targets. Per-client targets for water, sleep, steps and weight that drive the client’s daily log.
  • Sessions. Packages with sessions left, check-in by scanning the client’s QR code, and a renewal alert when a package runs out.
  • Calendar. Day, week and month views, recurring sessions, weekly working hours and each client’s availability.
  • Agreements. Offers with a clear status (pending, active, completed or cancelled), so both sides know what was agreed.
  • Public profile. Services, experience, working hours, languages, location and a gallery, shown in Find a trainer.
  • Analytics and broadcasts. 7- and 30-day completion for each client, and one message to many clients at once.

Architecture: Flutter and Firebase

Firebase fits this product well: real-time updates for chat and daily logs, file storage for videos and photos, and security rules for a two-role permission model, with no servers to run.

  1. Flutter app. One codebase for iOS and Android, organised by feature, with Clean Architecture for structure and BLoC for state management (details below).
  2. Firebase Auth. Accounts for both roles; the role lives on the user’s profile document.
  3. Firestore. Users, plans, one log document per client per day, sessions per trainer and client, agreements, calendar appointments and chats.
  4. Cloud Storage. Exercise demo videos, profile pictures, trainer galleries and progress photos, with rules on who may write each path.
  5. Cloud Functions. Work that must not run on a phone: a proxy that keeps the Google Places API key off the device, and sending trainer broadcasts to every recipient.
  6. Web admin. React, TypeScript and MUI for the shared exercise library, including CSV bulk upload.

Design decisions to make early

  • Security rules are your permission system. A trainer may change only the plan and habit fields on a client’s record; a client may only accept or decline a pending offer. Test the rules in the Firebase emulator, not in production.
  • One log document per day. Storing each client’s day under its date keeps streaks, trainer dashboards and 7- or 30-day analytics to simple queries.
  • Give each client their own copy of a plan. Assigning a plan writes it into the client’s record, and every later change notifies them, so plans never change silently.
  • Recurring sessions are a rule plus exceptions. Store the series once, expand the dates in the app, and record moved or cancelled dates as exceptions.
  • Count sessions atomically. Logging the last session of a package and completing its agreement happen in one batch write, so the count can never drift.
  • Keep API keys on the server. Keys for maps or food databases shipped inside an app can be extracted and billed to you. Put them behind a Cloud Function.

Clean Architecture and BLoC

The app is built with Clean Architecture and uses BLoC for state management. With two roles and around twenty features, this is what keeps it maintainable: each feature changes on its own, business rules are tested without a device, and Firebase stays behind interfaces.

  1. Data layer. Firebase data sources, models and repository implementations. It is the only code that talks to Firestore, Storage or Auth.
  2. Domain layer. Entities, repository contracts and use cases. Use cases return Either<Failure, T>, so every screen handles errors the same way.
  3. Presentation layer. BLoCs and Cubits that turn use-case results into states, and widgets that only render those states.

How BLoC is used

  • One BLoC or Cubit per screen. Created with the screen and closed with it, so listeners and streams never leak.
  • Shared state as singletons. Chat, plans and the client list are app-wide BLoCs registered once, so every tab sees the same data.
  • Dependency injection with GetIt. Data sources, repositories, use cases and BLoCs are wired in one place, which makes swapping in fakes for tests easy.
  • Tests. Unit and widget tests cover data sources, BLoCs, Cubits and domain logic, using a fake Firestore and mocked sign-in.

Payments, health data and store rules

These rules shape your business model, so check them before you design checkout.

  • In-person training. Sessions that happen outside the app are paid with ordinary methods such as Stripe. Apple doesn’t allow in-app purchase for them.
  • Live one-to-one online coaching. Apple lets real-time, one-to-one services such as personal training use other payment methods (App Store guideline 3.1.3(d)).
  • Programs, videos, premium features and chat-only coaching. Digital content, group classes and asynchronous coaching by message generally need Apple’s and Google’s in-app purchase. The rules vary by country and keep changing, so confirm them for your markets.
  • Health data. Reading steps or workouts from HealthKit or Health Connect needs clear permission prompts and a privacy policy that explains how the data is used.
  • Account deletion. Both stores require in-app account deletion. Decide early what happens to a trainer’s clients, chats, sessions and photos when either side leaves.
  • Push notifications. An in-app inbox is a good start; push for new plans, bookings and messages is what brings clients back each day.

A sensible build order

  1. Accounts and roles. Sign-up for both sides and the role-based home screens.
  2. Plans and the daily log. The core loop: the trainer assigns, the client logs, the trainer sees it.
  3. Chat and notifications. Questions and plan changes stay inside the app.
  4. Sessions, agreements and calendar. Packages, check-ins and scheduling.
  5. Find a trainer. Only if you are a marketplace; a single studio can skip it.
  6. Premium features and payments. Progress photos, analytics and checkout, within the store rules above.

FAQ

What features does a fitness coaching app need?

Separate trainer and client experiences in one app: workout, meal and habit plans; a daily log for meals, workouts, weight, water, sleep and steps; chat; session packages with check-in; a shared calendar; progress photos; and per-client analytics for the trainer.

Should a Flutter fitness app use Clean Architecture and BLoC?

For an app with two roles and many features, yes. This one uses Clean Architecture (data, domain and presentation layers in every feature) and BLoC for state management, so features stay independent, business rules are unit-tested, and the backend can change without rewriting screens.

Can a fitness app use Stripe instead of in-app purchase?

For in-person training, yes. Apple requires payment outside in-app purchase for services used outside the app. Apple also allows other payment methods for real-time one-to-one services such as live personal training. Digital content, group classes and chat-only coaching generally need in-app purchase. Rules vary by country, so check the current App Store and Google Play policies.

Is Firebase a good backend for a fitness coaching app?

For most coaching apps, yes: Firestore gives real-time updates for chat and daily logs, Cloud Storage holds videos and photos, and security rules handle trainer and client permissions. Keep API keys and bulk work in Cloud Functions.

How do fitness apps read step counts?

On iOS from HealthKit, with Core Motion as a fallback; on Android from Health Connect, with the phone’s step-counter sensor as a fallback. Both need the user’s permission.

Is Flutter a good choice for a fitness app?

Yes. One Flutter codebase covers iOS and Android, including video playback, maps, QR scanning, camera uploads and native health data through platform channels.