Fly.ioExplainer
LiveBeats: Building a social music app with Phoenix LiveView
Summary
LiveBeats is an open-source social music application built as a full-stack Phoenix reference app and learning test bed for LiveView features. It demonstrates a shared real-time UI for playlist playback, presence, GitHub OAuth, and concurrent MP3 uploads, using Phoenix PubSub and the existing LiveView WebSocket connection rather than separate REST, JSON, or polling layers. Uploads are processed concurrently in temporary files to verify MP3 validity and enforce a duration below 20 minutes, while HEEx function components and slots provide reusable UI and JS commands keep immediate interactions such as modal hiding on the client. The application runs across five continents with automatic clustering, file proxying, and regional Postgres read replicas; the post presents this as a way to deliver responsive global behavior with relatively minor changes.
Context
The project was created as a full-stack Phoenix reference application that would stress the framework with contemporary requirements such as real-time updates, social interaction, file uploads, and presence, rather than demonstrating only REST endpoints or a todo app. LiveBeats also serves as a learning example and test bed for new LiveView features.
Approach / What changed
LiveBeats uses Phoenix and LiveView for stateful browser synchronization, Phoenix PubSub for broadcasts, WebSocket-based uploads, concurrent server-side MP3 processing, HEEx function components and slots, and LiveView JS commands for client-side effects. It is deployed across five continents with automatic clustering, file proxying, and regional Postgres read replicas.
Takeaways
Phoenix PubSub lets LiveBeats broadcast business events and have connected LiveViews update their interfaces, including across horizontally scaled servers.
LiveView uploads use the existing WebSocket connection; temporary files stay on the LiveView's load-balanced instance while MP3s are concurrently parsed, verified, and checked for a duration under 20 minutes.
LiveBeats was deployed across five continents with automatic clustering, file proxying between regions, and Postgres read replicas for mostly static data, requiring only minor changes.
Source and freshness
- Source
- fly.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.