A full-featured movie and TV show streaming platform built with Next.js 14, featuring multiple video sources, live TV, comprehensive analytics, and flexible deployment options.
- Browse trending movies and TV shows
- Advanced search with filters
- Detailed movie/show information with cast, ratings, and trailers
- Episode-by-episode navigation for TV series
- Continue watching functionality
- Multiple video source providers (2embed, VidSrc, and more)
- Adaptive HLS streaming with quality selection
- Live TV support with DLHD integration
- IPTV/Stalker portal support
- Resume playback from where you left off
- Comprehensive admin dashboard
- Real-time live activity monitoring
- Watch session tracking with completion rates
- User analytics (DAU/WAU/MAU metrics)
- Device and quality breakdowns
- Geographic distribution insights
- Anonymous user tracking (no PII collected)
- IP address hashing
- Local storage for user preferences
- GDPR-compliant data collection
| Category | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| Database | Neon PostgreSQL (prod) / SQLite (dev) |
| Deployment | Vercel |
| Proxy | Cloudflare Workers |
| API | TMDB |
- Node.js 18+ or Bun
- TMDB API key (get one here)
- Neon database (for production)
# Clone the repository
git clone https://github.com/yourusername/flyx.git
cd flyx
# Install dependencies
npm install
# or
bun install
# Copy environment file
cp .env.example .env.local
# Add your TMDB API key to .env.local
# TMDB_API_KEY=your_bearer_token
# NEXT_PUBLIC_TMDB_API_KEY=your_api_key
# Start development server
npm run devOpen http://localhost:3000 to view the app.
| Variable | Description |
|---|---|
TMDB_API_KEY |
TMDB Bearer token (Read Access Token) |
NEXT_PUBLIC_TMDB_API_KEY |
TMDB API key (for client-side) |
DATABASE_URL |
Neon PostgreSQL connection string (production) |
| Variable | Description |
|---|---|
IP_SALT |
Salt for IP address hashing (privacy) |
CRON_SECRET |
Secret for automated metrics updates |
NEXT_PUBLIC_CF_STREAM_PROXY_URL |
Cloudflare stream proxy URL |
NEXT_PUBLIC_CF_TV_PROXY_URL |
Cloudflare TV proxy URL |
RPI_PROXY_URL |
Raspberry Pi proxy URL |
RPI_PROXY_KEY |
Raspberry Pi proxy API key |
See .env.example for the complete list with descriptions.
-
Create Neon Database
- Sign up at neon.tech
- Create a new project
- Copy the connection string
-
Deploy to Vercel
- Import your repository to Vercel
- Add environment variables:
DATABASE_URL- Your Neon connection stringTMDB_API_KEY- Your TMDB Bearer tokenNEXT_PUBLIC_TMDB_API_KEY- Your TMDB API key
- Deploy!
-
Access Admin Panel
- Navigate to
/admin - Default credentials:
vynx/defaultPassword - Change the password immediately!
- Navigate to
π See QUICK_START_VERCEL.md for detailed instructions
Neon is a serverless PostgreSQL database perfect for Vercel deployments.
- Create account at neon.tech
- Create a new project
- Copy connection string (includes
?sslmode=require) - Add as
DATABASE_URLin Vercel
Features:
- Serverless & auto-scaling
- Connection pooling built-in
- Free tier available
- Automatic backups
π See NEON_SETUP.md for complete setup guide
For local development, the app automatically uses SQLite when DATABASE_URL is not set. No configuration needed!
Flyx supports multiple proxy configurations for different use cases.
The Cloudflare proxy handles HLS stream proxying and live TV with proper CORS headers.
cd cloudflare-proxy
# Install dependencies
npm install
# Configure wrangler.toml with your settings
# Deploy
npx wrangler deployFeatures:
- Stream proxy for HLS content
- Live TV proxy for DLHD
- Decoder sandbox for secure script execution
- Health monitoring endpoint
Environment Variables (after deployment):
NEXT_PUBLIC_CF_STREAM_PROXY_URL=https://media-proxy.your-subdomain.workers.dev/stream
NEXT_PUBLIC_CF_TV_PROXY_URL=https://media-proxy.your-subdomain.workers.devπ See cloudflare-proxy/README.md for detailed setup
For bypassing datacenter IP restrictions using a residential IP.
# Copy to your Pi
scp -r rpi-proxy [email protected]:~/
# SSH and run
ssh [email protected]
cd rpi-proxy
export API_KEY=$(openssl rand -hex 32)
node server.jsExpose to internet:
- Cloudflare Tunnel (recommended)
- ngrok
- Port forwarding
π See rpi-proxy/README.md for complete setup
For IPTV/Stalker portal streams that block datacenter IPs.
# Copy to VPS
scp -r hetzner-proxy root@your-vps:/opt/
# Install and run
ssh root@your-vps
cd /opt/hetzner-proxy
export API_KEY="your-secret-key"
node server.jsπ See hetzner-proxy/README.md for complete setup
Access the admin panel at /admin to manage your platform.
| Section | Description |
|---|---|
| Dashboard | Overview of platform statistics |
| Analytics | Watch sessions, completion rates, device breakdown |
| Live Activity | Real-time user monitoring |
| User Metrics | DAU/WAU/MAU, retention, growth rates |
- Username:
vynx - Password:
defaultPassword
# Create admin user
npm run admin:create <username> <password>
# Reset password
npm run admin:reset-password <username> <new-password>
# List admins
npm run admin:list
# Delete admin
npm run admin:delete <username>π See ADMIN_SETUP.md for complete admin guide
Flyx includes a comprehensive, privacy-focused analytics system.
- Content watched (title, type, season/episode)
- Watch time and completion percentage
- Pause/seek behavior
- Quality settings
- Device type
- Daily/Weekly/Monthly Active Users
- New vs returning users
- Retention rates
- Engagement metrics
- Real-time user count
- Current watching activity
- Geographic distribution
- Most watched content
π See these guides for more:
flyx/
βββ app/ # Next.js App Router
β βββ components/ # React components
β βββ context/ # React context providers
β βββ lib/ # Utilities and services
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API and analytics services
β βββ api/ # API routes
β βββ admin/ # Admin panel pages
βββ server/ # Server-side code
β βββ db/ # Database utilities
βββ cloudflare-proxy/ # Cloudflare Worker proxy
βββ rpi-proxy/ # Raspberry Pi proxy
βββ hetzner-proxy/ # Hetzner VPS proxy
βββ scripts/ # Utility scripts
βββ public/ # Static assets
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
npm test |
Run tests |
npm run type-check |
TypeScript type checking |
npm run db:init |
Initialize database |
npm run db:migrate |
Run database migrations |
npm run db:status |
Check migration status |
npm run verify-env |
Verify environment setup |
| Guide | Description |
|---|---|
| QUICK_START_VERCEL.md | 5-minute Vercel deployment |
| VERCEL_DEPLOYMENT.md | Complete Vercel guide |
| VERCEL_SETUP_CHECKLIST.md | Step-by-step checklist |
| NEON_SETUP.md | Neon PostgreSQL setup |
| ADMIN_SETUP.md | Admin panel configuration |
| ANALYTICS_TRACKING.md | Analytics system overview |
| ADMIN_ANALYTICS_GUIDE.md | Using the analytics dashboard |
| USER_ANALYTICS_GUIDE.md | User metrics guide |
| LIVE_ACTIVITY_GUIDE.md | Real-time monitoring |
| ANONYMIZED_USER_TRACKING.md | Privacy & tracking details |
The app uses TMDB for all movie and TV show metadata:
- Trending content
- Search functionality
- Movie/show details
- Cast and crew information
- Season and episode data
Getting a TMDB API Key:
- Create account at themoviedb.org
- Go to API settings
- Request an API key (Developer option)
- Copy both the API Key and Bearer Token
# Verify environment
npm run verify-env
# Check database status
npm run db:status
# Initialize database
npm run db:init- Ensure
DATABASE_URLis set in Vercel environment variables - Check that all three environments are selected (Production, Preview, Development)
- Redeploy after adding variables
- Check Cloudflare Worker is deployed
- Verify proxy URLs in environment variables
- Check browser console for CORS errors
- Test health endpoint:
curl https://your-proxy.workers.dev/health
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
IPTV - Huge thanks to MoldyTaint/Cinephage for his amazing help with sourcing IPTV!
- Movie & TV Data - TMDB (The Movie Database)
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter issues:
- Check the relevant documentation guide
- Review deployment logs
- Verify environment variables
- Open an issue on GitHub
Made with β€οΈ