soundcloud dj mixes music web development

Off Grid - A Soundcloud Alternative

An attempt at building a platform for a low friction self hosted streaming and embedding platform.

I’ve used soundcloud to host my dj mixes, and to discover, listen to and share music for years, possibly decades by now. It’s still the best platform for music from independant artists, has a great web player, and the connections built over time makes it a very rich platform. That said, it’s also been very bad at making improvements and has been slowly losing users to other forms of streaming for years. Although I don’t consider their pay account prohibitive, I think for many people it is, and the ads make people less likely to stream.

I think there could be a better, cheaper and more durable solution in self hosting music, and I think it could even be affordable and easy enough to maintain for folks to build their own mini-soundcloud sites or communities.

To that end, I’m going to work on building a project that answers those questions, makes it easy to onboard and ideally include some additional nice enrichment features to make sharing and listening to dj mixes even better, for cheaper.

What features?

  • Easy Uploading — a simple interface for uploading and managing tracks, with support for bulk uploads and metadata editing.
  • Onboarding — a simple onboarding command that walks you through some easy options for hosting and setting up the project
  • Web Player — a clean looking and useable player as a web component with transport controls, waveform display, cover art, position jumping, tracklists/details, embeding
  • Web Playlist — a configurable playlist component that can contain many players
  • Enrichment — some nice to have features like playlist extraction, links to artists and automatic bandcampification of tracks, social features like “likes” and comments.

The Stack

The whole thing runs on Cloudflare’s edge platform with no server to maintain and a near-zero hosting bill:

  • Cloudflare R2 — object storage for the audio files, cover art, waveform peaks, and the published manifest.json. Crucially, R2 has zero egress fees, so streaming stays cheap no matter how much it gets played. Files are served from a public bucket URL.
  • Cloudflare D1 — a SQLite database holding the metadata: mix titles, artists, tags, tracklists, and playlist order.
  • Cloudflare Worker — a small REST API that reads and writes D1, uploads to R2, handles auth (JWT-based, multi-tenant), and publishes the static manifest.json. Deployed and managed with Wrangler.
  • Web components — the embeddable <offgrid-player> and <offgrid-playlist> are framework-free custom elements that render inside Shadow DOM, so they drop onto any page without style conflicts.
  • Static frontend — the player page and admin UI are plain static HTML/JS with no build step; the player page just fetches manifest.json and renders itself.
  • Waveform peaks — generated client-side in the browser via the Web Audio API on upload, or offline with a small Node + ffmpeg script (generate-peaks.js) for batch processing.

The result is an architecture you own end to end: clone the repo, point it at your own Cloudflare account, and you have your own ad-free, lock-in-free audio platform.


Example Off-Grid Player