Skip to content

apptrackit/trackit-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“± LifeTrackerX

A comprehensive iOS fitness and body tracking app with Apple Health integration

iOS Version Swift Version Xcode Version License

✨ Features

πŸƒβ€β™‚οΈ Health & Fitness Tracking

  • 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

πŸ“Š Smart Dashboard

  • 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

πŸ“Έ Progress 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

πŸ” User Management

  • 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

πŸ”„ Apple Health Integration

  • 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

πŸ—οΈ Architecture

SwiftUI + MVVM

  • Modern SwiftUI interface with reactive data binding
  • Clean architecture with separated concerns
  • Combine framework for reactive programming

Core Components

β”œβ”€β”€ πŸ“± 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)

πŸš€ Getting Started

Prerequisites

  • iOS 17.0+
  • Xcode 15.0+
  • Apple Developer Account (for HealthKit entitlements)

Installation

  1. Clone the repository

    git clone https://github.com/apptrackit/trackit-ios.git
    cd trackit-ios
  2. Open in Xcode

    open TrackIt.xcodeproj
  3. Configure Backend (Optional)

  4. Build and Run

    • Select your target device/simulator
    • Press Cmd + R or click the Run button

πŸ”§ Configuration

HealthKit Setup

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.

Backend Integration

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"

πŸ“Š Supported Measurements

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Β² βž– βœ…

🎯 Key Features Deep Dive

Dashboard Analytics

  • 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

Apple Health Sync

  • 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

Data Management

  • 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

πŸ”’ Privacy & Security

  • 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

πŸ› οΈ Development

Technologies Used

  • 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

Architecture Patterns

  • MVVM: Clean separation of concerns
  • Reactive Programming: Combine for data flow
  • Repository Pattern: Abstracted data access
  • Dependency Injection: Testable and modular code

πŸ“„ Backend API

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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •