# vateron-media/xc_vm architecture

> Architecture diagram of the GitHub repository vateron-media/xc_vm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vateron-media/xc_vm
- Repository: https://github.com/vateron-media/xc_vm
- Video tour (about a minute): https://gitdiagram.com/vateron-media/xc_vm/video

## Overview

XC_VM is an IPTV panel for live and VOD delivery, subscriber and reseller management, EPG, and load balancing. The main user workflow is a player authenticating through the player API, having account and access checked, and receiving listings for playback; administrators manage streams and categories through panel controllers. Separate branches cover cluster coordination, background cache maintenance, device-facing Ministra portal features, and extensible modules. Relationships are limited to those shown by sampled source references or stated capabilities; several runtime integrations are unsampled, so their links are omitted.

Main entry points: [`src/Public/Controllers/Api/PlayerApiController.php`](https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/Api/PlayerApiController.php) (Player API), [`src/Public/Controllers/Admin/StreamReviewController.php`](https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/Admin/StreamReviewController.php) (Stream Review), [`src/Public/Controllers/PlayerV2/PlayerLoginController.php`](https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/PlayerV2/PlayerLoginController.php) (Player Login), [`src/Infrastructure/Database/DatabaseFactory.php`](https://github.com/vateron-media/xc_vm/blob/main/src/Infrastructure/Database/DatabaseFactory.php) (Database Wiring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Accounts"]
  node_playerapi["Player API"]
  node_login["Player Login"]
  node_activecode["Access Codes"]
  node_users["User Repository<br/>[UserRepository.php]"]
end

subgraph group_media["Media Operations"]
  node_admincontroller["Stream Review"]
  node_categories["Categories"]
  node_streams["Stream Services<br/>[StreamService.php]"]
  node_epg["EPG Services<br/>[EpgService.php]"]
  node_vod["VOD Services<br/>[MovieService.php]"]
end

subgraph group_cluster["Cluster and Delivery"]
  node_streamauth["Stream Authorization<br/>[StreamAuth.php]"]
  node_connections["Connection Tracking"]
  node_clusterlogic["Cluster Coordination"]
  node_clusteragent["Cluster Runtime<br/>[NodeRole.php]"]
end

subgraph group_platform["Application Platform"]
  node_bootstrap["Boot Pipeline<br/>[BootPipeline.php]"]
  node_settings["Settings"]
  node_cache["File Cache<br/>[FileCache.php]"]
  node_database[("Database<br/>[Database.php]")]
  node_databasefactory["Database Wiring"]
  node_cron["Cache Maintenance"]
  node_modules["Module Manager<br/>[ModuleManager.php]"]
end

subgraph group_clients["Player Clients"]
  node_ministra["Ministra Portal<br/>[PortalHandler.php]"]
end

node_viewer(("Viewer"))
node_admin(("Panel Admin"))

node_viewer -->|"requests access"| node_playerapi
node_playerapi -->|"checks access"| node_activecode
node_playerapi -->|"looks up users"| node_users
node_viewer -->|"logs in"| node_login
node_login -->|"checks access"| node_activecode
node_login -->|"looks up users"| node_users
node_admin -->|"reviews streams"| node_admincontroller
node_admincontroller -->|"uses categories"| node_categories
node_admincontroller -->|"uses streams"| node_streams
node_viewer -.->|"uses portal"| node_ministra
node_clusterlogic -->|"uses node roles"| node_clusteragent
node_connections -->|"resolves storage"| node_databasefactory
node_databasefactory -.->|"provides database"| node_database
node_cron -->|"maintains cache"| node_cache
node_cron -->|"reads settings"| node_settings
node_admincontroller -->|"updates records"| node_database
node_playerapi -->|"retrieves categories"| node_categories
node_modules -->|"uses database wiring"| node_databasefactory

click node_playerapi "https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/Api/PlayerApiController.php"
click node_login "https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/PlayerV2/PlayerLoginController.php"
click node_activecode "https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Line/ActiveCodeService.php"
click node_users "https://github.com/vateron-media/xc_vm/blob/main/src/Domain/User/UserRepository.php"
click node_admincontroller "https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/Admin/StreamReviewController.php"
click node_categories "https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Stream/CategoryService.php"
click node_streams "https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Stream/StreamService.php"
click node_epg "https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Epg/EpgService.php"
click node_vod "https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Vod/MovieService.php"
click node_ministra "https://github.com/vateron-media/xc_vm/blob/main/src/Ministra/PortalHandler.php"
click node_streamauth "https://github.com/vateron-media/xc_vm/blob/main/src/Streaming/Auth/StreamAuth.php"
click node_connections "https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Stream/ConnectionTracker.php"
click node_clusteragent "https://github.com/vateron-media/xc_vm/blob/main/src/Core/Cluster/NodeRole.php"
click node_bootstrap "https://github.com/vateron-media/xc_vm/blob/main/src/Core/Bootstrap/BootPipeline.php"
click node_settings "https://github.com/vateron-media/xc_vm/blob/main/src/Core/Config/SettingsManager.php"
click node_cache "https://github.com/vateron-media/xc_vm/blob/main/src/Core/Cache/FileCache.php"
click node_database "https://github.com/vateron-media/xc_vm/blob/main/src/Core/Database/Database.php"
click node_databasefactory "https://github.com/vateron-media/xc_vm/blob/main/src/Infrastructure/Database/DatabaseFactory.php"
click node_cron "https://github.com/vateron-media/xc_vm/blob/main/src/Cli/CronJobs/CacheEngineCronJob.php"
click node_modules "https://github.com/vateron-media/xc_vm/blob/main/src/Core/Module/ModuleManager.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_playerapi,node_login,node_activecode,node_users,node_viewer toneBlue
class node_admincontroller,node_categories,node_streams,node_epg,node_vod toneAmber
class node_streamauth,node_connections,node_clusterlogic,node_clusteragent toneMint
class node_bootstrap,node_settings,node_cache,node_database,node_databasefactory,node_cron,node_modules toneRose
class node_ministra,node_admin toneIndigo
```

## Components

### Access and Accounts

- [Player API](https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/Api/PlayerApiController.php): `src/Public/Controllers/Api/PlayerApiController.php`
- [Player Login](https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/PlayerV2/PlayerLoginController.php): `src/Public/Controllers/PlayerV2/PlayerLoginController.php`
- [Access Codes](https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Line/ActiveCodeService.php): `src/Domain/Line/ActiveCodeService.php`
- [User Repository](https://github.com/vateron-media/xc_vm/blob/main/src/Domain/User/UserRepository.php): `src/Domain/User/UserRepository.php`

### Media Operations

- [Stream Review](https://github.com/vateron-media/xc_vm/blob/main/src/Public/Controllers/Admin/StreamReviewController.php): `src/Public/Controllers/Admin/StreamReviewController.php`
- [Categories](https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Stream/CategoryService.php): `src/Domain/Stream/CategoryService.php`
- [Stream Services](https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Stream/StreamService.php): `src/Domain/Stream/StreamService.php`
- [EPG Services](https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Epg/EpgService.php): `src/Domain/Epg/EpgService.php`
- [VOD Services](https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Vod/MovieService.php): `src/Domain/Vod/MovieService.php`

### Cluster and Delivery

- [Stream Authorization](https://github.com/vateron-media/xc_vm/blob/main/src/Streaming/Auth/StreamAuth.php): `src/Streaming/Auth/StreamAuth.php`
- [Connection Tracking](https://github.com/vateron-media/xc_vm/blob/main/src/Domain/Stream/ConnectionTracker.php): `src/Domain/Stream/ConnectionTracker.php`
- **Cluster Coordination**
- [Cluster Runtime](https://github.com/vateron-media/xc_vm/blob/main/src/Core/Cluster/NodeRole.php): `src/Core/Cluster/NodeRole.php`

### Application Platform

- [Boot Pipeline](https://github.com/vateron-media/xc_vm/blob/main/src/Core/Bootstrap/BootPipeline.php): `src/Core/Bootstrap/BootPipeline.php`
- [Settings](https://github.com/vateron-media/xc_vm/blob/main/src/Core/Config/SettingsManager.php): `src/Core/Config/SettingsManager.php`
- [File Cache](https://github.com/vateron-media/xc_vm/blob/main/src/Core/Cache/FileCache.php): `src/Core/Cache/FileCache.php`
- [Database](https://github.com/vateron-media/xc_vm/blob/main/src/Core/Database/Database.php): `src/Core/Database/Database.php`
- [Database Wiring](https://github.com/vateron-media/xc_vm/blob/main/src/Infrastructure/Database/DatabaseFactory.php): `src/Infrastructure/Database/DatabaseFactory.php`
- [Cache Maintenance](https://github.com/vateron-media/xc_vm/blob/main/src/Cli/CronJobs/CacheEngineCronJob.php): `src/Cli/CronJobs/CacheEngineCronJob.php`
- [Module Manager](https://github.com/vateron-media/xc_vm/blob/main/src/Core/Module/ModuleManager.php): `src/Core/Module/ModuleManager.php`

### Player Clients

- [Ministra Portal](https://github.com/vateron-media/xc_vm/blob/main/src/Ministra/PortalHandler.php): `src/Ministra/PortalHandler.php`

### Other components

- **Viewer**
- **Panel Admin**

## Connections

- Viewer → Player API: requests access
- Player API → Access Codes: checks access (evidence: `src/Public/Controllers/Api/PlayerApiController.php`)
- Player API → User Repository: looks up users (evidence: `src/Public/Controllers/Api/PlayerApiController.php`)
- Viewer → Player Login: logs in
- Player Login → Access Codes: checks access (evidence: `src/Public/Controllers/PlayerV2/PlayerLoginController.php`)
- Player Login → User Repository: looks up users (evidence: `src/Public/Controllers/PlayerV2/PlayerLoginController.php`)
- Panel Admin → Stream Review: reviews streams
- Stream Review → Categories: uses categories (evidence: `src/Public/Controllers/Admin/StreamReviewController.php`)
- Stream Review → Stream Services: uses streams (evidence: `src/Public/Controllers/Admin/StreamReviewController.php`)
- Viewer → Ministra Portal: uses portal
- Cluster Coordination → Cluster Runtime: uses node roles
- Connection Tracking → Database Wiring: resolves storage (evidence: `src/Domain/Stream/ConnectionTracker.php`)
- Database Wiring → Database: provides database
- Cache Maintenance → File Cache: maintains cache (evidence: `src/Cli/CronJobs/CacheEngineCronJob.php`)
- Cache Maintenance → Settings: reads settings (evidence: `src/Cli/CronJobs/CacheEngineCronJob.php`)
- Stream Review → Database: updates records (evidence: `src/Public/Controllers/Admin/StreamReviewController.php`)
- Player API → Categories: retrieves categories (evidence: `src/Public/Controllers/Api/PlayerApiController.php`)
- Module Manager → Database Wiring: uses database wiring (evidence: `src/Core/Module/ModuleManager.php`)
