← Back to projects
CalFit - Personal Fitness & Nutrition AI Coach
Mobile App · Fitness & Nutrition AILive
2026

CalFit - Personal Fitness & Nutrition AI Coach

A full-featured fitness and nutrition app powered by AI — personalized workouts, meal plans, calorie tracking, AI coach, food scanner, sleep/fasting/measurement tracking, accountability partners, and detailed analytics. One codebase ships to iOS, Android, and Web.

Role: Product Designer, Mobile Developer & AI Systems Engineer
React NativeExpo SDK 54TypeScriptSupabaseNVIDIA Llama 3.1AI CoachDeepgram STTFood Scanner
Want the full licensed source code? Purchase the complete source code with all features, access to updates, and commercial license. Perfect for launching your own fitness app.
Tagline

Your personal AI-powered fitness and nutrition companion

Platform

iOS, Android, Web (responsive, max-width 480px)

Tech Stack

React Native 0.81.5 + Expo SDK 54 + TypeScript 5.9

Backend

Supabase (PostgreSQL, Auth, Realtime, Edge Functions)

AI

NVIDIA Llama 3.1 70B (chat/workout/meal gen) + Llama 3.2 90B Vision (food scanner)

Voice

Deepgram STT + expo-speech (TTS workout cues)

Developer

AOT (aotnetworklabs@gmail.com)

iOS / Android Build

Postponed (Web demo available now)

Key Differentiators
100% Anonymous — No email/password/social sign-up required
AI-First — AI generates workouts, meal plans, food recognition, coaching
Localized for Nigeria — AI knows local ingredients, markets, pricing
Multi-Platform — One codebase ships to iOS, Android, and Web
Privacy-Focused — Minimal data collection, anonymous by default
No Subscription Required — All features currently free
Accountability Partners — Shared streaks and real-time chat

1. Overview & Architecture

CalFit is a full-featured fitness and nutrition app powered by AI. Users can generate personalized workouts and meal plans, track calories and macros, log sleep and body measurements, manage intermittent fasting, chat with an AI coach (with voice input), partner with friends for accountability, scan food with the camera, and monitor progress with detailed analytics and exportable reports.

State Management (Zustand)

StorePurpose
authStoreUser, session, profile, onboarding status, live steps count
themeStoreLight/dark color scheme
aiCoachStoreCurrent AI workout, saved workouts, chat messages, loading state
mealPlanStoreCurrent AI meal plan, saved plans, loading state

Key Services

ServicePurpose
supabase.tsSupabase client with cross-platform storage
nvidia-client.tsAll NVIDIA AI API calls
foodSearchService.tsOpen Food Facts API + Nigerian local food DB
profileService.tsProfile CRUD, daily queries
notificationService.tsxIn-app notification CRUD
reminderService.tsScheduled local notifications
aiAnalysisService.tsWorkout trend analysis & predictions
imageService.tsCamera/gallery picking, avatar upload
VoiceRecorderService.tsAudio recording + Deepgram transcription
stepService.tsPedometer subscription, step data persistence

2. Navigation Structure

The app uses React Navigation v7 with conditional stacks based on auth state.

Root Level

NavigationContainer ├── user && !isOnboarding → AppStack └── otherwise → AuthStack

4 Tab Navigator + Floating Radial Menu

Home — Dashboard with stats, streaks, quick-log buttons

Calorie — Daily calorie tracking, macros, water intake

AI Coach — Generate workouts, saved plans, chat with AI

Notes — Full CRUD journal with AI integration

The center "+" button opens a radial menu with: Activity, Health, Meal Plans, Progress, Scan Food.

3. Auth Flow

CalFit uses anonymous authentication — no email, no password, no social login required. Users tap "Get Started", complete a 5-step onboarding wizard, and an anonymous Supabase session is created automatically. Sessions persist via SecureStore (native) or localStorage (web) for return visits.

4. Dashboard (HomeScreen)

Central command center showing the user's fitness status at a glance:

  • Greeting header with user name, notification bell, avatar
  • ComebackBanner — detects 2+ days inactivity, encourages return
  • BurnoutBanner — alerts when sleep is low and activity is high
  • StreakRow — weekly calendar with ring-shaped day dots
  • HeroCarousel — 3 auto-scrolling slides (Calories, Macros, Stats)
  • StatCards — water, steps, sleep progress
  • QuickLog buttons — +Food, +Water, +Sleep, Workout
  • Accountability Partners card + Streaks card

5. Workouts & Activity

48 bodyweight exercises across 8 categories (Chest, Back, Legs, Shoulders, Arms, Core, Cardio, Full Body), each with duration, calorie burn rate, difficulty, muscle groups, equipment needs, and step-by-step instructions.

