# StreamFlow IPTV - Quick Reference ## πŸš€ Quick Start Commands ```bash # Start the application ./start.sh # or docker-compose up -d # Stop the application ./stop.sh # or docker-compose down # View logs docker-compose logs -f # Restart docker-compose restart # Rebuild docker-compose build --no-cache ``` ## 🌐 URLs - **Application**: http://localhost:12345 - **Health Check**: http://localhost:12345/api/health - **API Base**: http://localhost:12345/api ## πŸ”‘ Default Configuration | Setting | Value | |---------|-------| | Port | 12345 | | Database | SQLite (/app/data/streamflow.db) | | User | appuser (UID 1001) | | Max Upload | 50MB | | JWT Expiry | 7 days | ## πŸ“‘ API Endpoints ### Authentication ``` POST /api/auth/register # Register new user POST /api/auth/login # Login GET /api/auth/verify # Verify token ``` ### Playlists ``` GET /api/playlists # List playlists POST /api/playlists/url # Add from URL POST /api/playlists/upload # Upload M3U DELETE /api/playlists/:id # Delete PATCH /api/playlists/:id # Rename POST /api/playlists/bulk-delete # Bulk delete ``` ### Channels ``` GET /api/channels # List channels GET /api/channels/groups # List groups ``` ## πŸ”§ Environment Variables ```bash # Required PORT=12345 JWT_SECRET=your_secret_here SESSION_SECRET=your_secret_here # Optional NODE_ENV=production MAX_RECORDING_SIZE=10GB EPG_UPDATE_INTERVAL=3600000 LOG_LEVEL=info ``` ## 🐳 Docker Commands ```bash # Build docker-compose build # Start (detached) docker-compose up -d # Start (foreground) docker-compose up # Stop docker-compose down # Stop and remove volumes docker-compose down -v # View logs docker-compose logs -f streamflow # Execute command in container docker-compose exec streamflow sh # List running containers docker-compose ps # Restart specific service docker-compose restart streamflow ``` ## πŸ“¦ NPM Scripts ```bash # Root scripts npm start # Start application npm run install:all # Install all dependencies npm run docker:build # Build Docker image npm run docker:up # Start containers npm run docker:down # Stop containers npm run docker:logs # View logs # Backend scripts (cd backend) npm install # Install dependencies npm start # Start server npm run dev # Start with nodemon # Frontend scripts (cd frontend) npm install # Install dependencies npm run dev # Start dev server (port 3000) npm run build # Build for production npm run preview # Preview production build ``` ## πŸ—ƒοΈ Database Tables - `users` - User accounts - `profiles` - User profiles - `playlists` - M3U playlists - `channels` - TV channels - `custom_groups` - User groups - `group_channels` - Group assignments - `epg_data` - EPG information - `epg_sources` - EPG sources - `recordings` - Recording data - `watch_history` - View history - `favorites` - Favorite channels - `settings` - User settings - `api_tokens` - API tokens - `logo_cache` - Logo cache ## 🌍 Languages | Code | Language | Flag | |------|----------|------| | en | English | πŸ‡¬πŸ‡§ | | ro | RomΓ’nΔƒ | πŸ‡·πŸ‡΄ | ## 🎨 Theme - **Light Theme**: Default - **Dark Theme**: Toggle in Settings - **Auto-save**: Theme preference persisted ## πŸ“ File Locations ``` /app/data/ # Persistent data β”œβ”€β”€ streamflow.db # Database β”œβ”€β”€ playlists/ # Uploaded playlists β”œβ”€β”€ recordings/ # Recorded content β”œβ”€β”€ logos/ # Channel logos β”œβ”€β”€ epg/ # EPG cache └── uploads/ # User uploads /app/logs/ # Application logs β”œβ”€β”€ error.log # Error logs └── combined.log # All logs ``` ## πŸ”’ Security Features - βœ… Non-root container user (UID 1001) - βœ… JWT authentication (7-day expiry) - βœ… Bcrypt password hashing (10 rounds) - βœ… Rate limiting (5 login attempts/15min) - βœ… Helmet security headers - βœ… Input validation - βœ… CORS protection - βœ… No privilege escalation - βœ… Capability dropping - βœ… Health checks ## πŸ› Troubleshooting ### Container won't start ```bash docker-compose logs ``` ### Port already in use ```bash # Edit docker-compose.yml, change: ports: - "8080:12345" # Change 8080 to free port ``` ### Permission denied ```bash # Fix permissions sudo chown -R 1001:1001 ./data ./logs ``` ### Reset database ```bash # WARNING: Deletes all data docker-compose down -v docker-compose up -d ``` ### Can't connect ```bash # Check if running docker-compose ps # Check logs docker-compose logs -f # Test health curl http://localhost:12345/api/health ``` ## πŸ“Š Monitoring ```bash # View container stats docker stats streamflow-app # Check health status docker inspect --format='{{.State.Health.Status}}' streamflow-app # View recent logs docker-compose logs --tail=100 streamflow ``` ## πŸ”„ Backup & Restore ### Backup ```bash # Backup data volume docker run --rm \ -v streamflow-data:/data \ -v $(pwd)/backup:/backup \ alpine tar czf /backup/backup-$(date +%Y%m%d).tar.gz /data ``` ### Restore ```bash # Restore data volume docker run --rm \ -v streamflow-data:/data \ -v $(pwd)/backup:/backup \ alpine tar xzf /backup/backup-YYYYMMDD.tar.gz -C / ``` ## 🎯 Features Quick Access | Feature | Page/Location | |---------|---------------| | Watch Live TV | Dashboard β†’ Live TV | | Listen Radio | Dashboard β†’ Radio | | Add Playlist | Settings or Sidebar | | Schedule Recording | Channel β†’ Record button | | Change Theme | Settings β†’ Theme toggle | | Change Language | Settings β†’ Language dropdown | | View Favorites | Dashboard β†’ Favorites | | Manage Profiles | Settings β†’ Profiles | ## πŸ“± Supported Features - βœ… Live TV streaming - βœ… Radio streaming - βœ… EPG (Electronic Program Guide) - βœ… Recording (scheduled & manual) - βœ… Picture-in-Picture (PiP) - βœ… Multi-device sync - βœ… User profiles - βœ… Favorites - βœ… Custom groups - βœ… Watch history - βœ… Multi-language (EN/RO) - βœ… Light/Dark themes - βœ… Responsive design ## πŸ”— Useful Links - Project root: `/home/iulian/projects/tv` - Documentation: `README.md`, `SETUP.md`, `ARCHITECTURE.md` - Issue tracker: Contact development team - Health check: http://localhost:12345/api/health --- **Version**: 1.0.0 **Last Updated**: December 2025