BeatBallot is a platform built to facilitate a fun and inclusive music listening/sharing experience for people in social gatherings. Users join custom rooms where they can suggest their favourite songs to the room and at the same time vote on everyone else's suggestions, with popular songs being added onto the queue.
- The more convenient Spotify API requires anyone using a player widget to have a Spotify Premium account. We opted to stream audio from YouTube instead, which required setting up a server that downloads, transcodes, then streams YouTube videos into audio that can be consumed in an HTML5 audio tag.
- The voting algorithm: We discussed everything from majority-wins to picking a fixed amount in preset intervals to, finally, having a minimum (upvote - downvote) threshold and sorting by oldest song inside of that. It ensures unpopular songs are never played without eliminating mildly positive ones.
- Stdlib doesn't allow cron-jobs or anything, so we had to think about how to implement everything in a reactive style. For example, rather than greedily updating the status of a room when it is changed, we check if there are any pending updates every time it is polled then update then.
- YouTube's search API started giving us quota exceeded errors just a couple hours before the deadline, but Cyrus saved the day with his secret collection of burner Google accounts.
The majority of our backend is "serverless" and powered by stdlib. The youtube audio streamer requires real-time transcoding and had to be hosted on a more traditional cloud platform that could handle high CPU usage for extended periods of time. We opted for Google Cloud Platform.
The intention behind BeatBallot is to reinvigorate people's love for music in a collaborative setting, and hopefully do it in a fun and refreshing way.