How I built a fully automated anime streaming platform with 2,733 episodes on $0 infrastructure

2026年9月9日10 次浏览来源:Dev.to阅读原文

The Challenge

I wanted to prove that a complete streaming platform could be built with zero monetary investment. No AWS credits. No paid hosting. Just free tiers, automation, and a lot of JavaScript.

The result: 161+ anime titles, 2,733 episodes, 15 languages, and a full admin panel – all running on $0/month infrastructure.

The Stack

Layer Technology Frontend Next.js 14, React, TypeScript, Tailwind CSS Backend API Cloudflare Workers (serverless) Database Cloudflare D1 (SQLite) + Supabase (PostgreSQL) Cache Cloudflare KV (< 50ms response time) Auth Supabase Auth Notifications Firebase FCM Video Player HLS.js with custom CORS-proxy bypass Hosting Vercel (frontend) + Cloudflare Workers (API)

Infrastructure cost: $0/month. Yes, really.

The Hard Parts

1. HLS Streaming with CORS Bypass

Video streams (M3U8 playlists) from third-party sources often block cross-origin requests. I built a custom proxy route that:

  • Fetches the M3U8 playlist
  • Rewrites all segment URLs to go through the proxy
  • Streams back the modified playlist to the client
  • Handles CORS headers properly

The proxy handles both .m3u8 playlists and binary segments (.ts, .m4s) while preserving Range headers for partial content.

Code snippet – proxy playlist rewriting:


javascript
const rewritten = text
  .split(/\r?\n/)
  .map(line => {
    const trimmed = line.trim();
    if (!trimmed || trimmed.startsWith('#') || trimmed.includes('/api/proxy')) {
      return line;
    }
    try {
      const resolved = new URL(trimmed, baseUrl).toString();
      return `/api/proxy?url=${encodeURIComponent(resolved)}`;
    } catch {
      return line;
    }
  })
  .join('\n');
分享
Baike.dev

baike.dev helps you discover great languages, frameworks, databases, DevOps and cloud-native tools.

Quick links

About

Contribute

Found a great developer tool? Share it with the community.

Submit a tool
© 2026 baike.dev Developer EncyclopediaUpdated daily · Discover great developer tools