arrow_back Back to Laboratory
Case File // NovaFlix

NovaFlix Architecture Docs.

A technical overview of the streaming engine, proxy servers, and Flutter architecture powering the NovaFlix media client.

shield_lock

Commitment to Code Integrity

We take immense pride in our engineering. However, to comply with strict safety guidelines, protect our intellectual property from malicious cloning, and secure our API integrations, the raw source code of NovaFlix remains closed-source.

We are, however, thrilled to share the architectural blueprint and advanced networking techniques that power the application below.

terminal Under the Hood

cloud_sync

TDLib Cloud Database

Instead of relying on expensive traditional backend servers (like AWS or Firebase), NovaFlix ingeniously utilizes the official Telegram API (via the C++ TDLib engine) as an infinite, encrypted cloud storage database. By authenticating users securely, the app indexes channels, files, and media metadata instantly without centralized server costs.

Dart FFI TDLib (C++) Telegram API
router

Local HTTP Proxy Engine

This is the core engineering masterpiece of NovaFlix. To achieve seamless video scrubbing without downloading entire files, the app spins up a pure memory-piped micro-server on 127.0.0.1:8080. This custom proxy intercepts media requests, handles precise Accept-Ranges: bytes headers, and dynamically streams sparse-file data chunks straight from TDLib to the video player in real-time.

HttpServer Byte-Range Streaming Sparse-File Detection
play_circle

Hardware-Accelerated Playback

Playback is powered by the highly performant media_kit engine (based on mpv), providing vast codec support natively. The UI is fully immersive with custom gesture controls for brightness and volume, PiP (Picture-in-Picture) triggered via native Android/iOS method channels, and integrated Google Cast support to push streams to Smart TVs.

MediaKit (MPV) MethodChannels Google Cast SDK
memory

Offline-First State Management

User data, watch history, last-loaded channels, and exact video resume positions are tracked locally using SharedPreferences. The app also features a robust Downloads Manager that handles background threading, allowing users to safely cancel streams, clear cache, or commit media to offline persistent storage.

SharedPreferences Async Threading Cache Management
speed

Debounced & Reactive UI

To prevent Telegram API rate-limiting, all search inputs are shielded behind Timer-based debouncers. The UI relies on highly efficient Flutter widgets like ListenableBuilder and AnimatedBuilder to react instantly to proxy network states, ensuring the UI thread is never blocked during heavy byte-streaming.

Flutter ListenableBuilder Debouncing