Skip to content

marcm0de/GymClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‹οΈ GymClock

Auto-track your gym sessions with Apple Watch + iPhone.

GymClock uses geofencing to automatically detect when you arrive at and leave your gym β€” no manual start/stop needed. Just walk in, work out, walk out. GymClock handles the rest.

Platform Swift License


✨ Features

🎯 Auto-Detection

  • Geofencing β€” Automatically checks you in when you arrive at your gym and checks you out when you leave
  • Planet Fitness included as default, fully configurable
  • Add unlimited gym locations with custom detection radii

⏱️ Live Session Tracking

  • Real-time elapsed time on both iPhone and Apple Watch
  • Check-in/check-out timestamps
  • Manual check-in option when you need it
  • πŸ”₯ Estimated calorie tracking based on workout type and duration

🏷️ Workout Types

  • Tag sessions as Weights, Cardio, Mixed, or Other
  • Type-specific calorie estimates (cardio burns more!)
  • Visual icons for each workout type in history

πŸ“ Session Notes

  • Jot down what you worked on during each session
  • Notes visible in history for easy reference
  • Never forget what you did last leg day again

πŸ“Š Stats & Streaks

  • Day streaks β€” consecutive days with gym visits (🟒 green when active, βšͺ grey when broken)
  • Week streaks β€” consecutive weeks with at least one visit
  • 🎯 Weekly goal tracking β€” set your target days per week with progress bar
  • Weekly bar charts showing daily gym time
  • Monthly overviews with session count, total time, and calories
  • πŸ† Personal Best indicator for your longest session ever

πŸ“… History

  • Weekly summaries with total time and calories per week
  • Grouped by week with individual session details
  • πŸ† Personal Best badge on your longest session
  • Workout type icons and calorie counts on every entry
  • Swipe to delete sessions

πŸ’¬ Daily Motivation

  • Fresh motivational quote every day on the main screen
  • 30 unique quotes to keep you inspired
  • Because sometimes you need that extra push

⌚ Apple Watch

  • Full standalone watch app
  • Extra large timer font β€” see your time at a glance
  • Live estimated calories during sessions
  • Quick check-in/check-out
  • Session history with crown scroll
  • Daily motivational quotes
  • πŸ† Personal best indicators
  • Watch complications:
    • Session/streak at a glance
    • ⚑ Quick Start β€” tap to immediately begin a session

❀️ HealthKit Integration

  • Automatically logs gym sessions to Apple Health
  • Recorded as "Other" workout type
  • Seamless integration with your health data

πŸ“± Screenshots

iPhone

Active Session History Stats Settings
Active Session History Stats Settings

Apple Watch

Timer History Complication Quick Start
Watch Active Watch History Complication Quick Start

πŸ“Έ Screenshots coming soon β€” contributions welcome!


πŸ› οΈ Tech Stack

Component Technology
UI SwiftUI
Persistence SwiftData
Location CoreLocation (Geofencing)
Health HealthKit
Watch WatchKit + watchOS 10
Complications WidgetKit
Charts Swift Charts
Min iOS 17.0
Min watchOS 10.0

πŸ“¦ Installation

Prerequisites

  • Xcode 15.0+
  • iOS 17.0+ device or simulator
  • watchOS 10.0+ (for watch features)
  • Apple Developer account (for on-device testing with location)

Steps

  1. Clone the repository

    git clone https://github.com/yourusername/GymClock.git
    cd GymClock
  2. Open in Xcode

    • Create a new Xcode project (iOS App with Watch App)
    • Add the source files from each directory to the corresponding targets
    • Or use File > Add Files to "GymClock"... to import the project structure
  3. Configure signing

    • Select your development team
    • Update bundle identifiers:
      • iOS: com.yourname.GymClock
      • watchOS: com.yourname.GymClock.watchkitapp
      • Complication: com.yourname.GymClock.watchkitapp.complication
  4. Enable capabilities

    • Background Modes β†’ Location updates
    • HealthKit
    • App Groups (for sharing data between iOS and watchOS)
  5. Build and run on your device

Important Notes

  • Geofencing requires "Always" location permission β€” the app will prompt on first launch
  • On-device testing recommended β€” simulators don't fully support geofencing
  • HealthKit requires a physical device

πŸ“‚ Project Structure

