juro oravec

Web app: Spotify-Strava Integration

Spotify playlists auto-generated from songs you listened to during Strava activities.

updated 19 Feb 2022
stravaspotifyintegrationrest apitypescriptpassport.jsexpresspostgresqlaws
archived

Integration between Spotify and Strava that created Spotify playlists from songs you listened to during your Strava activity. The playlist was also added to the Strava activity description.

User flow

User logged in with email or social login. Once logged in, they connected their Strava and Spotify accounts. There was a dashboard displaying all created Spotify playlists. User could configure how to format a new playlist, and whether and how to update the Strava activity description.

Backend

Written in TypeScript, Node.js, Express.js, REST API. User authentication handled by passport.js.

For each user, the app polled Spotify for recently played songs with their access token, and cached the songs in PostgreSQL database. Likewise, for each user, a webhook was registered on Strava to listen for “activity created” event. On the event, the songs were retrieved from the cache, and a new Spotify playlist was created with them.

Deployment

Backend deployed on AWS EC2, frontend on S3, database on RDS.

Project Status

Project was stopped because of poor integration support. Strava webhooks can have delay up to 30 mins, so users had to wait before playlists became available. Spotify rate-limits per app token (not per user), making the polling approach unscalable.