AI-Powered Fitness Tracking with Real-Time Pose Detection
FitnessPipe is a cross-platform Flutter application that uses AI-powered pose estimation to track your exercise form in real-time. Built with Google ML Kit for pose detection, it works completely offline with all ML models bundled in the app.
- π― Real-time Pose Detection - Track 33 body landmarks using MediaPipe
- π± Cross-Platform - Runs on iOS, macOS, and Android
- π Offline-First - All ML models bundled, no internet required
- π China-Compatible - No Firebase or Google Cloud dependencies
- π¨ Live Skeleton Overlay - Visual feedback of detected pose
- π· Multi-Camera Support - Front and back camera support with proper mirroring
- Flutter SDK: 3.38.0 or higher
- Dart SDK: 3.8.0 or higher
- Platform-specific tools:
- iOS/macOS: Xcode 14.0+, CocoaPods
- Android: Android Studio, Android SDK 21+
-
Clone the repository
git clone https://github.com/yourusername/fitnessPipe.git cd fitnessPipe -
Install dependencies
flutter pub get
-
Install iOS/macOS pods (if building for Apple platforms)
cd ios && pod install && cd .. # or for macOS cd macos && pod install && cd ..
-
Configure iOS Development Team (required for iOS device builds)
# Copy the template cp ios/Config.local.xcconfig.template ios/Config.local.xcconfig # Edit ios/Config.local.xcconfig and set: # DEVELOPMENT_TEAM = your Apple Developer Team ID (Xcode > Preferences > Accounts) # PRODUCT_BUNDLE_IDENTIFIER = a unique bundle ID, e.g. com.yourname.fitnessPipe
# List available devices
flutter devices
# Run on connected iPhone
flutter run -d <device-id>
# Or simply run on any available iOS device
flutter runNote: Make sure you've configured your development team in
ios/Config.local.xcconfig(see Installation step 4).
To run on the iOS Simulator, use the helper script which handles Rosetta mode automatically:
./run_rosetta.shFor detailed information about the Simulator setup and Virtual Camera architecture, see docs/ios_simulator.md.
flutter run -d macos# Run on connected Android device or emulator
flutter run -d <device-id># Build without code signing (for CI/testing)
flutter build ios --no-codesign
# Build with code signing (for distribution)
flutter build iosThe built app will be at build/ios/iphoneos/Runner.app
flutter build macosThe built app will be at build/macos/Build/Products/Release/fitness_pipe.app
# Build APK
flutter build apk
# Build App Bundle (for Play Store)
flutter build appbundleThe built APK will be at build/app/outputs/flutter-apk/app-release.apk
lib/
βββ main.dart # App entry point
βββ domain/ # Business logic layer
β βββ models/ # Data models (Pose, PoseLandmark)
β βββ interfaces/ # Abstract interfaces (PoseDetector)
βββ data/ # Data layer
β βββ ml_kit/ # ML Kit implementation
βββ presentation/ # UI layer
βββ screens/ # App screens
βββ widgets/ # Reusable widgets
Before committing any changes, run:
# Analyze code for errors and warnings
flutter analyze
# Run tests
flutter test
(cd packages/fitness_counter && flutter test)
# Format code
dart format lib/ test/ packages/Or use the verification workflow:
flutter analyze && flutter test && (cd packages/fitness_counter && flutter test) && dart format lib/ test/ packages/ --set-exit-if-changedFitnessPipe follows clean architecture principles with three main layers:
- Presentation Layer: Flutter UI widgets and screens
- Domain Layer: Business logic and data models
- Data Layer: ML Kit integration and pose detection implementation
The app uses an abstract PoseDetector interface, making it easy to swap ML backends in the future (e.g., native MediaPipe via FFI for better performance).
For detailed architecture documentation, see docs/architecture.md.
- iOS: 13.0+
- macOS: 10.14+
- Android: API 21+ (Android 5.0 Lollipop)
The app requires camera access:
- iOS/macOS: Camera permission is requested at runtime
- Android: Camera permission is declared in AndroidManifest.xml
flutter test
(cd packages/fitness_counter && flutter test)flutter test test/unit/pose_detector_test.dartThe exercise counting logic is isolated in the packages/fitness_counter directory. To run logic tests for counters (including lateral raise):
cd packages/fitness_counter
flutter testTo run a specific test file within the package:
cd packages/fitness_counter
flutter test test/lateral_raise_counter_test.dartContributions are welcome! Please read AGENTS.md for development guidelines.
- Create a feature branch
- Make your changes
- Run verification:
flutter analyze && flutter test && (cd packages/fitness_counter && flutter test) - Format code:
dart format lib/ test/ packages/ - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google ML Kit for pose detection
- MediaPipe for the pose estimation model
- Flutter team for the amazing framework
- Front camera mirroring is handled automatically by the platform
- Build artifacts may contain
.mobileprovisionfiles (already gitignored)
For issues and questions, please open an issue on GitHub.
Built with β€οΈ using Flutter and ML Kit