Real-time and media

Tech stack for a video streaming platform (2026)

Creator video platform, designed by StackPrism from one sentence: 13 components, a reason for each, and the live checks that watch them.

The stack

  • Next.js
  • Cloudflare
  • PostgreSQL
  • Redis
  • Clerk
  • Stripe
  • Sentry
VideoStreamingCDNUpdated
The idea someone typed
“A video platform where creators upload long videos and viewers stream them on the web and on TV apps, with adaptive quality, subtitles, view analytics and paid channel subscriptions.”

Their answers on the constraints step

Expected scale
10k+ users
Where users are
Global

Make it yours. Open this stack in the editor to check its health, harden it and hand it to your coding agent. No sign-up, nothing to generate.

Start from this stack
goes down

Select a component to see what it does and what it connects to, or pick one above to see what breaks if it goes down. Pinch or use the buttons to zoom.

Why this stack

Creators upload through the Next.js app and the Core Content API, and a background worker keeps the original file in Cloudflare R2 and sends it to Cloudflare Stream, which encodes it for adaptive quality. Viewers on the web and on TV apps ask the Playback Session API for a stream: it checks their subscription, which Stripe’s webhooks keep current, uses Redis for fast session checks and hands back a signed link served from Cloudflare’s CDN, close to viewers around the world. The APIs and the worker run on Railway, Clerk handles accounts and Sentry reports errors.

Why each piece

All 13 components on the diagram: what each one does, what it talks to, and what stops if it goes down.

  1. TV Apps

    Roku and TV clients. Calls Playback Session API and Cloudflare CDN (streams).

    Nothing else on the diagram depends on it.

  2. Next.js App

    Viewer and creator UI. Calls Core Content API, Clerk (auth), Cloudflare CDN (delivers) and Sentry (errors).

    Nothing else on the diagram depends on it.

  3. Playback Session API

    In Backend Services

    Streaming and access. Calls Cloudflare CDN (signs), PostgreSQL (reads) and Redis (reads). Called by TV Apps and Stripe (webhooks).

    If it goes down, 1 of 12 components stops working.

  4. Core Content API

    In Backend Services

    Content and uploads. Calls Clerk (verifies) and PostgreSQL (writes). Called by Next.js App.

    If it goes down, 1 of 12 components stops working.

  5. Background Worker

    In Railway

    Async processing. Calls PostgreSQL (updates), Cloudflare R2 (stores) and Cloudflare Stream (processes).

    Nothing else on the diagram depends on it.

  6. Cloudflare CDN

    Video delivery. Called by Next.js App (delivers), TV Apps (streams) and Playback Session API (signs).

    If it goes down, 3 of 12 components degrade.

  7. Cloudflare R2

    In Data & Storage

    Source video storage. Called by Background Worker (stores).

    If it goes down, 1 of 12 components degrades.

  8. PostgreSQL

    In Data & Storage

    Application system of record. Called by Background Worker (updates), Core Content API (writes) and Playback Session API (reads).

    If it goes down, 5 of 12 components stop working.

  9. Redis

    In Data & Storage

    Session and hot cache. Called by Playback Session API (reads).

    If it goes down, 1 of 12 components degrades.

  10. Cloudflare Stream

    In External Services

    Video transcoding. Called by Background Worker (processes).

    If it goes down, 1 of 12 components degrades.

  11. Clerk

    In External Services

    Authentication provider. Called by Next.js App (auth) and Core Content API (verifies).

    If it goes down, 2 of 12 components stop working.

  12. Stripe

    In External Services

    Subscriptions and billing. Calls Playback Session API (webhooks).

    If it goes down, 1 of 12 components degrades.

  13. Sentry

    Error tracking. Called by Next.js App (errors) and Backend Services (errors).

    If it goes down, 3 of 12 components degrade.

When this stack fits

  • Viewers are worldwide and playback has to start quickly everywhere.
  • You’d rather pay for encoding and delivery than run them.
  • Paid channels, where access is checked on every playback, not only at sign-up.

When to pick something else

  • You need live streaming too: plan for it from the start, because this diagram covers uploaded video only.
  • Short clips in a feed: a simpler upload-and-play video API may be enough.

What you need to build this

13 components across 8 areas of the stack.

Build it with your AI agent

Hand the stack to Claude Code, Codex, Cursor or any coding agent as a brief: how it connects, install steps and a build plan.

Frontend2

  • Next.js App

    viewer and creator UI

    npm install next

    Docs
  • TV Apps

    Roku and TV clients

Backend & APIs4

  • Core Content API

    content and uploads

  • Playback Session API

    streaming and access

  • Background Worker

    async processing

  • Cloudflare Stream

    video transcoding

    Docs

Data1

  • PostgreSQL

    application system of record

    Docs

Cache & queues1

  • Redis

    session and hot cache

    Docs

Auth1

  • Clerk

    authentication provider

    npm install @clerk/nextjs

    Docs

Payments1

  • Stripe

    subscriptions and billing

    npm install stripe

    Docs

Storage & CDN2

  • Cloudflare R2

    source video storage

    Docs
  • Cloudflare CDN

    video delivery

    Docs

Observability1

  • Sentry

    error tracking

    npm install @sentry/nextjs

    Docs

Install

npm install next @clerk/nextjs stripe @sentry/nextjs

SDKs only. Pick your own database driver or ORM.