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:
# SupabaseSUPABASE_URL=https://your-project.supabase.coSUPABASE_SERVICE_ROLE_KEY=your-service-role-keySUPABASE_ANON_KEY=your-anon-key# Metadata APIsTHETVDB_API_KEY=your-thetvdb-keyOMDB_API_KEY=your-omdb-key# CoinPayPortal (for payments)COINPAYPORTAL_MERCHANT_ID=your-merchant-idCOINPAYPORTAL_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