Node.js + TypeScript + FFmpeg + Docker

HLS Streaming Server

Production-grade live video platform with RTMP ingest, adaptive bitrate transcoding, real-time chat, viewer analytics, VOD recording, and a full monitoring stack.

6
Docker Services
4
ABR Quality Levels
25+
REST Endpoints
3
User Roles

System Architecture.

OBS / Encoder
RTMP Ingest
FFmpeg ABR
HLS Segments
Nginx CDN
Browser / Mobile
1

RTMP Ingest

Accepts RTMP streams on port 1935 with stream key authentication and lifecycle hooks.

2

FFmpeg Transcoding

Adaptive bitrate ladder: 1080p, 720p, 480p, 360p with configurable presets and codec options.

3

HLS Packaging

Master playlist with variant streams, 6-second segments, 10-segment sliding window.

4

Real-Time Chat

Socket.IO rooms per stream, message persistence, moderation (ban/mute/delete), slow mode.

5

Analytics Engine

Real-time viewer counts, peak/total viewers per session, stream health metrics (bitrate, FPS).

6

VOD Recording

Automatic stream archival to MP4, HLS VOD playlists, thumbnail sprite sheets via BullMQ jobs.

Key Features.

🎬

Adaptive Bitrate Streaming

FFmpeg transcodes to 4 quality levels with HLS master playlists. Viewers automatically switch quality based on bandwidth.

🔒

Authentication & Authorization

JWT access + refresh tokens, bcrypt password hashing, role-based access control (admin, streamer, viewer), stream key rotation.

💬

Live Chat System

Room-per-stream architecture via Socket.IO with message persistence, rate limiting, and full moderation tools.

📊

Analytics Dashboard

Real-time viewer counts, session history, stream health metrics, and server-wide statistics with React admin UI.

🎥

Video on Demand

Automatic stream archival, MP4 conversion, HLS VOD playlists, and thumbnail generation via background job queue.

🛡

Monitoring Stack

Prometheus metrics collection, Grafana dashboards, health check endpoints, and custom streaming gauges.

API Overview.

Module Endpoints Description
Authentication 5 Register, login, refresh, logout, current user
Streams 7 CRUD, stream key management, force stop
Chat 4 Messages, ban/unban, delete messages
Analytics 4 Stream summary, viewers, sessions, dashboard
VOD 4 List, details, delete, HLS manifest
Infrastructure 2 Health check, Prometheus metrics

Tech Stack.

Node.js 20 TypeScript 5 Express.js FFmpeg 6 Socket.IO Prisma 5 PostgreSQL 16 Redis 7 Docker Compose Nginx Prometheus Grafana Next.js 15 Redux Toolkit HLS.js BullMQ Zod Pino GitHub Actions

Infrastructure.

🐳

Docker Compose Stack

6-service orchestration: Node.js app, PostgreSQL, Redis, Nginx reverse proxy, Prometheus, and Grafana. One command to start everything.

🌐

Nginx Reverse Proxy

TLS termination, static HLS file serving, WebSocket proxying, and rate limiting at the edge.

CI/CD Pipeline

GitHub Actions workflows for automated linting, type checking, testing, and Docker image builds on every push.