Skip to content

skennedy/strava-data-miner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strava Data Miner

Setup instructions

Explanation

I am a keen cyclist and upload most of my rides to Strava.

This application downloads all my ride data from Strava using it's API and collects my best average speed over different time periods.

Architecture

It is implemented in Scala and Akka. The main actors are:

  • StravaDataMiner
    • main class
    • instantiates the other main actors and sends the statistic requests
  • ActivityLoader
    • loads the data streams of all my ride activities by sending messages to StravaApi actor
  • StravaApi
    • actor that wraps Strava API library
    • multiple instances via a router for faster loading
  • BestAverageSpeedPerTimePeriodMiner
    • main data miner actor
    • is given all the activities by the loader
    • creates child actors for each activity
    • takes the per-activity results and determines the best overall activity
  • BestAverageSpeedPerTimePeriodPerActivity
    • child of above
    • finds the section of its activity with the best average speed
    • receives many average speed values for slices of its data streams, returns the best to its parent
    • the real work is done by its children:
      • StreamSlicer
        • given the Time data stream it finds slices that cover the given period
        • resulting Slice objects are sent to...
      • AverageCalculator
        • given the Speed data stream and a Slice object it calculates the average of that data
        • resulting SliceValue objects are sent back to parent
        • constructed using a Router for parallelism

TODO

  • More tests!
    • I ran out of time so ended up testing the main miner class manually
  • Generalize the miner
    • should be able to use other data streams instead of Speed (e.g. Power, Heartrate)
      • so we can do Max Average Heartrate over 5 minutes
    • should also be able to use other data streams instead of Time (e.g. Distance)
      • so we can do Max Average Speed over 1km
  • User interface
    • CLI or Web frontend to send data requests

About

Strava Data Miner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages