Skip to content

Send weekly Spotify listening history reports, similar to Spotify's yearly wrapped. Hosted on AWS.

License

Notifications You must be signed in to change notification settings

MohamedAbdeen21/spotify-wrapped

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify-wrapped

An email service that provides weekly content similar to Spotify Wrapped (most listened songs, genre, artists, total play time, etc..).

Overview

This GitHub project is a serverless solution for sending weekly email summaries of users' Spotify listening history. The project is built on AWS Lambda (deployed using Terraform) and utilizes various AWS services to achieve this functionality. A detailed overview of the workflow mentioned below.

Subscribing

Due to Spotify API's restrictions, this service is not available publicly. Currently, this is only used by me and a few close friends. Please feel free to reach out if you're interested in subscribing to such a service.

Technical details

The project comprises the following components:

  1. User Registration API (AWS Lambda): Python API allows users to register for weekly summaries. It stores user data on DynamoDB

  2. DynamoDB (NoSQL database): Stores user data and listening histroy information.

  3. Listening History Query Lambda (AWS Lambda): Python Script which runs hourly to fetch users' Spotify listening history over the past hour using the Spotify API.

  4. Data Aggregator Lambda (AWS Lambda): Golang script which runs once a week to query DynamoDB (through Athena) and summarize the listening data for each user. Sends summaries to SQS.

  5. Amazon Simple Queue Service (SQS): Used to queue the summaries generated by the Data Aggregator Lambda.

  6. Email Sender Lambda (AWS Lambda): Python script to consume the SQS queue and sends email summaries to corresponding users.

Almost all components are managed by Terraform, except:

  • federated query, which allows athena to query DynamoDB (TODO)

Contribution

Please feel free to contribute and open a PR. Some Quality-of-Life TODOs are:

  • There are still a few components missing from Terraform, like the federated query.
  • Add an unsubscribe endpoint and make a landing page for both subscribing and unsubscribing.
  • The email itself can use some work. I'm not the best UI designer, sorry.

About

Send weekly Spotify listening history reports, similar to Spotify's yearly wrapped. Hosted on AWS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published