How kananinirav/indian-iptv-app works
This repo is a Flutter-based IPTV client packaged primarily for Android (mobile + Android TV) (with a web/ target present). The app is essentially a simple M3U/streaming player:
• Displays a catalog of 500+ channels
• Supports search
• Plays a selected channel in full screen
From the tree, the “architecture” is mostly client-side (no backend service in this repo). The critical system interactions are app ⇄ channel list source ⇄ streaming servers/CDNs.
Flutter / Dart application (primary)
• lib/main.dart
App entry point: routes, app bootstrap, dependency wiring.
• lib/screens/home.dart
Channel listing/search UI (likely list/grid; TV vs mobile behavior may be conditional).
• lib/screens/player.dart
Player UI + playback lifecycle.
• lib/provider/channels_provider.dart
State management / orchestration (likely Provider pattern): fetch/parse channels, store list, search filter, selection.
• lib/model/channel.dart
Data model for a channel (name, logo, stream URL, group/category, etc.).
• assets/, assets/images, images/
Static assets (logos, screenshots).
Platform packaging / host shells
• android/…
Android host app, Gradle config, MainActivity.kt (Flutter activity), manifests for debug/profile/main.
• web/index.html, web/manifest.json
Web host shell (if supported).
External dependencies (not in tree but implied)
• Channel source / playlist (README credits an external repo; likely consumed as an M3U or JSON derived from it)
• Streaming endpoints (each channel URL points to a remote stream origin/CDN)
• Flutter plugins (e.g., video_player / better_player / chewie or similar—confirm via pubspec.yaml when drawing final tech labels)
User launches app
• main.dart initializes Flutter app + Provider(s)
Channel catalog loads
• ChannelsProvider fetches playlist/channel metadata (remote or bundled—verify implementation)
• Parses into Channel models
• Exposes List<Channel> to UI
Browse/search
• HomeScreen observes provider state
• Search input triggers provider filtering
Select channel
• UI navigates to PlayerScreen with selected Channel
Playback
• PlayerScreen initializes player plugin with channel.streamUrl
• Player connects to external streaming server
• Fullscreen/orientation handling is in player screen + platform shell
• HomeScreen → ChannelsProvider (read state, invoke search/load)
• ChannelsProvider → Channel Source (HTTP) (fetch playlist/metadata)
• ChannelsProvider → Channel model (parse/map)
• HomeScreen → PlayerScreen (navigation + selected channel)
• PlayerScreen → Video Player Plugin → Stream Origin/CDN (media streaming)
• Optionally: Flutter App → Android Shell (for TV/mobile specifics, intents, lifecycle)
Architectural pattern to highlight (how to explain structure)
This project is best shown as a layered client architecture:
• Presentation layer: screens/ (home + player)
• State/Controller layer: provider/ (ChannelsProvider)
• Domain model layer: model/ (Channel)
• Infrastructure:
• Network fetch/parsing inside provider (or helper—if present in code)
• Player plugin integration inside player screen
• Platform shells (android/, web/) for packaging and runtime hosting
Call out that there’s no backend in-repo; the “system” includes external playlist and stream providers.
Goal: Show what the app is and who/what it talks to.
• User (Mobile user / Android TV user)
• IPTV Flutter App
• Streaming Servers/CDNs (multiple channel origins)
• User ↔ App (browse/search/play)
• App → Channel List Source (download playlist/metadata)
• App → Streaming Servers (HLS/DASH/etc streaming)
Goal: Break “IPTV Flutter App” into major deployable/runtime containers.
Containers here are:
• Flutter UI + State (Dart runtime)
• Android Host (Kotlin/Gradle; APK packaging) and optionally Web Host (index.html/manifest)
Inside “Flutter UI + State”, show:
• Home UI
• Player UI
• Channels Provider (state)
• Channel Model
Also add:
• Video Playback Plugin (as a dependency container bridging to platform decoders)
• HTTP client (built-in dart:io/http package—confirm via pubspec)
• Home UI ↔ Provider
• Provider → Channel Source
• Player UI → Video Plugin → Streaming Servers
• Flutter runtime ↔ Android host (lifecycle, fullscreen, TV input, etc.)
Components (label with exact filenames):
• main.dart (bootstrap, routing, provider registration)
• screens/home.dart (channel list + search + select)
• provider/channels_provider.dart (load/parse/filter channels)
• model/channel.dart (DTO/model)
• screens/player.dart (player initialization, fullscreen controls)
• channels_provider.dart outputs:
• allChannels
• filteredChannels (search results)
• selectedChannel (if stateful)
• home.dart consumes filtered list, emits “channelSelected(channel)”
• player.dart consumes selected channel URL, invokes playback plugin
Make it “very detailed” without overthinking: split into more components
Because the repo is small, detail comes from explicitly splitting responsibilities:
• Separate “Channel Catalog Fetch” vs “Playlist Parsing” vs “Search Filter”
• Even if in one file, show them as sub-components within ChannelsProvider
• Separate “Player UI Controls” vs “Player Engine/Plugin”
• Separate “Assets (logos)” vs “Remote logos” if applicable
• Image CDN/hosts (App → image hosts for thumbnails)