Overview
Lionz IPTV Downloader is a Laravel + React application built with Inertia.js that provides a web interface for downloading media content from Lionz.tv using aria2.Tech Stack
Backend
- PHP: 8.4+
- Laravel: 12.0
- Laravel Octane: High-performance application server
- Inertia.js: Server-driven single-page application framework
- Saloon: API client framework for HTTP integrations
- Spatie Laravel Data: Data transfer objects
- Laravel Scout + Meilisearch: Full-text search
- Pest: Testing framework
Frontend
- React: 19.1
- TypeScript: 5.8
- Vite: Build tool
- Tailwind CSS: 4.1
- Radix UI: Headless UI components
- Framer Motion: Animations
- Bun: JavaScript runtime and package manager
Tools & Services
- aria2: Download manager (external dependency)
- Laravel Telescope: Debugging assistant
- Laravel Pulse: Application monitoring
- Sentry: Error tracking
- Ziggy: Laravel routes for JavaScript
Directory Structure
Backend (app/)
Frontend (resources/)
Architecture Patterns
Action Pattern
The application uses single-purpose action classes with theAsAction trait for business logic:
app/Concerns/AsAction.php for the trait implementation.
API Integration with Saloon
External API integrations use the Saloon library for clean, testable HTTP clients:- Aria2 Integration (
app/Http/Integrations/Aria2/): JSON-RPC client for aria2 download manager - Lionz.tv Integration (
app/Http/Integrations/LionzTv/): Xtream Codes API client
- Connector class (base configuration)
- Request classes (individual endpoints)
- Response DTOs
- Authentication handlers
Data Transfer Objects
The application uses Spatie Laravel Data for type-safe DTOs throughout the codebase. All DTOs are inapp/Data/.
Inertia.js Architecture
The app follows Inertia.js conventions:- Controllers return Inertia responses
- React components in
resources/js/pages/map to routes - Shared data via
HandleInertiaRequestsmiddleware - Type-safe props using TypeScript
Queue System
Background processing uses Laravel queues:MonitorDownloads: Track download progress via aria2RefreshMediaContents: Sync media metadataRetryDownload: Retry failed downloads with backoffSyncCategories: Sync categories from provider- Auto-episode monitoring jobs
Auto-Episodes System
A dedicated subsystem for automatically downloading new series episodes:SeriesMonitormodel tracks series for new episodes- Scheduled scans check for new content
- Automatic download queuing with configurable schedules
- Event tracking and monitoring dashboard
Configuration
Key configuration areas:- Aria2 Config (
Aria2Configmodel): Download manager settings stored in database - Xtream Codes Config (
XtreamCodesConfigmodel): Provider credentials - Environment-based configs: Uses
LoadsFromEnvtrait for models
Routes
routes/web.php: Main application routesroutes/auth.php: Authentication routesroutes/settings.php: Settings/admin routesroutes/console.php: Artisan command scheduling
Key Models
| Model | Purpose |
|---|---|
VodStream | Movie/VOD content |
Series | TV series with episodes |
MediaDownloadRef | Download tracking and lifecycle |
Category | Content categorization |
Watchlist | User watchlist |
User | Application users |
SeriesMonitor | Auto-episode monitoring |
Aria2Config | Download manager configuration |
XtreamCodesConfig | IPTV provider credentials |
Development Server
The application includes a custom dev command that runs multiple services concurrently:- Laravel development server
- Queue worker
- Laravel Pail (log viewer)
- Vite dev server