FitFlow is a modern iOS fitness application powered by Google Gemini AI that provides personalized workout and nutrition plans. It tracks user activity data through HealthKit integration and offers AI-powered recommendations.
FitFlow's primary goal is to help users achieve their fitness goals by providing:
- Personalized Workout Plans: AI-generated weekly workout programs tailored to the user's physical characteristics, goals, and health data
- Nutrition Guidance: Daily meal plans and nutrition recommendations aligned with macro goals
- Health Data Integration: Automatic tracking of step count, calories burned, workout duration, and other health metrics through HealthKit
- User-Friendly Interface: An intuitive and easy-to-use interface built with modern SwiftUI
- 🤖 AI-Powered Program Generation: Personalized weekly workout and nutrition plans using Google Gemini AI
- 📊 HealthKit Integration: Automatic tracking of step count, calories burned, workout duration, and other health metrics
- 🎯 Goal-Oriented Approach: Customized programs for user goals such as weight loss, muscle gain, and endurance improvement
- 📱 Modern UI/UX: Clean and user-friendly interface built with SwiftUI
- 🍽️ Detailed Nutrition Plans: Meal recommendations and preparation recipes aligned with daily macro goals
- 🏋️ Exercise Videos: Visual guidance with YouTube video links for each exercise
- 📈 Progress Tracking: View progress through daily activity logs and metric cards
FitFlow uses a modular and maintainable architecture following modern iOS development principles:
- AppCoordinator: Application-wide navigation management
- Page transitions, sheet and fullscreen cover management
- Centralized navigation control to prevent code duplication
- DependencyContainer: Service registration and resolution using Singleton pattern
- @Injected Property Wrapper: Easy and clean dependency injection
- Protocol-based design for testability and flexibility
- View: UI layer with SwiftUI
- ViewModel: Business logic and state management
- Model: Data models and domain logic
FitFlow/
├── Core/
│ ├── Coordinator/ # Navigation management
│ ├── Manager/ # Service layer (HealthKit, Gemini, Storage, Tracking)
│ └── DependencyContainer.swift
├── Model/ # Data models
├── View/ # SwiftUI views
├── Shared/ # Shared UI components
├── Extension/ # Swift extensions
└── Constants/ # Constants and localization
- GeminiService: AI communication and program generation
- HealthManager: Reading and managing HealthKit data
- StorageManager: Local data storage (UserDefaults)
- TrackingManager: User activity tracking
- iOS 17.0+
- Xcode 15.0+
- Swift 5.9+
- Google Gemini API Key
- HealthKit permission (for running on iPhone)
git clone https://github.com/username/FitFlow.git
cd FitFlowA Google Gemini API key is required to use FitFlow's AI features:
- Create your API key from Google AI Studio
- Open the project in Xcode
- Right-click on
FitFlow.xcodeprojand select "Add Files to FitFlow..." - Create an
Info.plistfile (if it doesn't exist) or edit the existingInfo.plistfile - Add the following key to the
Info.plistfile:
<key>GEMINI_API_KEY</key>
<string>YOUR_API_KEY_HERE</string>Alternative Method (Build Settings):
- Go to project settings in Xcode
- Navigate to the "Info.plist Values" section in Build Settings
- Add the
GEMINI_API_KEYkey and enter its value
Important Security Note:
- Never commit your API key to Git
- Add
Info.plistto your.gitignorefile (if it contains sensitive information) - Store the API key securely in production environments
The project already includes HealthKit permissions in the FitFlow.entitlements file. If you're creating a new project:
- Go to project settings in Xcode
- Navigate to the "Signing & Capabilities" tab
- Click the "+ Capability" button
- Add "HealthKit"
open FitFlow.xcodeprojAfter opening the project in Xcode:
- Select a simulator or real device
- Run the project with ⌘ + R
-
Onboarding Process:
- When the app first opens, personal information (name, goal, height, weight, age) is collected from the user
- HealthKit permissions are requested
- AI creates a personalized program based on the user profile
-
Dashboard:
- Daily activity summary
- Macro goals and progress
- Quick metrics (calories burned, active time, workout count)
- Weekly program generated by AI
-
Workout Details:
- Daily workout plan
- Exercises, sets/reps information
- YouTube video links
-
Nutrition Plan:
- Daily meal recommendations
- Macro values
- Preparation recipes
- SwiftUI: Modern UI framework
- Combine: Reactive programming
- HealthKit: Health data integration
- Google Generative AI: AI-powered program generation
- MVVM: Architectural pattern
- Coordinator Pattern: Navigation management
- Dependency Injection: Modular design
FitFlow/
├── Assets.xcassets/ # Visual assets
├── Constants/ # Constants and localization
├── ContentView.swift # Main view
├── Core/
│ ├── Coordinator/ # Navigation coordinator
│ ├── Manager/ # Service managers
│ └── DependencyContainer.swift
├── Extension/ # Swift extensions
├── FitFlow.entitlements # App permissions
├── FitFlowApp.swift # App entry point
├── Model/ # Data models
├── Shared/UI/ # Shared UI components
└── View/ # Screen views
├── ActivityLogSheet/ # Activity log screen
├── AILoading/ # AI loading screen
├── Dashboard/ # Main dashboard
├── Error/ # Error screen
├── MealPlanDetail/ # Meal plan detail
├── Onboard/ # Onboarding flow
└── WorkoutDetail/ # Workout detail
- HealthKit data is stored on the device and never sent to any server
- Gemini API key is stored locally
- User data is kept on the device using UserDefaults
We welcome your contributions! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Note: This application is for educational and personal use purposes. It does not replace medical advice. Please consult a healthcare professional for any health concerns.