Spotilight
Winter - Spring 2024
Innovates upon Spotify's pre-existing Web API, providing users with data about their viewing experience, as well as robust tooling to manage their own playlists in a comprehensive way.
"Spot-i-light" is not a misspelling - it's a play on "Spotify" and "Spotlight".

A Tedious Task & Calling for Automation
After a couple years of using the Spotify app, I decided I wanted to start creating seasonal "snapshot" playlists to capture my listening history for a fourth of the year. Each playlist consists of 50 to 55 songs each season, and highlights the top five artists I've been listening to for that season and reflects a dozen of other songs I've been listening to unrelated to the top five artists. These playlists in general give me a pretty good idea about what I've been listening to for a period of time and I can view how my listening history has evolved overtime. Starting off, I didn't have a better method than to create these playlists by hand picking out all of the songs and artists, just based on what I thought I was listening to the most. After a year and four handpicked seasonal playlists later, I decided I wanted to create a tool that could automate this process.
Originally, my motive for building Spotilight was to simplify my playlist creation, and the rest of the app evolved from there. I came to realize when conceptualizing the app, not only did it feel like Spotify's playlist creation was lacking, but a lot of the statics around a user's app usage is largely lack-luster - unless it's around the end of the year when Spotify sends out a user's Spotify Wrapped (captures a users listening history for the entire year). These became the two parts of the app.
Project Creation
I stumbled upon the Spotify Web API a little before I had concocted the idea for the project, which set in stone that making the app would be feasible. Spotify supports OAuth 2.0 authentication, and when authenticating into an app using Spotify's API, a user must agree to permissions to read and alter their account data. Specifically in this project, a user must give Spotilight access to playlist modify scopes and user data read scopes when providing their credentials.
The app was built using a Vue.js client and a Flask server. Flask was used to authenticate, efficiently parse data and carry out more complex operations before handing things off to the front-end. In this project, Flask acted as a middleware layer to bridge calls from Vue.js and handling data after calling Spotify endpoints.


Scheduling & Progression
As far as project management, I tried to simulate an Agile Scrum team to handle carrying out tasks, similar to how I would in a work environment. Although, in this project I'm the full team - I'm the product owner, project manager, scrum master, and developers. I get to make all the decisions and code it all myself. While this may not sound anti-Agile/Scrum, I wanted this to seem as close as it could get to a Scrum project with it just being myself. I set deadlines, created tasks, and set a pace that I wanted to complete parts of the application by. I set a more brisk pace in which I have worked on scrum teams, with weekly sprint cycles instead of it being bi-weekly, and had a deadline of a couple months to finish the main architecture and design of the app.
How Production Stacked Up
In general I felt like the process kept me at a good pace and I was able to reach my deadline goals. I mocked up user stories and epics early in development, and divvy up tasks in the backlog prior to the beginning of a sprint. I made use of GitHub projects, which gave me some decent views of how my weekly work stacked up (with a Sprint Board) and gave me a run down of how the whole project was going (with a Roadmap). I was also able to take advantage of some automation, such as issue templates for the projects and an ease to add new issues directly to the project with generated metadata. Throughout the project I had found myself ahead of schedule, and thinking "Oh I could do another task this Sprint." I was better at estimating my velocity towards the end of the sprint. I started by placing down the initial infrastructure earlier in the project, starting with authentication and then handling the playlist and metrics pages. There was a week or two where I knew work was going to drag (due to vacation) and I was able to foresee this and plan ahead by giving myself less development heavy tasks and focus on documentation.
Playlist Management
Spotilight provides robust playlist management options, such as copying, mass deleting, merging multiple playlists together and forming brand new playlists. User's have the ability to view their full playlist catalog in a tabular view or grid view and filter data.


Track Management
User's have the ability to view and manage tracks within a playlist and filter data. A user can mass delete playlist items or even create a brand new playlist from selected items in a playlist. User's have the ability to add new tracks by searching for a track's name or searching for an artist and adding a number of their top songs.
Viewing Stats with "Showcase"
Spotilight's "Showcase" page allows users to view metrics about their listening experience. Users can view their Top Tracks and Top Artists from this page. The user can specify a desired time-frame and view a count of top tracks/artists. From these sections a user can also generate playlists simplify by a click of a button and providing a name for the playlist. From the "Showcase" page a user can also view their Top Genres/Sub-genres in a Pie Chart.

A Solid Solution to my Dilemma?
To handle my seasonal playlist creation goals this app gets me pretty close to what I wanted. I'll start by creating a playlist from my five top artists and 25 top tracks in "Showcase". These sections are more useful than I had expected to generate playlists from my recent listening history, and I've used it in more ways than just getting tracks for my routine seasonal playlist. I can then take these two playlists and merge them together, as one of my playlist management features. I found this to be my preferred method to generate my seasonal playlist. After that I'm about 90% done with my process. Typically, I still like to hand pick a couple songs and swap some of the top artist songs for lesser known songs of theirs if I like some that are better. After a little bit of fine-tuning, I'm happy with my playlist. While this isn't completely automated this process is mostly a couple button presses and a little bit of tweaking, which is much better than hundreds of clicks and saves me quite a bit of time from my purely by hand selection processes.
In general, I think my goals may be a little niche to myself, but as a playlist management and user metric app, I think this works pretty well and I'm sure users of Spotify would find value in this tool. And you know what, I can say this app has made my life easier overall. It fills some wide gaps in what is missing or not being pursued in Spotify's app.

Challenges and What I Learned
I found the authentication piece to be a bit of a challenge - I hadn't worked with many authentication platforms before and this project opened me up to JWT and Bearer tokens. There were a few questions I needed to ask to get me where I wanted to be with the persistence piece: "how should I best store these tokens?" "Should it be local or session storage in the browser?" "Should I use a library and store it on the Flask server?" "Should I also use a refresh token?"
I also did feel like there were some challenges with limits on Spotify that I hadn't perceived until later into the development process. Writing a genre algorithm was difficult as not every song provides a genre, instead I had to rely on the artist's genre. Sub-genres are not a concept to Spotiy's Web API, and I came up with an algorithm that categorizes artist's genre's into smaller sub-categories. The term length was also a tad bit of a challenge to work with Spotify's API. Spotify only gives short-term (4 weeks) medium term (6 months) and long-term (3+ years) length timeframes. I just had to work with what Spotify gave me here in order to show accurate metrics.
Going Forward
I ended up going to a music concert earlier this year in the spring and found myself with a desire to add some extra automation to this tool. I added the ability to search and add an artist's top songs. I consider adding additional features just like this that makes playlist creation easier and with myself being a bit of an indie-head, I could see myself adding additional features to help me explore underrated music and new artists.
I'm also a huge fan of Discover Weekly, so maybe I could make some sort of spin off of that for this app. I also want to refine some of my algorithms and improve on them in the application. The genre algorthim could use some work to improve it and I'm excited to return to it at some point.
Docs & Repository
For more information or to demo the project, you can find the repository on GitHub. The docs folder includes information about using the application and developers page to run the application. When running the application, the "About" page goes into detail on how to use all of the applications features.