QuickStart Workout Session

  • Timer counts workout duration
  • TTS voice cues announce exercise name, duration, countdown
  • Auto-advance between exercises with 3s rest
  • Animated exercise demos with countdown
  • AI workout support with sets/reps/rest/form tips
  • Auto-save to workout_sessions on completion

AnalysisScreen

Period selector (7d, 30d, 90d) with total sessions, calories, duration, streak tracking, weekly breakdown charts, category distribution, trend analysis, goal prediction, milestone progress, AI-generated suggestions, and PDF export.

6. AI Coach

Three-tab interface providing AI-powered fitness guidance:

Generate

Workout form: fitness level, goals, duration, equipment. AI generates a complete workout with warmup, exercises (sets/reps/rest/form tips), and cooldown. Save or regenerate. Results cached for 5 minutes.

Saved

List of previously saved AI-generated workouts with delete option.

Chat

Full conversational AI coach with message bubbles, voice mic input (Deepgram STT), suggested prompt chips, chat history persisted to Supabase. AI can inline-generate workouts from chat commands. System prompt: certified fitness coach with 15 years experience.

7. Calorie & Nutrition Tracking

Daily calorie tracking hub with hero card showing consumed vs goal, recipe suggestions based on remaining macros, macro progress bars (protein/carbs/fat), water intake with +250ml quick-add, and meal sections for Breakfast, Lunch, Dinner, Snacks.

Food Database

Search via Open Food Facts API with fallback to a built-in Nigerian local food database (25 entries: Jollof Rice, Egusi Soup, Suya, Moi Moi, etc.) and AI lookup via NVIDIA for any typed food. 7-day calorie trend chart included.

8. Meal Plans (AI-Generated)

7-step guided questionnaire covering health goal, budget, cuisine preference (Nigerian, Italian, Asian, etc.), dietary preferences, meals per day, excluded foods, and calorie target. Generates via NVIDIA AI with local Nigerian ingredient knowledge. Plans include title, description, daily calories, budget level, meals with macros, and AI notes.

9. Health Tracking

Steps — Pedometer via expo-sensors, live count in Zustand store, saved every 60s to step_logs, goal notifications.

Water Intake — Quick-add +250ml from dashboard or calorie screen, configurable daily goal, visual progress bar.

10. Intermittent Fasting

Protocol selection: 16:8, 18:6, 20:4, 24hr, 5:2. Active timer with progress ring. Logged to fasting_logs table. Accessible from the Health tab.

11. Journal (Notes)

Full CRUD journal with welcome view, rich editor (title, date, content), toolbar with "Send to AI Coach" for discussing entries, save/share/delete. Slide-out sidebar drawer for navigation. Synced to Supabase notes table.

12. Accountability Partners

Add up to 3 partners by CalFit ID. Bidirectional partner connections. Shared dashboard with side-by-side streak comparison (VS bar). Shared goals via modal. Milestone notifications at 7, 14, 21, 30, 60, 90, 100 days.

PartnerChat

Real-time messaging via Supabase Realtime subscriptions with read receipts and push notifications on new messages.

13. Progress & Analytics

Comprehensive dashboard with period selector (Week, Month, 3 Months, Year). Calorie consumed vs burned chart, workout stats, water/sleep averages, step counts, weight tracking, BMI display, body measurements comparison, recent workouts, streak count, and PDF export.

RecapScreen

Shareable recap cards with 5 design templates (Bold, Gradient, Dark, Sunrise, Minimal) and Daily/Weekly/Monthly recaps. Image export via react-native-view-shot.

14. Streaks & Milestones

Current streak with day dots, milestone badges at 3, 7, 14, 30, 60, 90, 180, 365 days with emoji celebrations, partner comparison, weekly calendar view, and daily push reminder. Streak logic: daily check-in increments, missed day resets.

15. Sleep Tracking

Log sleep hours (1–12, 0.5 increments), quality rating (1–5 with emoji), notes field, 7-day bar chart history, goal progress, average hours calculation. Stored in sleep_logs table.

16. Body Measurements

Track chest, waist, hips, arms, thighs, neck, and body fat %. Form fields with historical measurements list and trend indicators (up/down arrows). Stored in body_measurements table.

17. Food Scanner (AI Vision)

Camera capture via expo-camera or gallery pick via expo-image-picker. Sends base64 JPEG to NVIDIA Llama 3.2 90B Vision model via Supabase Edge Function proxy. Returns detected food items with calories, protein, carbs, fat, and serving size. Results shown in card UI with "Log Food" button.

