Cloudflare Stream and Supabase power a video MVP pipeline
This article details a serverless video upload pipeline leveraging Cloudflare Stream for video handling (upload, transcoding, thumbnails, playback) and Supabase for metadata, authentication, and workflow orchestration. The architecture is designed for an MVP, allowing direct browser-to-Stream uploads with Supabase managing permissions and state via webhooks. The author discusses the cost-effectiveness and architectural benefits of this approach compared to owning a custom video infrastructure or using alternatives like Mux or AWS MediaConvert.
Key Takeaways
- The upload flow uses TUS direct from the browser to Cloudflare Stream, while Supabase never receives the video bytes.
- Clip state is strictly ordered: `uploading` → `uploaded` → `transcoded` → `published`, with `failed` and `rejected` as terminal states.
- Stream sends a signed webhook to a Supabase Edge Function, which verifies an HMAC-SHA256 `Webhook-Signature` before updating Postgres.
- The prototype assumes 50 uploads per day, 30-second clips, and about 10 views per clip, for an estimated total pipeline cost of about $11.25 per month.
- The author chose Stream over Mux, Cloudinary, and AWS MediaConvert because it avoids owning FFmpeg, media servers, and playback compatibility handling.
Why It Matters
The immediate takeaway is that a small team can ship an upload-to-playback workflow without running its own transcode stack: Cloudflare Stream handles video processing, while Supabase controls permissions, status, and webhooks. That separation reduces backend complexity and keeps the browser from sending media through the app server. The competitive angle is clear in the comparison with Mux, Cloudinary, AWS MediaConvert, and Cloudflare R2: Stream wins on managed transcoding and playback compatibility, while Supabase stays the control plane. The next signal to watch is when this prototype’s 50 uploads/day or ~11.25/month cost model breaks under higher delivery minutes or the move to signed playback URLs.
Read full article at kashifaziz.me
