Strava API Integration for Runners based on SportsPress
Challenge
Our client came to us with an interesting idea. They wanted to integrate Strava API which is an API that keeps and provides data about running or cycling activties into WordPress. They wanted a Leaderboard powered by SportsPress plugin to present the runners in a competitive list. They wanted the process to be as frictionless as possible to let the users compete in a virtual leaderboard.
Our task mainly was to:
- Implement a user registration process to add the user to a team
- Implement a connection between the user account and Strava API
- Calculate points based on data and assign to user
- Maintain a team structure throughout the project
- Implement a display of the best performers in a Leaderboard
Our Solution
The project had some insightful details and complex problems to solve.
Here’s how we solved the problem:
User Registration
We were given the task to create a registration process for new users which will take the appropriate information needed for the implementation and also would ask for a Team. Team is simply a company in which the user is playing under.
Strava Integration
Client wanted us to gain Strava information from user and use it for the integration. We used webhooks to fetch real time data from Strava API. The data is complex and had many activities related to it. We have processed the data to convert the activities into points.
Points Management
Converting the data into points was done based on activities data that we retrieved from user’s Strava API access. We used formulas to determine points from the data. The points helped us rank the teams in leaderboard.
Team Structure
Teams are in the essence of the whole project. All those complex user based data has been distilled into team data to make it easier to understand. Individual points were aggregated into teams and those teams were ranked later on. This is a grouping effort to make the data simpler and easier to understand.
Leaderboard
Leaderboard is a list of teams arranged from the best to least performing earning points of the teams. SportsPress did not have support for the competition we implemented, so we had to hook into the way SportsPress displayed the Leaderboard.
Are You Interested?
We can get you hooked to a similar project!
Some images might be subject to copyright. In case otherwise stated, the copyright belongs to the copyright holder.