GitHub contribution graph styled Activity Graph
 
Note: Still a draft, tons of mistakes.

Jun 29, 2024

 
Its been a while since I have been going Cycling and going to the gym and I feel like I have been somewhat consistent at both of them. Although the last few months have been not but here’s what I feel like. The Strava activity graph doesn’t give me a good look at my consistency through my training.
 
My Strava activity “graph”
My Strava activity “graph”
 
I think GitHub’s contribution graph provides a good look at your activity and pushes you to stay consistent at it.
 
My GitHub contribution graph
My GitHub contribution graph
 
I don’t know about others but I like to keep my GitHub graph green (obviously by pushing actual code that’s required), not like those who have an automated script push a change of line every single day to keep their graphs green.
 
I was listening to the WVFRM podcast with Dr. Mike about tracking activities and body metrics on the apple watch and his words about how this is all an entertainment hit me pretty hard. I agree, 90% of the people don’t really understand the data collected by their watch and they just like to close their rings and hope that their fitness is keeping up as a result. Seems like Progress has to be entertained. I think we live in a world so tightly knit with feedback loops that, stoic, rewardless passion doesn’t really work anymore for most people. I think its time I do this for myself and see how effective it is.
 

Jun 18, 2024
 
If I can pull all the activities from Strava and display a graph, i think it will give me a good sense of my consistency and maybe even push me to keep my graphs green. I think one of the first main roadblocks is about fetching activities from the garmin watch into your web application. Seems like there is a free public API — but only available for Approved business developers. Now I don’t know what is the requirements to be a approved dev business but I don’t want to look into it.
 
Apparently, during Covid they were providing access if you emailed nicely and asked but not sure if they are doing that anymore.
 
But there is an open sourced library that has been “reversed-engineered” to fetch existing data from the garmin watch.
 
garth
matinUpdated Aug 24, 2024
 
Found while looking for an open-source service like Strava.
 

Jun 30, 2024

 
While exploring the Garmin connect API using Garth, I found out that the garmin watch records the sleep movement data as well which is very interesting because the garmin app doesn’t show reports on sleep movements. If the watch had a microphone, it could have probably recorded the snoring, murmuring, speaking data as well.
 
import garth from garth.exc import GarthException from pprint import pprint import datetime # Load Garmin's auth session garth.resume(".garth") sleep = garth.SleepData.get(datetime.date.today().isoformat()) pprint(sleep)
 
notion image
 
It also stores the sleep scores which is obvious, but also the respiration data. The watch doesn’t display any info about the respiration data so this was a bit new to me — maybe there are more things to be explored in the future.
 
notion image
 
I have managed to connect this API and host it on a simple Flask server on vercel and using the endpoints, I have fetched that data into my React web app. Using a Github Style contribution graph (found online) I generated my “cycling and gym activity graph”. Here’s what it looks like:
notion image
 
I could call it done for this feature but I think there’s something missing. I want to be able to know how consistently I am at the gym or going cycling. I think its better to keep them separated. Let’s separate the Cycling graph from the Gym graph.
 
notion image
 
I built this as a way to retrospectively look back on my progress. I think it could be a great motivator to just keep going sometimes when your body doesn’t want to sometimes.