- Project Description
- Tech Stack
- Set-Up
- Project Development / Iterations
- Future Features
- Demo Media
- Progress Media
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
- Python, Flask, PostGreSQL, SQLAlchemy, JavaScript (AJAX, JSON), jQuery, Bootstrap, HTML, CSS
- Strava REST API
- Clone this repo:
cd <your_desired_directory>
git clone https://github.com/katalinschmidt/strava_balans.git
- Set-up the virtual environment:
virtualenv env
source env/bin/activate
pip3 install -r requirements.txt
- 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
>
- Seed the database with default training plans (prereq = PostgreSQL):
cd database
python3 seed_database.py
- To view the contents of the database:
psql strava_balans
- 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.)
- Create a new json file in the
- Strava API authentication & API data rendered on a sortable table
- Strava API data rendered on a Javascript Leaflet map
- Interactive Leaflet functionality:
- Click route for details pop-up (e.g. activity type, name, mileage, etc.)
- Filter routes by type or year
- 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)
- Given goal's training plan rendered on a FullCalendar calendar:
- Training item & date
- Extend CRUD functions:
- Allow user to edit individual activity item, and record those changes in database
- "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
- Extend interactive Leaflet functionality:
- Filter routes by type and year
- Extend interactive Leaflet functionality:
- Allow user to customize map appearance
- Diet page
- Journal page
Polylines before and after:
Splitscreen slider in-progress:
trial_error_1.mov
Splitscreen slider in-progress: