Skip to content

A full-stack Python Flask web application that allows Strava users to to visualize and filter their activities (by type and/or date) on an interactive Javascript Leaflet map as well as to create, read, update, delete training goals and the respective training plans with Javascript FullCalendar.

Notifications You must be signed in to change notification settings

katalinschmidt/strava_balans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BALANS

Watch the demo on Youtube

Table Of Contents

  1. Project Description
  2. Tech Stack
  3. Set-Up
  4. Project Development / Iterations
  5. Future Features
  6. Demo Media
  7. Progress Media

Project Description

BALANS is a full-stack Python Flask web application that allows Strava users to to visualize and filter their activities (by type and/or date) on an interactive Javascript Leaflet map as well as to create, read, update, delete training goals and the respective training plans with Javascript FullCalendar. The goal of this web application was to remove the competitive nature of the original Strava platform and, instead, allow a user to focus exclusively on their own athletic accomplishments and all-around well-being.

With the map component, a user can enjoy immediately seeing the geographic diversity of their past activities as well as enjoy exploring the frequency of their activity types across locations and years. A user could answer questions like, “In which countries / states, do I run the most?”, “Which neighborhoods in my area have I explored the most or least during my training?”, “In what years, was I really into biking?”, “What sport did I do the most during COVID?”, etc.

With the calendar component, a user can experience a sense of accomplishment by viewing all of their past training goals and plans, and a boost in motivation by viewing all of their current and future training goals and plans. A user can analyze which type of sport they train for the most, and, within that, which particular events. They can also identify the typical seasons in which they race / compete. A user can customize the individual items of their plan to fit their personal needs, so they also can evaluate how certain life events have affected their daily training in the past and, with that, plan their daily training items in the future in a way more realistically aligned to their personal routine.

With the future diet and journal components, a user will be able to record and track other aspects of their health and assess how those areas of their life are influencing their mood and physical fitness.

Current Key Features Summarized:

  • Visualize physical activities on an interactive and customizable map
  • Filter activities on map by type and / or by year
  • Option to personalize map center to user's location
  • Link directly to an activity on Strava
  • Link directly to user's Strava dashboard
  • Create & delete training goals
  • Read & update each training goal's respective training plan on an interactive calendar
  • Form input validation
  • Strava user authentication
  • Login protections

Tech Stack

  • Python, Flask, PostGreSQL, SQLAlchemy, JavaScript (AJAX, JSON), jQuery, Bootstrap, HTML, CSS
  • Strava REST API

Set-Up

  1. Clone this repo:
    • cd <your_desired_directory>
    • git clone https://github.com/katalinschmidt/strava_balans.git
  2. Set-up the virtual environment:
    • virtualenv env
    • source env/bin/activate
    • pip3 install -r requirements.txt
  3. Create an API account with Strava:
    • Strava's instructions found here
    • Update auth.py with your personal API information:
      • CLIENT_ID = <your_client_ID>
      • CLIENT_SECRET = <your_client_secret>
  4. Seed the database with default training plans (prereq = PostgreSQL):
    • cd database
    • python3 seed_database.py
  5. To view the contents of the database:
    • psql strava_balans
  6. To add new default training plans to the database:
    • Create a new json file in the default_trng_plans directory
    • Add the json file's name to line 24 in seed_database.py
    • Add the new plan as an option on the training goals form in training.html
    • Seed / Re-seed the database (see step 2.)

Project Development / Iterations

  1. Strava API authentication & API data rendered on a sortable table
  2. Strava API data rendered on a Javascript Leaflet map
  3. Interactive Leaflet functionality:
    • Click route for details pop-up (e.g. activity type, name, mileage, etc.)
    • Filter routes by type or year
  4. Database set-up & CRUD functions:
    • Form to create training goals
    • Store user-input in database
    • Create custom training plan by matching user-input with default plans' data
    • Render user's given goal's training items on table:
      • Training item & day (e.g. days 1-56, as stored in default plan's DB table)
  5. Given goal's training plan rendered on a FullCalendar calendar:
    • Training item & date
  6. Extend CRUD functions:
    • Allow user to edit individual activity item, and record those changes in database
  7. "Nav" Table to allow user to view all of their existing training goals:
    • Click to show a goal / associated plan on the calendar, or
    • Click to delete goal / associated plan from database
  8. Extend interactive Leaflet functionality:
    • Filter routes by type and year
  9. Extend interactive Leaflet functionality:
    • Allow user to customize map appearance

Future Features

  • Diet page
  • Journal page

Demo Media

index.html

index.html-top-layer

index.html-bottom-layer

loader-animation

example-routes-and-navbar

example-routes-and-navbar-filters-applied

training.html

training-goals-form

edit-trng-item

form-validation-date form-validation-goal

logout-alert

invalid-access-alert

Progress Media

Polylines before and after:

polyline-trial-error

Splitscreen slider in-progress:

trial_error_1.mov

Splitscreen slider in-progress:

trial_error_2.mov

About

A full-stack Python Flask web application that allows Strava users to to visualize and filter their activities (by type and/or date) on an interactive Javascript Leaflet map as well as to create, read, update, delete training goals and the respective training plans with Javascript FullCalendar.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published