Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new sport/activities #364

Open
dkm opened this issue May 23, 2023 · 4 comments
Open

Create new sport/activities #364

dkm opened this issue May 23, 2023 · 4 comments

Comments

@dkm
Copy link
Contributor

dkm commented May 23, 2023

It would be nice to easily add new activities to the already existing list. I've already started local hacks to add the ones I'm missing, but I'm not even sure how to do that properly (taking inspiration from the "snowshoes" introduction).

In my case, I would need a new sport (paragliding) that would have sub-categories (a bit like cycling actually has transportation, etc):

  • paragliding (hike)
  • paragliding (cross)

I'm also tracking other cycling activities, so would have liked an extra cycling one. Maybe a tag feature would help here?

I'm ok doing these changes (adding few sports to the hardcoded list) myself, but I'm not really sure how to do them:

  • where do you get the svg images? Are you creating them yourself or are you using some external resources?
  • how do you handle the version (I see there are migration files for example)?
  • how do you generate all the static files?
@dkm
Copy link
Contributor Author

dkm commented May 28, 2023

After having imported last year's "workouts", I get several missing activities:

  • paragliding
  • snowboarding
  • tennis
  • swimming
  • cardio
  • treadmill
  • yoga

And I guess the list will quickly grow with every new users. Being able to define activities would really help...

@SamR1
Copy link
Owner

SamR1 commented May 28, 2023

Hi,

For now it's not possible for users to add their own sports.

Adding a new sport requires the following changes:

  • on API side, a new sport needs an entry in sports table with a new data migration (with a label, an active status and a default stopped speed threshold used by gpxpy).
    All activities are processed in the same way (FitTrackee is built around GPX files, mainly for outdoor activities, although it's possible to add a workout without a GPX file as a workaround when the gps device fails to save the file (or often in my case when I forget to start recording...)).
  • on client side, a sport has its own Vue component with an SVG icon (the most of icons are from flaticon.com), a default color and translation keys.

You can find the different commands (for migration or static files generation) in the Contributing.md.

By adding custom sports on your local instance, issues may be encountered when upgrading to the next versions (for instance with migrations, the down_revision must be updated before running them).

@SamR1 SamR1 mentioned this issue Dec 16, 2023
@AlexBocken
Copy link

@SamR1 Are you open for PRs for new sports? Looking intro Contributing.md it explicitly states one should ask.
Coming from Strava I was mainly thinking of two sports which I loved to track here and can see as keeping in-line with keeping FitTrackee Outdoors focused:

  1. Weights/Weightlifting
  2. Calisthenics

Both of these are also available on alternatives such as Strava and belong in any Endurance athlete's workout schedule, no?

@SamR1
Copy link
Owner

SamR1 commented Feb 7, 2024

Hi,

As FitTrackee is built around GPX files, for the moment only sports associated with a GPX file (mainly outdoor activities) can be added.

@SamR1 SamR1 mentioned this issue Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants