Skip to content

magnitopic/hypertube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hypertube 📺

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.

Screenshot 2025-07-16 at 19-37-18 Hypertube

Features 🌟

🎥 Streaming & 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

🔐 Authentication & Security

  • 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

💬 Social Features

  • Movie commenting system
  • User profiles with customizable avatars and bios
  • Watch history tracking on your movie library
  • Community interaction through comments and likes

🎯 Smart Movie Discovery

  • 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

🛠️ Infrastructure & DevOps

  • Containerized deployment with Docker Compose
  • Automated movie cleanup with cron jobs (removes old downloads)
  • Database migrations and fixtures
  • Development and production environments

Tech Stack 🚀

Frontend

  • React 18 with TypeScript
  • Vite for fast development and building
  • Tailwind CSS for modern, responsive styling
  • React Router DOM for client-side routing

Backend

  • 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) 🌐

Custom Torrent Client

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

Team work 💪

This project was a team effort. You can checkout the team members here:

Run project

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

make

Once the project is running you can access the web page at localhost:3000 and the API at localhost:3001/api/v1/.

API

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/

Mandatory

POST /oauth/token
Expects client + secret, returns an auth token

GET /users
returns a list of users with their id and their username

GET /users/:id
returns username, email address, profile picture URL

PATCH /users/:id
Expected data : username, email, password, profile picture URL

GET /movies
returns the list of movies available on the frontpage, with their id and their name

GET /movies/:id
returns a movie’s name, id, IMDb (OMDb or TMDb for free API) mark, production year, length, available subtitles, number of comments

GET /comments
returns a list of latest comments which includes comment’s author username, date, content, and id.

GET /comments/:id
returns comment, author’s username, comment id, date posted

PATCH /comments/:id
Expected data : comment, username

DELETE /comments/:id

POST /comments /movies/:movie_id/comments
Expected data: comment, movie_id. Rest is filled by the server

Bonus

Authentication

GET /auth/status
returns authentication status of the current user

POST /auth/login
Expected data: username, password. Returns authentication token

POST /auth/register
Expected data: username, email, password, firstName, lastName. Creates new user account

POST /auth/logout
logs out the current user

POST /auth/password/change
Expected data: oldPassword, newPassword. Changes user password

Movie Features

GET /movies/genres
returns list of available movie genres

GET /movies/random
returns a random movie

GET /movies/:id/subtitles
returns available subtitles for a movie

GET /movies/search/:page?
returns paginated search results for movies

POST /movies/:id/watched
marks movie as watched or updates watch progress

POST /movies/:id/like
toggles like status for a movie

Project Gallery

hypertube_subtitles

watching movie with subtitles


Screenshot 2025-07-16 at 19-36-33 Hypertube

comments and movies information


Screenshot 2025-07-16 at 19-40-09 Hypertube

user profile


Screenshot 2025-07-16 at 19-37-18 Hypertube

movie library


Screenshot 2025-07-16 at 19-37-50 Hypertube

library search and sorting