Show HN: Workout Tracker – self-hosted, single binary web application (github.com)
I tried some web tools to track my workouts (specifically, running); some (like FitTrackee) came close, but I always found annoyances. So I decided to build my own. Specifically geared towards distance-based workouts, such as walking, running or cycling.
101 comments
[ 3.7 ms ] story [ 158 ms ] thread[1] https://github.com/tkrajina/gpxgo
[2] https://github.com/tkrajina/gpxgo/blob/5e7c336e94dac3583a07c...
I use an app called FitoTrack (also FOSS), which records my location while running. It stores my GPS position every few seconds. When I'm done, it auto-exports a GPX file to a folder on my phone, which is synced via syncthing. Then I (manually, for now) upload the file to my self-hosted workout tracker.
The GPX file contains some data per measurement point; this is the second point in some random GPX file:
So it contains speed (average since previous point), elevation, location and time (offtopic: it took me a while to understand that this elevation is not the actual elevation above sea level; only yesterday I figured that out and fixed it in the code!).The Go GPX library some of this information, and some extras (like max and min elevation, max speed, total up and down, etc. over the whole track). Then I perform some more calculations (like putting the points in buckets per km and per minute), and calculate the estimated location using a geocoder library.
Then, finally, to estimate the difference between walking, running, or cycling, I take the average speed and guesstimate from there. This may be wrong some times for some people, and could be improved on. Or maybe I should include an AI here? (just kidding)
[1] https://github.com/bcspragu/stronk
[1] https://www.talos.dev/
[2] https://cuelang.org/
One can optionally add other "hardening" at the DO layer, like Crowdsec, to minimize automated/malicious/bot traffic into your home.
Clean UI, too. Interested to hear your thoughts on HTMX when you get around to eval-ing it
Umbrel is just plug-and-play with an app store, haven't personally tried it but looks very cool.
I think there's still a world in which you can buy an rPi with software preinstalled and updaters packaged without much effort though.
If that could take off, you could easily have this type of service. However, I think it falls apart because you need to govern the app store and that is expensive and difficult.
Use your old PC, a Raspberry Pi, an EC2 instance, whatever you like, a single small Docker Compose file with Watchtower for auto-updating the container image when new one published etc. I've got self-hosted services that have ran untouched for years this way at home from a handful of lines of YML. Docker Compose will also take care of restarting the service on reboot/powercut if thats a concern.
Given the ubiquity of container images, you can run largely any web application this way and the container image likely already exists - this project also has a Dockerfile and would run fine this way too.
Virtual android device in the cloud might be a great model for it since Android has good built-in security and process isolation.
Web apps don't magically produce their own compute, power and networking. They still need to be run on something.
(Web app does not automatically equal SaaS, especially in this case that is explicitly billed as self-hosted.)
I promise, everyone, it is very legal and very cool to just write applications that run without TCP roundtrips. I promise.
This sentence makes no sense to me. "Self-hosting" and "software as a service" are diametrically opposed things.
This seems extremely arbitrary and seems to assume some implicit definitions that are not common, and in fact are the opposite of what I've heard used.
IME software as a service generally speaking means somebody else is doing all the hosting and you as an end user just point your browser to it or in some cases install a local app (and often you put in your credit card and pay a monthly subscription). Self-hosting means you do all that hosting yourself. I've never seen something marketed as SaaS that expected you to host the server-side yourself, but I'd be happy to hear of an example.
> I promise, everyone, it is very legal and very cool to just write applications that run without TCP roundtrips. I promise.
That's a hell of a strawman against an argument I see nobody making.
(Rephrased to be less mean.)
"The most amazing achievement of the computer software industry is the continuing cancellation of the steady and staggering gains made by the computer hardware industry" -Henry Petroski
Efficiency is very important to me. (And in the era of climate change, it should be important to everyone.) I consider web apps to be about the least efficient form of software yet discovered. We suddenly need two relatively beefy computers with multi-GHz multi-core processors and GB of RAM, one of which must be powered on 24/7, to do something that could have been done on the hardware of the mid-80s.
Edit: this app would probably make for a great Sandstorm app.
I've been slowly moving everything to self hosted to reduce the pain if/when I'm ever randomly banned from Google or some other huge network and can't get it re-enabled.
The downside is that I'm now my own IT department and need to perpetually monitor these things.
It might be an interesting experiment to have the UI be installable as PWA and thereby not need the electron stack to achieve the common functionality offered by these apps.
I wrote a Python script that iterates through all of my activities there and downloads the `.gpx` for each - I could share the code if interested! Not sure how you'd integrate it into your app - maybe a "import from Strava" page could handle the Strava API auth?
I also love this idea of self-hosting some web apps (especially if they're containerized). I setup a `util.` subdomain and have started putting a few things there at different root directories. It's fun!
Agree with you though, pen and paper is hard to beat and cheaper.
What if you want to graph tonnage?
I love fancy graphs for my endurance work but for lifting, I feel like this is pretty much all I really need.
eg. Exercise | SetsReps | Feb 26 | Mar 1
----------------------------------------------------------
Dumbbell Chest Press | 3 x 8 | 65, 8 8 8 | 70, 8 8 5
Dumbbell Chest Fly | 3 x 8 | 16, 8 8 8 | 20, 8 8 6
Exercise | Sets x Reps | Feb 28 | Mar 3
----------------------------------------------------------
Knee Jumps | 3 x 8 | BW, 8 8 8 | BW, 8 8 8
Pull-ups. | 3 x AMRAP | 4, 3, 2. | 3, 3, 2
KB Swings | 10M EMOM | (216) 10M | (2*16) F@7M
Bent DB Row | 3x8. | (swap cable row) 60, 8 8 8 | 40, 8 8 8
Any chance you plan for it to work with .fit files?
Thanks for making this!
It doesn't seem to track any indoor activities like weight lifting.
Diet trackers (Calorie Counters) are also almost universally a pain in the ass, but at least they’re tolerable.
There is not a single combined lifestyle experience that is any “good” IMO.
[0] https://www.fourmilab.ch/hackdiet/
I won’t lie and say it was “easy”. I had to make real changes, and some were not easy for me (cheese. Peanuts…). But after I bought a scale and weighed my portions, it was readily apparent what was wrong for me.
The other things most “experts” (who are trying to sell you their brand of dieting) will sell you about CICO not being “everything” is that some food are awkward. Like celery, which has 5 calories uncooked, 30 cooked.
Ultimately, as long as you are weighing your portions, those oddities should generally not be “breaking” a CICO diet.
I appreciate this other suggestion, for the app. I will check it out.
CI/CO definitely works, but both sides of the equation need to track a feedback loop in order to function correctly. On the one hand, your body will reduce its base metabolic rate as you start depriving it of nutrition; on the other, the nutrition labels on food aren't necessarily representative of what your body can get out of them.
The other issue is that often the foods people with weight issues eat aren't the same foods that are conducive to weight loss... it's psychologically very difficult to maintain a calorie deficit when many of those calories are taken up by sugar water, for example, where it's much easier when the calories come from nutritionally complete, fresh foods.
As usual, proactive lifestyle change is rarely about the facts of what should be done (literally everyone knows they should be eating vegetables and exercising) as much as the psychology (it's difficult to consistently make decisions that add stress to your life).
I built a weightlifting tracker primarily for myself a little while ago and also published it. I tried to keep the UX as simple as possible. If you're ever looking to try out another app, give it a shot! https://titangymapp.com.
I was wondering where you got the data from to know what muscle group is used in each exercise?
Any chance of some kind of social features? I want to control my data, but I also do want to be able to share my fitness stats & journey with a specific self-selected group of people: friends, running club mates, etc
Thank you for making this!
Edit: Currently eyeing GPSLogger: https://gpslogger.app/
It's a lot.
The problem is that there isn't a single place where you can get both the holistic metrics and the plan in a way that most users will want (which almost mandates a Strava interface). Apps like Veloviewer or Elevate already have this, but both either fall very short functionally or specifically only target a subset of features.
When I complete a run or ride, the first thing is to check Garmin to see how it related to, or impacted, my physiological health metrics, since I rely on Garmin for things like sleep quality, training readiness, and load tracking. Then to Strava to see how it went compared the previous times on the route and look at segments, or perhaps to give kudos to someone I was with. Then to intervals.icu to dig into the performance metrics (power, HR).
Intervals.icu is great because it handles workout planning, too, but the one big thing it's missing is routes & segments for IRL activities. Veloviewer has this, but it is missing all of the training/planning/fitness features. Imho, the killer app in the space is going to be whoever is able to augment the planning/tracking pieces, which are largely grunt work to develop, with the social bits that Strava has. The existential risk for indy devs is that your product is just a feature for Strava, and you could easily become disintermediated (or they shut down or charge exorbitant rates for API access -- it's already highly rate limited).
You're doing great work, but I'll keep paying for intervals.icu, Strava & Veloviewer for now because they all do slightly different things, even if there's significant overlap.
Those who want to use fitness trackers but are put off by trade off with privacy, Gadgetbridge and self-hosted applications like Workout Tracker are great alternatives.
[1] https://codeberg.org/Freeyourgadget/Gadgetbridge