6 ms·
Show HN: Workout Tracker – self-hosted, single binary web application
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.
- shantnutiwari 3y agonice. How do you track teh distance (walked or running?)
- abound 3y agoWithout diving in too deeply, it looks like they use a package called `gpxgo` [1], which has some code for calculating the moving distance of a given GPX file [2]. [1] https://github.com/tkrajina/gpxgo https://github.com/tkrajina/gpxgo [2] https://github.com/tkrajina/gpxgo/blob/5e7c336e94dac3583a07c87dc77dd59acaa7be63/gpx/gpx.go#L1156-L1207 https://github.com/tkrajina/gpxgo/blob/5e7c336e94dac3583a07c...
- jovdg 3y agoNot sure exactly what you are asking about, so I'll be verbose :-) 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: <trkpt lat="x" lon="y"> <ele>56.72105575919558</ele> <extensions> <speed>1.8200000524520874</speed> <wstxns2:TrackPointExtension xmlns:wstxns2="gpxtxp"/> </extensions> <time>2024-02-28T09:28:26Z</time> </trkpt> 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)
- abound 3y agoThis looks truly excellent, nice work! I've been using RideWithGPS, which is a great tool, but doesn't scratch my "self-host everything, own my own data" itch, so I'll definitely be checking this out. I've built (and use daily) my own barebones workout tracker [1], but it's for non-distance-based workouts (i.e. rep-based stuff/lifts), so this compliments that nicely. [1] https://github.com/bcspragu/stronk https://github.com/bcspragu/stronk
- juiiiced 3y agoHow many things do you self host and how do you manage them all?
- abound 3y ago$ kubectl get deployments.apps | wc -l 25 Minus the header, looks like ~24. I use a single-node Kubernetes cluster running Talos [1]. Running a single-node cluster is kinda dumb architecturally, but adding a new service takes <10 minutes most of the time, which is nice. I've standardized on Cuelang [2] for my configs, so adding a new service is some DNS/Caddy config fiddling, then: deployment: <service>: spec: template: spec: { containers: [{ ports: [...] command: [...] volumeMounts: [...] }] volumes: [...] } And then running: cue export \ --out yaml \ --expression 'deployment.<service>' \ --expression 'service.<service>' \ kube.cue <service>/<service>.cue | kubectl apply -f - Where `kube.cue` sets reasonable defaults (e.g. image is <local registry>/<service>). The "cluster" runs on a mini PC in my basement, and I have a small Digital Ocean VM with a static IP acting as an ingress (networking via Tailscale). Backups to cloud storage with restic, alerting/monitoring with Prometheus/Grafana, Caddy/Tailscale for local ingress. [1] https://www.talos.dev/ https://www.talos.dev/ [2] https://cuelang.org/ https://cuelang.org/
- reidjs 3y agoInterested in how you're using DO as an ingress. I currently run a droplet that's reaching its capacity because I'm running all the services directly on that underpowered machine. I would much rather run them from a local computer. Is it pretty straightforward to set that kind of thing up with tailscale?
- vimeh 3y agoThis is great! Am a fan of this kind of focused, self hosted application. Clean UI, too. Interested to hear your thoughts on HTMX when you get around to eval-ing it
- jovdg 3y agoI did some evaluation of HTMX a few weeks ago; while I understand the appeal, it does not yet ... vibe with me. Also, the use for HTMX is still very limited in this project. I don't think this will really change, because the project is fairly focused and will remain so for the time being. Maybe there is an opportunity with the statistics and graphs? Like switch the buckets between km, miles, and number of those (1 km, 5 km, etc), of zoom to more years.
- xnx 3y agoI love the minor movement toward self-hosted web apps. I wish they were easy enough to setup as installing an app on Android or iPhone.
- ramon156 3y agoHole in the market? Maybe a NAS-type system for self host? Something a bit stronger than a raspberry
- panzagl 3y agoSynology NASes are a popular choice.
- ClumsyPilot 3y agoBut their CPU is potato. They still sell versions with 512 mb ram
- xnx 3y agoI do think there's a niche hole in the market for a cloud host that's as easy to use as the major app stores. Fiddling with hardware and network routing is way too technical.
- pcchristie 3y agoDoes PikaPods do what you're talking about? I use it for Actual and for Paperless and it's awesome.
- jollyllama 3y agoThey tried this with a device called Helm Personal Server. No, not the Kubernetes manager.
- KomoD 3y agoNot surprised it failed, $250-400 + $100/year and the only thing it could do was host email, calendar and file sharing?
- agilob 3y agoAlternative https://github.com/aceberg/ExerciseDiary https://github.com/aceberg/ExerciseDiary
- abusaidm 3y agoThis is a great looking project. The combo of single binary Go-lang and the ability to package assets like css, js and html makes this a killed multi platform distributable one click run. 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.
- turtlebits 3y agoThis would a great candidate for https://wails.io/ https://wails.io/. I've been building a lot of utility desktop apps and the static binary is around 9mb (uses the system webview).
- ggpsv 3y agoI'm also eyeing wails for a couple of personal desktop apps that I want to build soon. I built toy app first towards the end of last year to try it out and I was impressed. It felt like a nice middle ground between Electron and Tauri for desktop apps using a web front-end. Looking forward to the release of v3!
- tamimio 3y agoLooks good!! On time for the coming spring!
- mattegan 3y agoSweet! Would love to host this myself and get rid of my Strava subscription. 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!
- lapetitejort 3y agoSlightly off topic, but I got tired of looking for a good weight training tracker, so instead I bought a notebook and a pencil and I've been using it for nearly two years. If I want to change up how I long my workouts, I just write them in a different way. I've changed how I log number of sets/reps, weight per set, etc, a few times and I've never had to re-program how the info is displayed. I log how I feel after the workout and use that and the weight from last session to guide what I'll be doing in the current session. I don't need a graph as I can clearly see the values going up or stagnating. I honestly feel like the analog process has helped me keep consistent. It's motivated me to get more notebooks to track stuff like household chores. Sometimes the best app is a piece of paper.
- deleted 3y ago[deleted]
- salad-tycoon 3y agoI bought the starting strength app, no subscription and has a couple of quality of life improvements like a timer, plate calculator, graphs etc and some actually helpful no nonsense videos and book excerpts. very little distractions. Agree with you though, pen and paper is hard to beat and cheaper.
- deleted 3y ago[deleted]
- drBonkers 3y agoCan I see your paper template? What if you want to graph tonnage?
- zhivota 3y agoI have a Google Keep note where I record the results from the last workout. I figured out I really only need that. I don't need history, I just need to know how long ago was the last workout, how much did I lift / time under tension, so I can make a decision about today's program. I love fancy graphs for my endurance work but for lifting, I feel like this is pretty much all I really need.
- nose-wuzzy-pad 3y agoLooks great! Any chance you plan for it to work with .fit files? Thanks for making this!
- Osiris 3y agoBy "Workout" do mean only exercise that can be tracked via GPS (walking, running, cycling)? It doesn't seem to track any indoor activities like weight lifting.
- wredue 3y agoYeah. I was also gleefully looking cause lifting trackers are universally garbage. 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.
- dominick-cc 3y agoFor lifting, check out Gymstro. Free and very good. I recently switched over from FitNotes (also free and good, but quirky).
- switchers 3y agoI was about to recommend fitnotes but if you've swapped then I've got something to check out...
- InitialLastName 3y agoI've only been using it since I saw it recommended a few weeks ago, but for Hacker's Diet[RIP, 0]-style diet tracking MacroFactor has been unbeatable. Nothing dumb or meaninglessly social, just weight+nutrition tracking. In recognition that humans are imperfect and that both sides of CI/CO are more complicated than is apparent, they have built the system around a "best effort" vibe; systematic bias gets filtered out through feedback (if you regularly underestimate the calories you actually eat, the system will feed back by lowering your limits). [0] https://www.fourmilab.ch/hackdiet/ https://www.fourmilab.ch/hackdiet/
- wredue 3y agoCI/CO is what I used to lose weight (back to normal BMI as of today, actually). 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.
- wly_cdgr 3y agoHeck yeah, this is awesome. 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!
- freedomben 3y agoThis looks super neat and would be very useful. What apps/devices do people use to collec the GPX information? I found a few in the Play Store but they don't look very privacy respecting... Edit: Currently eyeing GPSLogger: https://gpslogger.app/ https://gpslogger.app/
- Otek 3y agoAnyone has good resources on importing such data from apple - I’m using Apple Watch but would love to visualize raw data myself with grafana
- klaushardt 3y agoHealthFit can export Workouts as .gpx or .fit files.
- mikestew 3y agoSibling mentions HealthFit, and there's RunGap as well. I use RunGap simply because HealthFit doesn't do Garmin. With the exception of Garmin, either could be a good choice.
- eitally 3y agoI came into the github not expecting to like this, but you've done a great job so far! I currently use a combination of Garmin Connect (track on watch & head unit), Intervals.icu (for fitness/freshness and more obvious tracking of performance improvement over time via various power & HR metrics), Strava (for segment and route performance change over time, and of course the social aspect... and routing), Komoot (only for cycling routing), and Elevate for Strava (just testing now, but it looks like a crappier version of intervals.icu so far), and Smashrun for running-only tracking. Oh, and Veloviewer for cycling-only performance/history and route visualizations. 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.
- pcchristie 3y agoI just can't get past the Intervals design. Wanted to like it but it's an absolute cluster for me.
- ddek 3y ago
- matthewhartmans 3y agoWell done and congratulations on the launch! Looks incredible mate!