Streamlet is a modern, scalable video streaming platform built from the ground up using a microservices architecture. It efficiently handles the entire video lifecycle—from upload and multi-resolution transcoding to on-demand, high-performance streaming.
Frontend (Nextjs and tailwind CSS) : https://github.com/rahulkbharti/streamlet-frontend.git
Streamlet consists of three core, decoupled microservices that communicate via a job queue. This design ensures each part of the system can be scaled, updated, and maintained independently.
Workflow:
- Upload: Client requests an upload URL from the API Service.
- Storage: Video is uploaded directly to cloud storage (e.g., Azure Storage Blob).
- Processing Job: API Service adds a new transcoding job to the BULLMQ queue.
- Transcoding: Transcoder Service picks up the job, downloads the video, transcodes it into multiple formats (1080p, 720p, 480p), and uploads processed chunks back to storage.
- Streaming: Content Service delivers the appropriate video chunks to the client for smooth playback.
- Role: Central gateway to the platform.
- Responsibilities:
- Manages client interactions
- User authentication
- Handles video metadata (PostgreSQL & MongoDB)
- Orchestrates upload process
- Adds jobs to transcoding queue
- Technologies: Node.js, Express, PostgreSQL, MongoDB, Socket.io
- Role: Dedicated background worker for video processing.
- Responsibilities:
- Listens for new jobs from BULLMQ
- Downloads source video
- Transcodes using FFmpeg
- Uploads processed chunks to storage
- Technologies: Node.js, BULLMQ, FFmpeg, Redis
- Role: High-performance delivery engine.
- Responsibilities:
- Delivers video chunks (HLS) and images previews to clients
- Technologies: Node.js, NGINX (optional for caching/proxying. Also can be contected with CDN)
- Backend: Node.js
- Databases: PostgreSQL (relational), MongoDB (document)
- Job Queue: BULLMQ with Redis
- Real-time Communication: Socket.io
- Storage: Azure Storage Blob
- Containerization: Docker and Docker Compose
- Microservices Architecture: Scalability, fault tolerance, maintainability
- Asynchronous Video Processing: Non-blocking transcoding
- Multi-Resolution Streaming: Adaptive Bitrate Streaming
- Real-time Upload Progress: Live updates via Socket.io
- Decoupled Components: Independent development and deployment
Follow these steps to set up the project locally:
git clone https://github.com/rahukbharti/streamlet-microservices.git
cd streamlet-microservices
# Make Sure that You have create the environment files for each service
docker-compose up -d # Or Run each service individually- Set up environment variables (add
.env.developmentand.env.productionfiles in each service folder) - Start each service (API, Transcoder, Content) as described in their respective folders
