A full-stack torrent streaming website that allows users to discover, watch, and engage with movies. Built with modern web technologies leveraging real-time capabilities, OAuth authentication, and intelligent media processing.
- Real-time torrent streaming with custom TorrentClient implementation
- Automatic video conversion to MP4 using FFmpeg for browser compatibility
- Progressive download with range requests for seamless playback
- Multi-language subtitle support (SRT, ASS, VTT) with automatic conversion
- Intelligent file detection prioritizing MP4 format for optimal streaming
- Multi-provider OAuth integration (Google, GitHub, Twitch, 42)
- JWT-based authentication with access and refresh tokens
- Email confirmation system with secure token validation
- Password reset functionality with time-limited tokens
- Session management with httpOnly cookies and CSRF protection
- Movie commenting system
- User profiles with customizable avatars and bios
- Watch history tracking on your movie library
- Community interaction through comments and likes
- Advanced search with filters (genre, year, rating, popularity)
- Automatic metadata fetching from TMDB API
- Genre-based categorization
- Pagination for efficient content loading
- Random movie button for surprise selections
- Containerized deployment with Docker Compose
- Automated movie cleanup with cron jobs (removes old downloads)
- Database migrations and fixtures
- Development and production environments
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for modern, responsive styling
- React Router DOM for client-side routing
- Node.js with Express.js
- PostgreSQL for data storage
- FFmpeg for video/subtitle processing
- Custom TorrentClient for streaming implementation
Each service of the project runs in it's own Docker container with docker-compose in three isolated containers:
- NodeJS (API and backend) ⚙️
- Postgres (database) 🗄️
- React - Vite (frontend) 🌐
The application features a sophisticated torrent streaming system that:
- Downloads and parses torrent files using bencode
- Utilizes web seeds for HTTP-based streaming
- Implements progressive downloading with range requests
- Converts different video formats to MP4 on-the-fly
- Manages concurrent downloads and streaming efficiently
This project was a team effort. You can checkout the team members here:
Using docker-compose you can run the project with the following setup:
git clone https://github.com/magnitopic/hypertube.git
cd hypertube
cp .example.env .env
#Enter values for the variables in the .env file
vim .env
makeOnce the project is running you can access the web page at localhost:3000 and the API at localhost:3001/api/v1/.
The REST API for this project allows users to interact with the application using HTTP requests. It enables all the same operations as the web interface, such as managing user profiles, gathering movie information, and comment management as well as BONUS endpoints.
NOTE: All endpoints follow the base route of
/api/v1/
/oauth/token
Expects client + secret, returns an auth token
/users
returns a list of users with their id and their username
/users/:id
returns username, email address, profile picture URL
/users/:id
Expected data : username, email, password, profile picture URL
/movies
returns the list of movies available on the frontpage, with their id and their name
/movies/:id
returns a movie’s name, id, IMDb (OMDb or TMDb for free API) mark, production year, length, available subtitles, number of comments
/comments
returns a list of latest comments which includes comment’s author username, date, content, and id.
/comments/:id
returns comment, author’s username, comment id, date posted
/comments/:id
Expected data : comment, username
/comments /movies/:movie_id/comments
Expected data: comment, movie_id. Rest is filled by the server
/auth/status
returns authentication status of the current user
/auth/login
Expected data: username, password. Returns authentication token
/auth/register
Expected data: username, email, password, firstName, lastName. Creates new user account
/auth/logout
logs out the current user
/auth/password/change
Expected data: oldPassword, newPassword. Changes user password
/movies/genres
returns list of available movie genres
/movies/random
returns a random movie
/movies/:id/subtitles
returns available subtitles for a movie
/movies/search/:page?
returns paginated search results for movies
/movies/:id/watched
marks movie as watched or updates watch progress
/movies/:id/like
toggles like status for a movie
watching movie with subtitles
comments and movies information
user profile
movie library
library search and sorting