We love bonding over music and think music is a big part of what bring people together, so we wanted to create an app that would use music to foster connections and create something people could have fun with.
What it does
This app allows two users to log in to their Spotify accounts and collects data about their listening habits. We do this by finding their top saved tracks and noting aspects of the tracks like danceability, acousticness, energy, valence, and more. Then based on our analysis of these components, we predict character traits of the players, like who is more happy, or who is more chill. Then we ask the players these same questions to see if they can get the right answer!
How we built it
The backend for this project made extensive use of the Spotify API, as we used it to access the user's top tracks as well as obtaining audio features of each track to collect data on the person's music taste as a whole. Then by analyzing the data we collect, we determine which of the two players has more of a certain trait, and store the questions we can ask along with their answers. To create the web component of the app, we used Flask. We chose Flask because it would enable us to combine Python and HTML/CSS. We also used Bootstrap to improve the visual layout of our app. Since all of our code accessing the API was written in Python, we were able to use Flask to send and receive data from the UI, thus creating a connection between the backend and the frontend.
Challenges we ran into
We ran into trouble because the Spotify API did not contain many examples or fixes to common problems in the API so we could not access information about the tracks. We also initially tried using Django, but had trouble figuring out how to connect the backend to the front end, so we moved to Flask. In the end we spent a lot of time debugging, but fixing the bugs is part of what made the project satisfying.
Accomplishments that we're proud of
The thing that we are most proud of is the amount of new skills we have learned over the past 24 hours. Neither of us have ever written the backend for a website, so Flask was something completely foreign to us. Additionally, the Spotify API was also something new to us. Since we were both so unfamiliar with the technologies we chose to use, getting our app to a functional state was far more difficult than we anticipated. Yet, we were able to successfully learn and implement new skills, bringing our idea to reality while learning lots along the way.
What we learned
We learned how to create webpages using Flask (and a little Django!) and bootstrap and how to use the Spotify API. We also learned how authentication and credentials work when accessing data as well as how the frontend and backend of an application can interact with each other.
What's next for SpotiFun
We want to be able to add more players and have them be able to log onto the game server from different devices. We also want to incorporate more games that involve music. Some additional games we’d like to include are “Guess that Song” and “Finish the Lyric”, where the app would play a song and players would have to guess the name, or finish the rest of the lyric. An additional aspect of the app could be Karaoke, where the app analyzes the user’s libraries to create a karaoke playlist catered to their interests. We would also like to incorporate machine learning for aspects like creating the karaoke playlist.