Some software just refuses to die. Andre is one of those projects.
The Echo Nest Days
Back in 2014, The Echo Nest had a problem every office has: who controls the music? We built Prosecco, a web-based jukebox where anyone could add songs to a shared queue. No fighting over the aux cord. No Spotify account sharing. Just a URL and democracy.
It worked well enough that when Spotify acquired us, a few of us forked it internally and kept it running. We called the fork "Andre" - if Prosecco is the fancy bubbly, Andre is the cheaper stuff you grab at the corner store. It was a quick and dirty fork, and the name fit.
The Rules
Every new employee (and guest) got a welcome email with the rules. I still have it saved somewhere. The gist:
- Put things on the playlist. We want to hear what you like.
- Variety is fun. One or two songs by a given artist, a handful in a genre, then give someone else a turn. Weirdness is fine, but short weirdnesses are more readily appreciated than long ones.
- Don't skip a song once it starts playing. Somebody picked it and has been waiting for it to come on.
- Anyone can lower the volume for any reason. If it's been down for a while, feel free to turn it back up.
- When in doubt, put on your headphones.
There were also some "special occasion" buttons that played specific songs. The email always said "you probably shouldn't push those." People pushed them anyway.
Bender Mode
Bender mode solved the dreaded empty queue problem. Named after the Futurama character (bite my shiny metal ass), it watches the queue and auto-fills when things get quiet.
When I resurrected Andre, I upgraded Bender with a "time capsule" feature. We kept play logs from November 2017 through May 2018 - about 11,600 plays across 95 days. Bender now uses these as a recommendation source, surfacing songs that were played on the same day of the week. If it's Monday, you might hear what we listened to on a Monday in 2017.
It filters out Benderbot's own plays (to avoid feedback loops) and shuffles the results. The effect is strange and wonderful. Songs I haven't thought about in years suddenly playing again. The stuff we listened to while debugging recommendation algorithms, the tracks that got us through late nights before launches. Some of them make me cringe now. Most of them make me smile.
The airhorns were inevitable. Every office jukebox eventually gets sound effects. Ours has the classic airhorn, a sad trombone, and a few others I won't spoil.
The Architecture
One thing that confuses people: Andre is a shared queue, but individual playback. Everyone sees the same queue. Everyone can add songs and vote. But each person connects their own Spotify account and plays along on their own device. Andre is the DJ, not the speaker.
┌─────────────────────────────────────┐
│ Web Browser │
│ (Backbone.js + WebSocket client) │
└───────────────┬─────────────────────┘
│
┌───────────────▼─────────────────────┐
│ Flask App (app.py) │
│ - OAuth (Google + Spotify) │
│ - REST API │
│ - WebSocket (gevent) │
└───────────────┬─────────────────────┘
│
┌───────────────▼─────────────────────┐
│ Redis │
│ - Queue data │
│ - Votes & jams │
│ - Session state │
└───────────────┬─────────────────────┘
│
┌───────────────▼─────────────────────┐
│ Background Worker (master_player)│
│ - Tracks playback timing │
│ - Bender recommendations │
│ - Broadcasts queue updates │
└─────────────────────────────────────┘
The background worker is the interesting part. It runs continuously, tracking when songs should end and advancing the queue. When the queue empties, it kicks off Bender mode to pull recommendations. All queue changes get broadcast over WebSockets so everyone's view stays in sync.
The Modernization
The original codebase was Python 2. Flask, SQLite, the Spotify Web API. It worked but was showing its age.
Over the last year, I've been cleaning it up:
- Python 3 migration (the usual unicode headaches)
- Swapped SQLite for Redis (simpler for the queue-centric data model)
- WebSockets via gevent for real-time updates
- Cleaned up the Spotify OAuth flow
- Added the throwback feature
- Dockerized everything for easier deployment
The whole thing runs on a $6/month DigitalOcean droplet with Caddy handling HTTPS. It's not production-grade software. It's a jukebox. But it works, and it's fun, and sometimes that's enough.
Try It
Andre is live at andre.dylanbochman.com. You'll need Spotify running somewhere to hear the music, but you can browse the interface and see how it works.
There's also a project page with more details on the features and tech stack.