Inspiration

For the past 4 years I was working in the MedTech area as an iOS Developer, during this time I also had some health issues and it turns out that exercises are good for you :) Once I started exercise regularly I started to feel much better, and of course I was interested in some kind of app to help me keep up with workouts, keep better and better. I was wondering how different habits like drinking water, exercising regularly can influence my performance in the gym and well-being in general. I've tried to find an app that in easy way allows me to track workouts from my watch, and apps that I've found were very limited, so I decided that it would be good idea to start my own app, if I need it maybe others too.

What it does

Base premise is very simple: Tracking workouts, replacing spreadsheets with exercises and sets (at least for now ;) ). Currently you as a user are able to explore pre-existing +1000 exercises, see which part of the body they'll impact, view instructions how to do them end even gifs just to make sure that you have a proper form. Once you pick your exercises, you can create your workout routine, selecting rest time and even adding notes for specific exercises. When routine is ready it's automatically synced with watch app and you're ready to start workout either from the iPhone or AppleWatch. Once your'e done with your workouts you're of course able to view its details and summary. What's interesting is that what you can do with this data, although there is strict deadline for ShipATon I had to limit MVP functionalities, and right now you can create custom chart widget from data points like: weight, workout frequency, exercise parameters (duration, weight, distance, repetitions) and see e.g. how your weight was changing with frequency of workouts and what weight could you lift in e.g. deadlift exercise during this timeframe. Possibilities are endless and I have more ideas coming in the future versions (more on that later)

How I built it

This project was build after regular 9-5 job and on the weekends, first I thought it'll be easy app to develop, few entities in CoreData - how hard can it be? Well soon I've found out that it can be really really hard, more ideas started popping in my mind and everything started becoming more and more complex. I've started with MVP on watch app and focused only on data transfer to phone, next I knew that if I want it to be a real app I need to make some designs in Figma and I've started from that. With designs more or less ready, authentication with Vapor was pretty simple but then came time for designing database schema, and that took a while, for that I needed to figure out what I actually want to store as a my workout and routine. Once project had strong foundation, developing other features was more straightforward.

Challenges I ran into

Ohhh there were so many but I think I can highlight these 5:

  1. Communication with AppleWatch - going through documentation time and time again, figuring out efficient communication to pass +1000 exercises and all data from user's workout. In addition to project-related challenges, there were also some framework rulated issues like this one: App that sends file to companion app, report failure even though file was received https://forums.developer.apple.com/forums/thread/751623
  2. CoreData - CoreData itself is not so bad, but when you mix it with Async/Await, swift strict concurrency, and many background contexts then it can get complicated very quickly.
  3. Vapor deployment with Docker Swarm - Creating action on GitHub that build docker image automatically that then can be used on ARM machine, deploying this image in swarm mode and making sure ssl certificates are setup correctly.
  4. Swift Charts - It's a first project where I worked with swift charts and especially as they're dynamic (one chart can have pretty much unlimited data types, as long as they're maximum 2 units) it took me a while to understand it properly.
  5. HKWorkout - Creating service that's running actual workout on watch seems pretty simple but it turns out that there are some issues with it and debugging is painful as you cannot use simulator. Even on Apple's example project when you quickly enters/exit workout few times, the object stop responding to system's events.

As a bonus I can also mention testing - It was best/worst part of developing this app, to test it I needed to do actual workouts, sometimes shorter workouts but few per day, but I think it was worth it :)

Accomplishments that I'm proud of

  1. Making workout work on Apple Watch - seems pretty trivial but as there was issue with transferring files between two apps, issue with receiving updates about the workout and storing it in database - it all cause that simple functionality got much more complicated than I expected
  2. UI & UX - I might be bias but I think I've striked right balance between UI/UX vs limited time and MVP functionalities
  3. Leveraging new frameworks (and as little 3rd party dependencies as I could) - So the app was developed with SwiftUI including navigation, which was not the easiest part, adding to that Async/Await, Combine, CoreData, HealthKit, made it a good playground to learn new things

As a side note - I kept sanity while developing this app on old MacBook 2017 ;)

What I learned

  1. There is not such thing as simple app - Even if something seems simple at first glance, then usually it is not.
  2. Docker Swarm is a very useful tool but you need to understand it first, right now for me it's a must for any production app.
  3. Posting on Twitter/X is not so hard - before this hackathon I tweeted only handful of times and I really enjoyed it this time
  4. First designs, code next - When you have designs ready, coding is much more enjoyable and you already handled some edge cases during the design phase. And Figma's layouts are just HStacks & VStacks.
  5. Validate your idea Even something like talking about an idea with your friends first, can make the whole process much easier, you'll at least know which functionalities users are expecting.
  6. ASO is important I'm on beginning of my journey but I already see that ASO and focusing on research of current solutions is very important and you shouldn't hold with it till release phase.

What's next for HealthBuddy

My list of ideas is constantly growing but here is a sneak-peak

  1. Automatic rep count - ML model on Apple Watch that can count repetitions
  2. Workout Programs - Setup your routines in actual program with reminder, rest days.
  3. Out of the box Programs & Routines - Predefined routines and whole programs in order to lower entry bar for new people that want to exercise
  4. Substances intake - Logging substances like creatine, protein and using them to correlate their influence with your lifts and other data on charts
  5. Measurements - Supporting other measurements than weight, like waist and circumference of other muscles.
  6. Widgets - Adding widgets to see next workout, maybe live activity to track current one.
  7. Slight redesign and new animations - There is always room for improvement

And much more but I don't want to spoil everything, of course consistently working on ASO and marketing.

Built With

  • async/await
  • core-data
  • healthkit
  • observation
  • swiftui
  • vapor
  • watchkit
Share this project:

Updates