Your daily Fitness, answered.


What Inspired Me

The idea came from a frustration I kept running into personally — and hearing from others.

Fitness apps are everywhere. Fitness trackers, meditation timers, habit logs, nutrition counters, sleep monitors. Each one does its job well in isolation. But using five different apps to manage your health creates its own kind of exhaustion. You still wake up every morning with the same unanswered question: "What should I actually do today?"

No app was answering that. They were all giving you more data, more content, more things to track — but none of them were synthesising it into a single, clear, personal recommendation for today, based on how you actually feel right now.

That gap became the mission. Not another Fitness library. A companion that listens, thinks, and hands you a plan that fits your energy, your mood, your recovery, and your available time — every single morning.


What I Built

AI Fitness Companion is a Flutter iOS app powered by a conversational AI at its core. Each day starts with four questions — energy, mood, recovery, and available time — and those answers feed a personalised Today's Plan generated by the AI.

The app brings together everything a modern Fitness journey needs in one place:

  • Today's Plan — a daily AI-generated Fitness plan with step-by-step walkthroughs and one-tap habit creation
  • Live Companion — a real-time voice AI companion powered by Gemini Live, accessible by saying "Hey Companion" hands-free
  • Habit Builder — custom and pre-built habits with reminders, streaks, and a full Challenges system
  • Fitness Intentions — AI-generated step-by-step intention plans for bigger Fitness goals
  • Life Toolkit — Period Tracker, Body Weight, Hydration Coach, Nutrition, Calorie Budget, and Meal Planner
  • Fitness Studio — guided meditation and breathwork sessions
  • Fitness Reads — a curated article library with sentence-highlighted AI narration
  • Reflections — AI-generated personal reflections from Live Companion conversations, with tagging, pinning, and discussion
  • Achievement System — 44 badges across streaks, habits, challenges, intentions, reflections, and meditation milestones
  • iOS Widgets — live Home Screen widgets with real-time data, light/dark/flip variants, and deep-link navigation
  • Full personalisation — 6 AI voices, Fitness themes, seasonal modes, readability controls, and per-category push notifications

How I Built It

The app is built entirely in Flutter, targeting iOS, with Firebase as the backend for authentication, Firestore for data persistence, and Firebase Storage for media.

The AI layer uses Google Gemini — both the standard API for plan generation, reflections, and intention building, and Gemini Live for the real-time streaming voice conversation. The Live Companion session maintains a persistent audio stream, processes wake-word detection in the foreground, and manages turn-taking between the user's speech and the model's response.

Push notifications are handled via OneSignal, with a custom Notification Service Extension for rich delivery and per-category preference management.

In-app purchases and subscriptions are managed through RevenueCat, with premium features gated cleanly using a shared AppState provider and a PremiumFeatureException pattern that triggers paywalls contextually without scattering purchase logic across the codebase.

The iOS widget layer uses home_widget with a native Swift widget extension, deep-linking back into the correct app screen via a custom URI scheme.

State management is handled with Provider, with dedicated state classes per feature domain — AppState, FitnessPlanState, CheckInState, HabitBuilderState, ChallengeState, and more — keeping each feature testable and independent.


What I Learned

Conversational AI UX is hard to get right. The technical integration of Gemini is relatively straightforward. The hard part is designing the conversation so it never feels robotic — getting the greeting, the turn timing, the idle behaviour, and the personality to all feel like a real companion took far more iteration than any single feature.

Real-time audio is unforgiving. The Live Companion session manages microphone state, wake-word detection, audio playback, and network streaming simultaneously. A missed teardown, a missed cancel, or a mishandled async gap causes a crash or a frozen session. The most important engineering lesson here was: design teardown before you design startup.

Personalisation only creates value when it's felt, not just present. Early versions of the Today's Plan were technically personalised but users couldn't feel it. Surfacing the energy score, recovery status, and preferred Fitness methods as visible cards on the Home Screen — so users could see why the plan looked the way it did — was the change that made personalisation tangible.

Achievements need to feel earned, not collected. The first version of the achievement system was just a badge grid. It felt hollow. Adding confetti, staggered cannon animations, a dedicated completion page, and tying badges to genuinely meaningful moments — first habit, first reflection, first intention, 30-day streak — turned it into something users actually cared about reaching.


Challenges I Faced

Wake-word reliability on iOS. Apple's AVFoundation speech recogniser is designed for short, intentional dictation — not continuous background listening. Getting "Hey Companion" to trigger reliably without burning battery, crashing on repeated restarts, or falsely triggering on ambient sound required a custom coordinator with stall detection, automatic recycling, and a narration gate to suppress false positives while audio was playing.

OneSignal + APNs entitlement alignment. Adding push notifications late in development meant retrofitting the aps-environment entitlement, a Notification Service Extension, and App Groups into an existing provisioning setup — while keeping the existing HealthKit and in-app purchase capabilities intact. Registering the App Store Connect record and enabling the Sign in with Apple capability had to be coordinated carefully to avoid signing failures at build time.

Keeping the Home Screen from becoming the thing it was built to replace. The Home Screen can hold Today's Plan cards, Life Toolkit cards, Reflection cards, and AI Insight cards — all customisable, reorderable, and pinnable. The challenge was building enough flexibility for power users without turning it into an overwhelming dashboard for new ones. The solution was sensible defaults with progressive disclosure — a clean out-of-the-box experience that reveals depth only when the user reaches for it.

Narration accuracy in Fitness Reads. Sentence-by-sentence highlighting during AI narration requires matching the spoken audio position to the correct sentence in the text in real time. A race condition between the AVSpeechSynthesiser completion handler and the Dart-side playback loop caused early stops and missed highlights. Eliminating the dual-driver pattern and running a single Dart-controlled loop resolved it cleanly.


The Bigger Picture

Fitness technology has a real problem: it adds cognitive load in the name of reducing it. More dashboards, more data, more decisions. AI Fitness Companion takes the opposite position — the AI should absorb the complexity so the user never has to.

The goal was always an app that felt less like software and more like having a knowledgeable, calm friend who knows your body, your schedule, and your goals — and just tells you what to do.

That's what this is.

Built With

Share this project:

Updates

Submission history