# Match Live TV Piattaforma mobile-first per streaming di partite sportive giovanili — MVP su **Match Live TV** (HLS sul nostro sito); YouTube/Facebook/Twitch come integrazioni premium. **Slogan:** *Lo streaming che non muore* ## Struttura monorepo ``` ├── backend/ # Rails 7.2 API + Action Cable + Sidekiq ├── mobile/ # Flutter app (Camera + Regia) ├── infra/ # Docker Compose, MediaMTX, Nginx, Kamal └── docs/ # Documentazione ``` ## Deploy produzione (server 192.168.1.146) Vedi [docs/infrastructure/SERVER_DEPLOYMENT.md](docs/infrastructure/SERVER_DEPLOYMENT.md) per porte router, NPM e procedura completa. **Porte da aprire sul router:** `1935/TCP` (RTMP). Opzionale `8888/TCP` (HLS). HTTPS via Nginx Proxy Manager verso `http://192.168.1.146:3000`. **Sul server (una tantum, con sudo):** ```bash sudo bash ~/matchlivetv/scripts/deploy/server_bootstrap.sh bash ~/matchlivetv/scripts/deploy/post_bootstrap_deploy.sh ``` ## Avvio rapido (locale) ```bash cd infra cp .env.example .env docker compose up -d --build ``` - API Rails: http://localhost:3000 - MediaMTX RTMP: rtmp://localhost:1935 - MediaMTX API: http://localhost:9997 - Admin: http://localhost:3000/admin ### Seed utente demo ``` email: coach@matchlivetv.test password: password123 ``` ## Mobile ```bash cd mobile flutter pub get flutter run ``` Configura `API_BASE_URL` in `lib/core/config.dart` (default `http://10.0.2.2:3000` per emulatore Android). ## Architettura - Video (MVP): Phone → MediaMTX (RTMP) → HLS su `matchlivetv.*` (pagina `/live/:session_id`) - Video (premium): stesso ingest + relay ffmpeg verso YouTube - Controllo: Phone ↔ Action Cable ↔ Rails ↔ PostgreSQL - Disconnessioni: MediaMTX `alwaysAvailable` slate + timeout 5 min (Sidekiq) ### Mobile produzione ```bash ./scripts/run_mobile_android_prod.sh # API: https://www.matchlivetv.it ```