Endurain - Strava that you can selfhost reddit / selfhosted ---------------------------------------------------------------------- joaovsilva · 2023-12-22 22:38 Endurain is a Strava like service that you can selfhost. It uses for the frontend PHP+HTML+basic JS+Bootstrap CSS, for the backend Python FastAPI and stravalib, MariaDB for the database engine and Jaeger for observability basic usage. Docker images are available to deploy the service and you can check "docker-compose.yml" file for an example. I'm not a developer by profession (my dev concepts are from university ten years ago) so this work had a lot of help from ChatGPT and the main purpose was to learn new technologies and new concepts, so please be gentle. If you have recommendations for any topic please let me know. Repo link: [https://github.com/joaovitoriasilva/endurain](https://gith ub.com/joaovitoriasilva/endurain) ---------------------------------------------------------------------- pixelbaker · 2023-12-23 00:24 “Strava connects millions of runners, cyclists, hikers, walkers and other active people through the sports they love – all on our mobile app and website.” ---------------------------------------------------------------------- -eschguy- · 2023-12-23 02:17 Any screenshots? ---------------------------------------------------------------------- notdoreen · 2023-12-23 02:33 Now you can connect to only yourself on your personal server ---------------------------------------------------------------------- andvell · 2023-12-23 03:07 Why would anyone self-host any social media service? Dumb question? I have a Strava account and a Ride with GPS account. Also, Garmin saves my activities and syncs to the other two. Strava, I just keep as many other people I know use it, and it is a way to both share and support each other's efforts. Ride with GPS, I prefer for planning routes and navigation services. But aside from that, I back up all my activities for my own records. I am curious to see the capabilities of Endurain if I take out the social media aspect of it. ---------------------------------------------------------------------- quinyd · 2023-12-23 03:16 Isn’t the main purpose of strava to record and store your runs/rides? This app doesn’t do any recording as far as I can see and doesn’t have any mobile apps. It imports info from strava and stores it locally but in order to do that, you need to use strava to record activities. I don’t see the benefit. Please correct me if I’m wrong. ---------------------------------------------------------------------- tenekev · 2023-12-23 05:38 What's with this type of posts? Went all the way to recreate a service and its functionalitily. Skipped the FIRST SENTENCE OF THE INTRODUCTION DESCRIBING ITS FUNCTION. *Here is an app that is like that other app that 99.999% of people never heard of. And that other app is an improvement of that other legacy app that was popular with 0.00002% of the population, 7 years ago.* To be clear I'm not lashing specifically at you. There are multi- person projects that have marketing and whatnot and still can't communicate to other humans what's their idea. Maybe your project is good and useful. I'm not going to bother decyphering it's purpose. Downvote me if you want. ---------------------------------------------------------------------- CactusBoyScout · 2023-12-23 06:15 Yeah it’s explicitly a social network. Idk why you’d want to self host a social network. ---------------------------------------------------------------------- BeYeCursed100Fold · 2023-12-23 07:27 What are "runs/rides"? Sounds like diarrhea in an Uber or something. So gross. ---------------------------------------------------------------------- BeYeCursed100Fold · 2023-12-23 07:29 >I'm not a developer by profession (my dev concepts are from university ten years ago) so this work had a lot of help from ChatGPT Oh, fuck no. ---------------------------------------------------------------------- BeYeCursed100Fold · 2023-12-23 07:43 OP, it might help to explain what your offering does. ---------------------------------------------------------------------- joaovsilva · 2023-12-23 08:03 Sorry totally forgot that last night. Added to post as Edit 1 and here it is also https://imgur.com/a/lDR0sBf ---------------------------------------------------------------------- joaovsilva · 2023-12-23 08:07 I do triathlons and the main objective of this was to track gear usage (for example on many kms my bike chainring has, etc etc and keep track of that). The thing now does the basic, enables you to add gear, activities, etc so this can work. Now the components part need to be done. In the meantime I implemented a basic followers functionality, because "Why not?" :) Currently the service supports: Multi-user Create/edit/delete users Basic admin and regular users profiles that adapt the interface Import activities using .gpx files Connect with Strava and retrieve activities from Strava Feed with user activities, current user week stats and month stats Feed with followers activities Basic activity privacy Activity page with more in depth info of the activity Delete activities Create/edit/delete gear (wetsuit, bycicle and running shoes) Add/edit/delete activity gear User page with user stats and user activities per week Follow user basic implementation ---------------------------------------------------------------------- joaovsilva · 2023-12-23 08:09 I do triathlons and the main objective of this was to track gear usage (for example on many kms my bike chainring has, etc etc and keep track of that). The thing now does the basic, enables you to add gear, activities, etc so this can work. Now the components part need to be done. In the meantime I implemented a basic followers functionality, because "Why not?" :) Currently the service supports: Multi-user Create/edit/delete users Basic admin and regular users profiles that adapt the interface Import activities using .gpx files Connect with Strava and retrieve activities from Strava Feed with user activities, current user week stats and month stats Feed with followers activities Basic activity privacy Activity page with more in depth info of the activity Delete activities Create/edit/delete gear (wetsuit, bycicle and running shoes) Add/edit/delete activity gear User page with user stats and user activities per week Follow user basic implementation ---------------------------------------------------------------------- joaovsilva · 2023-12-23 08:09 I do triathlons and the main objective of this was to track gear usage (for example on many kms my bike chainring has, etc etc and keep track of that). The thing now does the basic, enables you to add gear, activities, etc so this can work. Now the components part need to be done. In the meantime I implemented a basic followers functionality, because "Why not?" :) Currently the service supports: Multi-user Create/edit/delete users Basic admin and regular users profiles that adapt the interface Import activities using .gpx files Connect with Strava and retrieve activities from Strava Feed with user activities, current user week stats and month stats Feed with followers activities Basic activity privacy Activity page with more in depth info of the activity Delete activities Create/edit/delete gear (wetsuit, bycicle and running shoes) Add/edit/delete activity gear User page with user stats and user activities per week Follow user basic implementation ---------------------------------------------------------------------- joaovsilva · 2023-12-23 08:10 Totally right. Was late last night when I did the post and I just wanted to get it done. Stupid me. I updated the post but here it is also: I do triathlons and the main objective of this was to track gear usage (for example on many kms my bike chainring has, etc etc and keep track of that). The thing now does the basic, enables you to add gear, activities, etc so this can work. Now the components part need to be done. In the meantime I implemented a basic followers functionality, because "Why not?" :) Currently the service supports: Multi-user Create/edit/delete users Basic admin and regular users profiles that adapt the interface Import activities using .gpx files Connect with Strava and retrieve activities from Strava Feed with user activities, current user week stats and month stats Feed with followers activities Basic activity privacy Activity page with more in depth info of the activity Delete activities Create/edit/delete gear (wetsuit, bycicle and running shoes) Add/edit/delete activity gear User page with user stats and user activities per week Follow user basic implementation ---------------------------------------------------------------------- BeYeCursed100Fold · 2023-12-23 08:13 That is 1000% better. Take a few days off and make a better post. ---------------------------------------------------------------------- BeYeCursed100Fold · 2023-12-23 08:14 Does it have android, iOS, Linux, Windows support? Think. I shouldn't be asking questions. ---------------------------------------------------------------------- joaovsilva · 2023-12-23 08:17 Please ask :) It is web based so it can be used in any device. The interface is responsive which means that it adapts to the device screen size ---------------------------------------------------------------------- BeYeCursed100Fold · 2023-12-23 08:21 I use apple watch and an android watch. How do I upload my results? Like me, you are a geek. How can I explain to a 10 year old what your software does? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 08:26 Yep. So it can connect to Strava and with that it can retrieve activities that you upload to Strava automatically. It also supports the manual upload of activities using .gpx files. You can export .gpx files from each Strava activity also if you don’t want to integrate with it. Other platforms also support the export like this, but the method may vary per service and for Apple Watch I believe you need to use a 3rd party app like RunGap ---------------------------------------------------------------------- BeYeCursed100Fold · 2023-12-23 08:36 So you made an exercise app that connects to other exercise apps. Say that up front. How many Strava users are on r/selfhosted? Americans use AppleFitness with an AppleWatch or whatever equivalent on Android. Try to hone your message. Hire the first copywriter that asks you a lot of "stupid questions". ---------------------------------------------------------------------- jkirkcaldy · 2023-12-23 09:13 Copying and pasting the same answer whenever someone asks a questions isn’t as useful as you think it is. ---------------------------------------------------------------------- jkirkcaldy · 2023-12-23 09:16 Most people don’t use Strava to actually record their activities, they use something like a cycle co outer which syncs with Strava when you finish. But Strava is mainly a social network for showing off your rides/runs. Remove that and it’s extremely limited without a subscription. And with a subscription there are better services out there like intervals.icu ---------------------------------------------------------------------- Nasticator · 2023-12-23 10:12 Pretty sure I only know of Strava because of it leaking military bases and other stuff from people running in camp. ---------------------------------------------------------------------- edersong · 2023-12-23 10:20 Is there any plan to integrate other apps like Adidas Running, for example? ---------------------------------------------------------------------- spudd01 · 2023-12-23 10:38 Anyone know of this type of thing for Garmin? Would love a self hosted option that supports that ---------------------------------------------------------------------- bike_fairy · 2023-12-23 10:58 Thanks for sharing. I'm less interested in the social side of Strava but use it because my activities automatically get pushed there and I prefer the interface to Garmin connect. Strava's original killer feature was segments and the leaderboards. Strava is slowly putting more and more features behind their subscription as is their business model which is fine so if you were able to recreate some of those features in a self hosted service then I'd be interested. Two I'm particularly interested in are a personal heatmap and 'dot racing' comparison (overlay 2 or more activities on a similar course and playback concurrently to compare - essentially Strava flybys but just my own activities and allowing me to compare today to last week, month or year etc.). A more detailed fitness model/analysis would also be handy. I've looked at a browser plugin called elevate that syncs Strava data but analyses it locally to provide more stats. Years ago I used a desktop program called SportTracks that provided all sorts of detailed analysis and even user contributed plugins but unfortunately it went web based and subscription only and I didn't see the value. Gear tracking is nice but I'm currently too lazy to split chains, cassettes and chainrings out but I do appreciate the warnings Strava gives me when my shoes reach a given distance. ---------------------------------------------------------------------- ir31k0 · 2023-12-23 11:48 @joaovsilva cool app 👍🏻 Would you like help implementing the sync of the Strava gear? ---------------------------------------------------------------------- shoutfree · 2023-12-23 12:00 it's primarily a fitness tracking application, actually ---------------------------------------------------------------------- CheebaSweets · 2023-12-23 12:35 mastodon? pixelfed?... ---------------------------------------------------------------------- Thoscellen · 2023-12-23 13:17 Hey! That's definitively something i'm looking :) Being able to mix all sport I do in strava but that goes into my self hosted server and it's not shared or sold behind my back is really nice. Privacy focused Sport tracking app and website! ---------------------------------------------------------------------- joaovsilva · 2023-12-23 13:19 Thanks for the feedback. Some fitness/health features was something that I already thought about and want to do. But I believe some basics need to be covered first. Can I ask you to open a issue so your needs be logged? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 13:20 I don’t know adidas running but it is something that can be looked in the future. I know Garmin supports this. Can I ask to please ask an issue so this is logged? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 13:21 It can be looked in the future to also integrate with garmin. Can you please open an issue? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 13:22 Any help is appreciated. If you have any tip or recommendation to current features/code it is welcomed as well ---------------------------------------------------------------------- joaovsilva · 2023-12-23 13:23 Thanks for the feedback. Any thing additional you would value on a service like this? ---------------------------------------------------------------------- Thoscellen · 2023-12-23 13:53 I haven't tested it so I can't really tell for now… I noticed a 'Strava compatible' logo and wonder how you interact with strava. I can describe my usecase and general expectation though. --- I use Strava whenever it is for a run with friends or in solo, I like the addition of having them interact with the event once done (comments or likes), or strava detecting that we did the same track — but this is completely dispensable. I use it for swimming, but it's not easy to deal with GPS-less sport sessions as Strava tries to guess itself (and I have to edit the value manually) I have (had) a bike and I do (too) want to watch over gears wearing, the same as for my running shoes. Having reminders and warning on the long run is a good function, it can avoid accident and breaking pieces. I would also record holiday trip like hiking or bikepacking for several weeks. I record everything using my Withings watch, which is not near as powerfull as Garmin, this goes through the Withing app, then it shares it to Strava and iPhone Health / Sports apps. It would (ideally) be nice to *route* that flow of data to your app instead ; because I'm not at ease having health and sport related information shared on a distant server, as it could be potentially leaked and will expose an important part of my life, location, social data to nefarious people. ---------------------------------------------------------------------- KingQuin · 2023-12-23 14:08 One thing I love about Strava is the ability to import my activity from my Apple Watch, I then use the Strava API to export that data and do some historically analysis and forecasting. Does your app do this? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 14:12 Yes the app uses Strava api to retrieve activities. However currently it only displays basic stuff. What do you want to achieve with historically analysis and forecasting? Stuff like fitness trends and etc? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 14:13 I am sorry, but the issues that were being pointed out where all more or less similar so I used a similar approach to all. For more specific questions or comments I am answering individually to those ---------------------------------------------------------------------- joaovsilva · 2023-12-23 14:33 Thanks so much for the detailed description. I don’t know if withings can integrate with 3rd party, but it is something it can be assessed in the future. There are already people asking for Garmin and Adidas. If you use Strava now, endurain will retrieve all Strava activities and display them. There are some things that will not display correctly. For example it will mark walks, hikes and others as “Workout” instead of specific because the code is not prepared for that yet. It only detects it is swim, run or bike at the moment. Also the app does not have the ability to record. It supports import of already done activities via Strava or manually using a .gpx file. But can I ask you to test and app and then if possible open some issue/issues in the GitHub repo with features request, bugs, whatever? ---------------------------------------------------------------------- KingQuin · 2023-12-23 14:59 Yes that is what I am doing to hold myself accountable and track progress. I am doing this in my own ELK stack with some additional telemetry data coming from other things like weight scale & fitness tracking so do not expect that functionality in this solution. ---------------------------------------------------------------------- joaovsilva · 2023-12-23 15:05 Thanks for the response. Well the app can be extended to support additional things, if you would like to help or give some suggestions ---------------------------------------------------------------------- rogersaintjames · 2023-12-23 15:51 How come you are doing an import in a route? \`\`\` async def read\_activities\_all(token: str = Depends(oauth2\_scheme)): from . import sessionController \`\`\` You should probably be using the dependency injection to do all of the boiler plate you have repeated on each route. \`\`\` from . import sessionController try: sessionController.validate\_token(token) with get\_db\_session() as db\_session: payload = jwt.decode( token, os.environ.get("SECRET\_KEY"), algorithms=\[os.environ.get("ALGORITHM")\] ) user\_id = payload.get("id") \# Query the activities records using SQLAlchemy activity\_records = ( db\_session.query(Activity) .filter(Activity.user\_id == user\_id) .order\_by(desc(Activity.start\_time)) .all() ) \# Convert the SQLAlchemy objects to dictionaries results = \[activity.\_\_dict\_\_ for activity in activity\_records\] \`\`\` There is a lot of repetition if you ever want to modify how you do some auth or db stuff that is a lot of change you have to do. FastAPI docs are very good and might be a better place to start than chat GPT ---------------------------------------------------------------------- MordorMinion · 2023-12-23 16:02 I've been looking for a self-hosted fitness tracker forever! Excited to see this project. I don't use Strava often but would love too see a gadgetbridge or google fit integration one day. I'll create issues for these so they are documented if you don't mind. Well done on this. I'm not sure why so many people are upset. I'm glad you were able to make something functional especially after so many years since training. ChatGPT sucks at writing code, im sure this was a lot of work even if you relied heavily on it. We should be supporting and encouraging people to learn regardless of level of knowledge. Be proud of your work. Try not to let the negativity get you down. ---------------------------------------------------------------------- spudd01 · 2023-12-23 16:24 That'd be amazing, will do! ---------------------------------------------------------------------- ripnetuk · 2023-12-23 16:58 Don't we? I know I record all my walks and rides directly on Strava, either on my watch or phone. ---------------------------------------------------------------------- joaovsilva · 2023-12-23 17:34 Loved that feedback. Thank you. Can you please reference the documentation here this is stated? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 17:37 Thank you so much for the feedback. Yep I agree that ChatGPT is not the best but it helps a lot, and the rest to bridge the gap is good feedback, tips and recommendations. Please do, open the issues that you find useful, being new features, optimisations, bug reporting, etc ---------------------------------------------------------------------- joaovsilva · 2023-12-23 17:44 Thank you. In the meantime found this library, so yep definitely will go to the roadmap. And it is cool also at health perspective and maybe future features on that, because Garmin has a lot of data on that that might be pulled and used: https://github.com/cyberjunky/python- garminconnect ---------------------------------------------------------------------- Limbeckx1911 · 2023-12-23 18:01 This should be on the fediverse ---------------------------------------------------------------------- joaovsilva · 2023-12-23 18:04 Totally agree. I added it to the roadmap, but I believe some basics need to be done first. Specially code optimisation. To do features (not by order): - Retrieve gear from Strava - Default gear for activity type - Track gear usage - Gear components logic for component usage tracking - Comments and likes logic for activities - Notifications logic - Activity Pub integration? ---------------------------------------------------------------------- UnicornType · 2023-12-23 19:17 Any support or planned support for something that compares segment times like Strava has? ---------------------------------------------------------------------- joaovsilva · 2023-12-23 19:33 Not at the moment. But I believe it is possible to retrieve Strava segments as well from the Strava api ---------------------------------------------------------------------- Limbeckx1911 · 2023-12-24 07:23 As a paid subscriber op Strava, I would switch in a heartbeat if what you mention above is realised. ---------------------------------------------------------------------- HammyHavoc · 2023-12-26 04:18 Bold of you to assume I connect with anyone on Strava. ;- ) ---------------------------------------------------------------------- Mountainking7 · 2023-12-29 09:57 very nice! If only it had segments and compare rides on different segments