Skip to content

samanthacsik/strava-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A shiny dashboard for exploring my personal Strava data

Why build a Strava dashboard?

A few reasons!

  • I started recording my hikes on Strava during the pandemic and quickly became obsessed with my log of activites -- both to look back on where I've been and what I've done, and also for chasing those top 10s (a little embarrassed to admit...). I created a leaflet heat map (find my original strava-hikes repo here) of my activities (check it out on my personal website!) to include with my first introduction Tweet when I curated for @WeAreRLadies in June 2022 and quickly discovered that I wanted more ways to interact with my data (read: a Shiny app).
  • I've been teaching an Intro to Shiny short course for UCSB's Master of Environmental Data Science (MEDS) program since 2022, but didn't have a ton of personal experiences building Shiny apps or dashboards when I first started. What better way to learn than to embark on a personal project that you're excited about, right?!
  • I want to get into the habit of having a personal project to work on for learning new skills (and to add to my portfolio). Shiny is exciting because there are tons of ways to optimize your code to make your app run more efficiently, lots of complementary packages to enhace features, and endless ways to look at data. While it's a bit hard to find time to iterate consistently on this dashboard, it's a fun project to return to when I'm trying to learn a new Shiny skill for the first time.

You can explore the current version of the dashboard (which I've affectionately dubbed, Sam's Strava Stats) at https://samanthacsik.shinyapps.io/strava_dashboard/.

Repository organization

There are lots of files in this repo, some of which are non-functional works-in-progress. Below is a map of the most important (and yes, functioning) files for making this dashboard run.

.
├── R/                                # scripts for trying out visuals and analyses before adding to the app
│   └── scrape_strava.R                 # retrieve and wrangle Strava data  
│   └── leaflet_map.qmd                 # build leaflet map (used for saving widget to embed in my personal website)
|   └── /media                          # pngs for leaflet marker icons
|
├── strava_dashboard/                 # app directory 
|   └── R                              # functions, themes, plots
|   └── data/                          # .rds files (generated in ./R/scrape_strava.R) for reading into app   
|   └── text/                          # markdown files containing text to be used throughout the app
|      └── danner.md                    # caption for danner boots photo in gear garage
|      └── data_info.md                 # title and caption for DT dataTable
|      └── gear_garage.md               # gear garage box title and description
|      └── home_page_footer.md          # landing page footer 
|      └── intro.md                     # landing page intro text
|      └── leaflet_info.md              # leaflet box title and description
|      └── updating_data.md             # note about app updates   
|   └── www/                           # special directory in shiny for images, stylesheets, etc. 
|      └── media/                       # images & logos used throughout app
|      └── styles.css                   # stylesheet for customzing dashboard
|   └── global.R                            # data, objects, etc. that need to be available across app
|   └── ui.R                                # user interface
|   └── server.R                            # server
|   └── rsconnect/shinyapps.io/samanthacsik # shinyapps.io deployment
|
├── README.md
├── .gitignore        
└── strava_dashboard.Rproj

Retrieving Strava data

I retrieve my personal Strava data using the {rStrava} package, which provides some really nice functions for accessing data from Strava's v3 API. This retrieval and data cleaning / wrangling occurs outside of my dashboard in ./R/scrape-strava.qmd. A cleaned version of the data set is then saved as an RDS file to an AWS S3 bucket. The application reads this cleaned data in directly from the S3 bucket.

If you're interested in grabbing your own Strava data, but aren't sure where to begin, I've detailed my steps in this wiki.

Report a bug

I certainly don't expect the community at large to be doing deep dives into this code base, but if you happen to be checking things out and spot something that's not working like it seems it should, feel free to file an issue (brief but informative descriptions of the issue and screenshots are helpful!).

Contributors

This is a personal project by yours truly, Samantha Csik.

Acknowledgements

I was first inspired to embark on this little personal project when I stumbled upon by Daniel Cullen's blog post, Creating a Heatmap in R with Google Polylines. Daniel shares instructions for creating a heatmap using Strava data just like I was hoping to do (and ironically, his map features his runs in my current home town of Santa Barbara, CA -- small world!). This blog post is also what introduced me to Marcus Beck's {rStrava} package, a package that provides functions for accessing data from Strava's v3 API. A few other resources that I referenced include:

Lastly, all of my gratitude and love for these three muskateers -- from left to right: Levi, Molly, & Tallie -- who make exploring the outdoors more fun, always.

Levi, Molly, and Tallie

License

The source code for this dashboard is licensed under the MIT license.

About

a shiny dashboard for visualizing Strava data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages