A comprehensive iOS fitness and body tracking app with Apple Health integration
- Body Measurements: Weight, height, body fat percentage, BMI, and body circumferences (waist, bicep, chest, thigh, etc.)
- Apple Health Integration: Seamless sync with iOS Health app for automatic data import/export
- Progress Analytics: Interactive charts and trends with multiple time frames (weekly, monthly, 6-month, yearly, all-time)
- Calculated Metrics: Automatic computation of BMI, lean body mass, fat mass, FFMI, BMR, and body surface area
- Real-time Overview: Quick glance at latest measurements with beautiful summary cards
- Progress Charts: Visual trends with customizable time frames and smooth animations
- Recent Activity: Latest measurements and changes at a glance
- Quick Actions: One-tap access to add new measurements or photos
- Visual Progress Tracking: Capture and organize progress photos by date
- Before/After Comparisons: Side-by-side photo comparisons to visualize changes
- Secure Storage: Photos stored securely with privacy protection
- Secure Authentication: JWT-based authentication with refresh tokens
- Cloud Sync: Automatic backup and sync across devices via backend API
- Data Export: Export your data anytime for backup or migration
- Privacy First: All data encrypted and stored securely
- Bidirectional Sync: Import from and export to Apple Health
- Automatic Updates: Background sync every 5 minutes when authorized
- Data Integrity: Smart conflict resolution and duplicate prevention
- Health Categories: Weight, height, body fat percentage, waist circumference
- Modern SwiftUI interface with reactive data binding
- Clean architecture with separated concerns
- Combine framework for reactive programming
βββ π± App Layer
β βββ FitnessApp.swift (App entry point)
β βββ MainTabView.swift (Navigation structure)
βββ π¨ Views
β βββ Dashboard/ (Main overview and charts)
β βββ Photos/ (Progress photo management)
β βββ History/ (Data history and trends)
β βββ Settings/ (User preferences and export)
βββ π§ Managers
β βββ HealthManager (Apple Health integration)
β βββ AuthService (Authentication & backend)
β βββ NetworkManager (API communications)
β βββ StatsHistoryManager (Data persistence)
βββ π Models
βββ StatEntry (Measurement data)
βββ StatType (Measurement categories)
βββ ProgressPhoto (Photo metadata)
- iOS 17.0+
- Xcode 15.0+
- Apple Developer Account (for HealthKit entitlements)
-
Clone the repository
git clone https://github.com/apptrackit/trackit-ios.git cd trackit-ios -
Open in Xcode
open TrackIt.xcodeproj
-
Configure Backend (Optional)
- Update
AuthService.swiftwith your backend URL - See backend documentation for server setup
- Update
-
Build and Run
- Select your target device/simulator
- Press
Cmd + Ror click the Run button
The app requires HealthKit permissions for full functionality:
- Weight (body mass)
- Height
- Body fat percentage
- Waist circumference
Permissions are requested on first launch and can be managed in iOS Settings.
The app works offline but offers enhanced features with backend sync:
- User authentication and multi-device sync
- Data backup and recovery
- Advanced analytics and insights
Configure the backend URL in AuthService.swift:
private let baseURL = "https://your-backend-url.com"| Measurement | Unit | Apple Health | Auto-Calculated |
|---|---|---|---|
| Weight | kg | β | β |
| Height | cm | β | β |
| Body Fat | % | β | β |
| BMI | - | β | β |
| Waist | cm | β | β |
| Bicep | cm | β | β |
| Chest | cm | β | β |
| Thigh | cm | β | β |
| Lean Body Mass | kg | β | β |
| Fat Mass | kg | β | β |
| FFMI | - | β | β |
| BMR | kcal | β | β |
| BSA | mΒ² | β | β |
- Time Frame Selection: View progress over different periods
- Interactive Charts: Smooth line charts with trend indicators
- Summary Cards: Quick overview of current metrics
- Progress Insights: Automated analysis of trends and changes
- Background Sync: Automatic updates every 5 minutes
- Smart Deduplication: Prevents duplicate entries across sources
- Bidirectional Sync: Changes sync both ways seamlessly
- Offline Support: Works without internet, syncs when available
- Local Storage: Core Data for reliable local persistence
- Cloud Backup: Optional backend sync for multi-device access
- Export Options: CSV export for data portability
- Privacy Controls: Granular control over data sharing
- Local-First: All data stored locally by default
- Encrypted Storage: Sensitive data encrypted in keychain
- Health Privacy: Respects iOS Health app privacy settings
- Optional Cloud: Backend sync is completely optional
- Data Control: Full user control over data sharing and export
- SwiftUI: Modern declarative UI framework
- HealthKit: Apple Health integration
- Core Data: Local data persistence
- Combine: Reactive programming
- Swift Charts: Native chart rendering
- URLSession: Network communications
- MVVM: Clean separation of concerns
- Reactive Programming: Combine for data flow
- Repository Pattern: Abstracted data access
- Dependency Injection: Testable and modular code
The app integrates with a comprehensive REST API for user management and data sync. See backend.md for detailed API documentation including:
- User authentication and session management
- Metric data CRUD operations
- Admin dashboard and monitoring
- Hardware monitoring and statistics
- Email service integration
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues