Back to Blog

Building Snapcast: A Full-Stack Screen Recording & Streaming Platform

July 20, 2025 (10 months ago)

Building a reliable video streaming platform from scratch is notoriously difficult. Handling large file uploads, encoding video, managing delivery networks, and ensuring security all pose massive technical hurdles.

Recently, I set out to tackle this challenge by building a Full-Stack Screen Recording and Video Sharing Platform (which you can check out on my GitHub). My goal was to create a lightweight, blazing-fast alternative to tools like Loom, with built-in AI transcription and enterprise-grade security.

Here is a look at the architecture, the tech stack, and the features I implemented.

The Tech Stack

Next.js

PostgreSQL

TypeScript

Tailwind CSS

To ensure the platform was highly scalable and secure from day one, I carefully selected a modern stack:

  • Next.js: The core React framework powering both the frontend UI and the server-side logic.
  • Bunny.net: This is the heavy lifter. Bunny provides a global video CDN, edge storage, automatic video encoding, adaptive streaming, and a highly customizable video player. It completely eliminated the headache of managing HLS streams and encoding pipelines manually.
  • Arcjet: A developer-first security layer that I integrated directly into the Next.js middleware. It handles strict rate-limiting, bot protection, and attack mitigation to ensure the video upload endpoints don't get abused by malicious traffic.
  • Better Auth: A brilliant TypeScript-first authentication library that made it trivial to add secure logins, multi-tenancy, and social sign-ins without relying on heavy external providers.
  • Drizzle ORM: Used for incredibly fast, type-safe SQL database queries to store video metadata, user profiles, and access logs.

Core Features Implemented

I wanted this platform to be a complete end-to-end solution for content creators and remote teams. Here is what it includes:

1. In-Browser Screen Recording

Users don't need to download any desktop applications. Using native browser Web APIs (MediaRecorder), users can select their screen, specific windows, or browser tabs, and start recording directly inside the web app.

2. Instant Video Uploads & Streaming

Once a recording finishes, the raw video is chunked and uploaded directly to Bunny.net's edge storage. Bunny automatically encodes the video into multiple resolutions for adaptive streaming, ensuring smooth playback even on slow connections.

3. Public vs. Private Access Controls

Privacy is critical for screen recordings. I implemented a robust permissions model where users can toggle videos between Public (anyone with the link can view) and Private (only the authenticated creator can view).

4. AI-Generated Transcripts

Video is great, but text is searchable. When a video is uploaded, the audio track is processed to generate a full transcript automatically. Users can read through the AI-generated transcript alongside the video player, making it incredibly easy to find specific moments in long recordings.

5. Link Sharing & Metadata Management

Every video generates a unique, secure URL that can be instantly copied and shared. The dashboard also exposes critical metadata for each video, including its unique ID, exact duration, upload timestamp, and direct CDN URLs.

6. Built-in Global Search

As users build up massive libraries of recordings, finding old videos becomes difficult. I implemented a fast, full-text search bar that allows users to instantly filter their videos based on titles or transcript contents.

Looking Back

This project was a fantastic exercise in integrating heavy third-party infrastructure (like Bunny.net's video CDN) directly into a modern Next.js architecture. The combination of Drizzle ORM for speed and Arcjet for security resulted in an application that feels both incredibly snappy and enterprise-grade.

If you are interested in diving into the code, feel free to check out the repository: screen-record-stream.