18. Notifications

9 notification types: achievement, social, streak, upgrade, coach, community, goal, system, welcome. Filter by type, mark as read, mark all read, delete. Trigger functions throughout the app for workouts, streaks, food logging, water/calorie goals, coach responses, partner messages, and more.

Scheduled Reminders

Meal, water, workout, sleep, and streak reminders scheduled as daily local notifications via expo-notifications. Toggleable from Settings.

19. Settings & Profile

Profile card with name and avatar, notification preferences (toggled via SecureStore), theme toggle (light/dark), navigation items for Privacy Policy, Goals, Equipment Preferences, Download My Data, and Subscription. Account actions include Sign Out and Delete Account. Editable fields: name, username, height, weight, goal, activity level, dietary preferences, and all daily goals.

Equipment Preferences

Select available equipment for AI workout generation.

Download My Data

Export all user data as CSV or text report.

20. Subscription & Monetization

Three tiers (Starter, Pro, Premium) displayed in a subscription screen. Currently all features are free — the infrastructure, tier display, and upgrade prompts are in place and ready for App Store/Play Store IAP deployment.

21. Data Flow & Services

AI API Flow

Client → Supabase Edge Function (ai-proxy) → NVIDIA API → Response → Edge Function → Client

3 retries with exponential backoff (1s, 2s, 4s). Usage logged to ai_api_usage table. Hardcoded fallbacks if NVIDIA is unavailable.

Voice Transcription Flow

Client (audio) → Edge Function (deepgram-proxy) → Deepgram API → Text → Client → AI Coach Chat

Step Tracking Flow

Pedometer sensor → expo-sensors → Zustand authStore.liveSteps → All screens → Saved to step_logs every 60s.

22. Supabase Database Schema

TableKey ColumnsPurpose
profilesid, calfit_id, full_name, goal, height_cm, weight_kg, daily_calorie_goal, step_goal, water_goal, sleep_goal, streak_count, last_active_date, avatar_urlUser profile and settings
food_logsid, user_id, food_name, calories, protein, carbs, fat, meal_type, logged_atDaily meal entries
water_logsid, user_id, amount_ml, logged_atWater intake records
workout_sessionsid, user_id, name, status, calories_burned, duration_seconds, exercises, completed_atCompleted workout sessions
workout_routinesid, user_id, name, exercises, created_atSaved custom routines
step_logsid, user_id, steps, dateDaily step counts
sleep_logsid, user_id, hours, quality, notes, dateSleep duration and quality
fasting_logsid, user_id, protocol, fast_hours, eating_hours, started_at, ended_atFasting sessions
notificationsid, user_id, type, title, body, read, created_atIn-app notification inbox
ai_generated_workoutsid, user_id, title, duration, difficulty, exercises, warmup, cooldownSaved AI workouts
ai_generated_meal_plansid, user_id, title, daily_calories, meals, budget_levelSaved AI meal plans
chat_messagesid, user_id, role, content, created_atAI Coach chat history
partner_messagesid, sender_id, receiver_id, content, created_at, readAccountability chat
partnersid, user_id, partner_id, statusPartner relationships
notesid, user_id, title, content, created_atJournal entries
body_measurementsid, user_id, chest, waist, hips, arms, thighs, neck, body_fat, measured_atBody measurement history
ai_api_usageid, user_id, endpoint, model, tokens, latency, statusAI API usage logging

Edge Functions

ai-proxy — Proxies NVIDIA AI calls (Llama 3.1 70B for chat/workout/meal gen, Llama 3.2 90B Vision for food scanning).

deepgram-proxy — Proxies audio transcription to Deepgram API.

23. Theming & Design System

Color Palette

Primary: CalFit Green (#0DAE6C / #34D98A) — CTAs, active nav, coach buttons.

Backgrounds: Light lavender (#F4F0FF), Dark indigo (#08061A)

Gradients: Pink → Orange → Yellow for scan food banner, streak badges, primary CTAs.

Macro colors: Protein (orange #FF6B35), Carbs (yellow #FFB830), Fat (blue #4A90E2)

Typography

Plus Jakarta Sans (Google Fonts) — 7 weights available. App uses 900 (black), 800 (extrabold), 700 (bold), 600 (semibold).

Responsive Design

Web version centered in max-width 480px container (phone-like layout). Adaptive font sizing via moderateScale() based on 390px base width.

Light/Dark Mode

Toggle persisted in Zustand (default: light). Full separate color definitions with glass effect overlays and adaptive StatusBar.

Read the full story: How I Built CalFit → Medium Blog Post