A comprehensive multi-media streaming platform that allows users to stream music, movies, books, and live TV from torrents and IPTV sources - without downloading content until playback.
- π΅ Music Streaming - Stream FLAC, MP3, OGG, and more with full player controls
- π¬ Video Streaming - Watch videos with seeking, fullscreen, and picture-in-picture
- π Ebook Reader - Read PDFs and EPUBs with progress tracking
- π Deep Search - Search across file names, paths, and metadata
- β¬οΈ Download - Download individual files or entire torrents
- ποΈ Podcasts - Browse and stream podcasts with episode tracking
- πΊ Live TV - Stream from M3U playlists and Xtream Codes providers
- π EPG Guide - Electronic Program Guide for live channels
- π Multiple Providers - Manage multiple IPTV sources
- π IPTV Subscriptions - Premium IPTV access with subscription management
- β€οΈ Favorites - Save your favorite files for quick access
- π Collections - Create custom playlists and watchlists
- π Watch History - Track your viewing and reading progress
- π Progress Sync - Resume where you left off across devices
- π Watch Parties - Synchronized viewing with friends
- π¬ Real-time Chat - Chat while watching together
- π³ Crypto Payments - Pay with cryptocurrency via CoinPayPortal
- π¨βπ©βπ§βπ¦ Family Plans - Share with up to 10 family members
- πΊ IPTV Add-on - Premium live TV subscription
- π± PWA Support - Install as a native app on mobile and desktop
- π Dark Mode - Premium dark-mode-first design
- π Server-side Security - All sensitive operations server-side only
- β‘ Server-Side Rendering - Fast page loads with pre-fetched data
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
- Backend: Next.js API Routes (Server-side only)
- Database: Supabase (PostgreSQL with Full-Text Search)
- Torrent: WebTorrent (metadata-only fetching)
- Video: Video.js with HLS.js for M3U8 streaming
- Payments: CoinPayPortal (cryptocurrency)
- Testing: Vitest with TDD approach
- Deployment: DigitalOcean Droplet (with UDP support for DHT)
- Node.js v24+
- pnpm v9+
- Supabase account
git clone https://github.com/your-org/bittorrented.git
cd bittorrentedpnpm installcp .env.example .env.localEdit .env.local with your credentials:
# Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
SUPABASE_ANON_KEY=your-anon-key
# Metadata APIs
THETVDB_API_KEY=your-thetvdb-key
OMDB_API_KEY=your-omdb-key
# CoinPayPortal (for payments)
COINPAYPORTAL_MERCHANT_ID=your-merchant-id
COINPAYPORTAL_API_KEY=your-api-keypnpm devOpen http://localhost:3000 in your browser.
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm test |
Run tests in watch mode |
pnpm test:run |
Run tests once |
pnpm test:coverage |
Run tests with coverage |
pnpm lint |
Run ESLint |
pnpm typecheck |
Run TypeScript type checking |
bittorrented/
βββ src/
β βββ app/ # Next.js App Router
β β βββ api/ # API routes (server-side only)
β β β βββ library/ # Library API (favorites, collections, history)
β β β βββ iptv/ # IPTV API (channels, playlists, subscriptions)
β β β βββ auth/ # Authentication API
β β β βββ payments/ # Payment processing API
β β β βββ stream/ # Streaming API
β β βββ library/ # My Library page (server-rendered)
β β βββ live-tv/ # Live TV page
β β βββ podcasts/ # Podcasts page
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # React components
β β βββ layout/ # Layout components (sidebar, header)
β β βββ torrents/ # Torrent-related components
β β βββ live-tv/ # Live TV components (HLS player)
β β βββ media/ # Media player components
β β βββ ui/ # UI primitives
β βββ lib/ # Utility functions and services
β β βββ supabase/ # Supabase client (server-side only)
β β βββ library/ # Library repository (favorites, collections, history)
β β βββ iptv/ # IPTV services (M3U parser, playlist cache)
β β βββ iptv-proxy/ # IPTV proxy for HLS rewriting
β β βββ podcasts/ # Podcast services
β β βββ torrent/ # Torrent services
β β βββ streaming/ # Streaming services
β β βββ magnet/ # Magnet URL parsing
β β βββ payments/ # Payment processing
β β βββ indexer/ # File indexing
β βββ hooks/ # React hooks
β βββ types/ # TypeScript types
βββ public/ # Static assets
βββ supabase/ # Supabase migrations
βββ plans/ # Implementation plans
This project follows Test-Driven Development (TDD). Tests are written first, then implementation.
# Run tests in watch mode
pnpm test
# Run tests once
pnpm test:run
# Run tests with coverage
pnpm test:coverageWe use a DigitalOcean Droplet instead of App Platform because App Platform doesn't support UDP, which is required for DHT (Distributed Hash Table) peer discovery in BitTorrent.
Quick Start:
# 1. SSH into your Droplet
ssh root@YOUR_DROPLET_IP
# 2. Run the setup script
curl -fsSL https://raw.githubusercontent.com/profullstack/music-torrent/main/scripts/setup-droplet.sh | bash
# 3. Setup SSL
certbot --nginx -d yourdomain.com -d www.yourdomain.comWhat the setup script does:
- Installs Node.js 22, pnpm, FFmpeg, Nginx
- Clones the repository
- Creates a systemd service for auto-restart
- Configures Nginx as reverse proxy
GitHub Actions auto-deploy:
- Push to
mainbranch triggers automatic deployment - Required GitHub Secrets:
DROPLET_HOST- Droplet IP address or hostnameDROPLET_USER- SSH username (e.g.,ubuntu)DROPLET_SSH_KEY- Private SSH key for authenticationENV_FILE- Contents of.envfile for production
- Optional GitHub Secrets:
DROPLET_PORT- SSH port (defaults to22if not set)
See docs/deployment-droplet.md for detailed instructions.
- All Supabase calls are server-side only - No client-side database access
- Rate limiting - Prevents abuse of magnet ingestion and streaming
- Input validation - All user inputs are validated
- No content storage - Only metadata is stored, content is streamed on-demand
- Webhook verification - Payment webhooks are cryptographically verified
- Fork the repository
- Create a feature branch
- Write tests first (TDD)
- Implement the feature
- Ensure all tests pass
- Submit a pull request
MIT