GymClock/
β”œβ”€β”€ Shared/                          # Shared code between iOS and watchOS
β”‚   β”œβ”€β”€ GymLocation.swift            # Gym location model (SwiftData)
β”‚   β”œβ”€β”€ WorkoutSession.swift         # Workout session model + WorkoutType enum
β”‚   β”œβ”€β”€ GeofenceManager.swift        # CoreLocation geofencing manager
β”‚   β”œβ”€β”€ SessionTracker.swift         # Session lifecycle + HealthKit
β”‚   β”œβ”€β”€ DateFormatters.swift         # Date/time formatting utilities
β”‚   └── MotivationalQuotes.swift     # Daily motivational quotes
β”œβ”€β”€ GymClock/                        # iOS App
β”‚   β”œβ”€β”€ GymClockApp.swift            # App entry point
β”‚   β”œβ”€β”€ ContentView.swift            # Tab-based navigation
β”‚   β”œβ”€β”€ Info.plist                   # iOS configuration
β”‚   β”œβ”€β”€ Assets.xcassets/             # App icon & colors
β”‚   └── Views/
β”‚       β”œβ”€β”€ ActiveSessionView.swift  # Live session timer + workout type picker
β”‚       β”œβ”€β”€ HistoryView.swift        # Session history with weekly summaries
β”‚       β”œβ”€β”€ StatsView.swift          # Charts, streaks, goals, personal bests
β”‚       └── SettingsView.swift       # Gym management, weekly goals
β”œβ”€β”€ GymClockWatch/                   # watchOS App
β”‚   β”œβ”€β”€ GymClockWatchApp.swift       # Watch app entry point
β”‚   β”œβ”€β”€ WatchContentView.swift       # Watch navigation
β”‚   β”œβ”€β”€ WatchActiveSessionView.swift # Watch timer (large font) + calories
β”‚   β”œβ”€β”€ WatchHistoryView.swift       # Watch history with crown scroll
β”‚   β”œβ”€β”€ Info.plist                   # watchOS configuration
β”‚   └── Assets.xcassets/             # Watch app icon & colors
β”œβ”€β”€ GymClockWatch Extension/         # Watch Complications
β”‚   └── GymClockComplication.swift   # WidgetKit complications + Quick Start
β”œβ”€β”€ Package.swift                    # SPM reference
β”œβ”€β”€ README.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
└── .gitignore

🀝 Contributing

We welcome contributions! Here's how to get started:

Development Setup

  1. Fork & clone the repository

    git clone https://github.com/your-fork/GymClock.git
    cd GymClock
  2. Open in Xcode 15+ and configure signing with your team

  3. Required capabilities:

    • Location Services (Always)
    • HealthKit
    • App Groups
  4. Run on a physical device for full geofencing/HealthKit support

Guidelines

  • Follow Swift style conventions and use SwiftUI best practices
  • Keep shared code in the Shared/ directory
  • Test on both iPhone and Apple Watch when possible
  • Write descriptive commit messages
  • Update README if adding user-facing features

Quick Start

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

Reporting Issues

  • Use GitHub Issues for bug reports and feature requests
  • Include device, OS version, and steps to reproduce for bugs
  • Screenshots/recordings are always helpful

πŸ—ΊοΈ Roadmap

Coming Soon

  • Apple Watch workout session (extended runtime for background tracking)
  • iOS Home Screen widget showing streak & weekly progress
  • Siri Shortcuts β€” "Hey Siri, check me into the gym"
  • Push notifications β€” streak reminders & weekly summaries

Planned

  • Social features β€” share streaks with friends
  • Workout templates β€” pre-built routines for different workout types
  • Export data as CSV/JSON for analysis
  • Dark/light theme customization
  • Rest timer between sets
  • Body weight tracking integration
  • Gym occupancy estimates (crowdsourced)

Exploring

  • AI-powered workout suggestions based on history
  • Heart rate zone tracking via Apple Watch sensors
  • Integration with popular fitness apps (Strong, Hevy, etc.)
  • Apple Watch Ultra depth/altitude tracking for outdoor workouts

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ™ Acknowledgments

  • Built with SwiftUI, SwiftData, and CoreLocation
  • Inspired by the simple goal of knowing "how long was I actually at the gym?"
  • Motivational quotes curated to keep you grinding πŸ’ͺ

Made with πŸ’ͺ by Marcus Fequiere

About

Auto-track your gym sessions with Apple Watch + iPhone. Geofencing-based check-in/out, workout history, streaks, and stats.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors