How youzspace/3xui-hub works
ControlHub is a Laravel-based subscription-management hub for 3x-ui/Xray nodes, users, plans, and payments. Users authenticate, choose a plan, pay, and receive subscription access; administrators manage users, nodes, settings, and backups. Node agents register, fetch rendered Xray configuration, report status and traffic, and receive commands. Scheduled jobs synchronize usage and enforce limits. The graph combines documented capabilities with relationships visible in the supplied excerpts and SOURCE INDEX; unsampled feature implementations are represented by their exact enclosing directories.
Main entry points: Admin Admin features · NodeApiController.php Xray agent API · NodeDriverFactory.php Node driver factory · TrafficSyncService.php Traffic synchronization
Components 24
API and Administration
- User and node API
backend/routes/api.php - Admin API
backend/routes/web.php - Authentication
backend/app/Http/Controllers/Api/AuthController.php - Admin features
backend/app/Http/Controllers/Admin
Accounts and Commerce
- User features
backend/app/Http/Controllers/Api - Subscriptions
backend/app/Services/SubscriptionService.php - Payments and orders
backend/app/Services/PaymentService.php - User provisioning
backend/app/Services/UserAdminService.php
Node Management
- Node administration
backend/app/Http/Controllers/Admin/NodeController.php - Node driver factory
backend/app/Drivers/NodeDriverFactory.php - 3x-ui client
backend/app/Services/ThreeXUi/ThreeXUiClient.php - Xray agent API
backend/app/Http/Controllers/Api/NodeApiController.php - Xray configuration
backend/app/Drivers/Xray/XrayConfigService.php
Automation and Messaging
- Traffic synchronization
backend/app/Services/TrafficSyncService.php - Limit enforcement
backend/app/Services/BanService.php - Queue and scheduled jobs
backend/app/Jobs - Database backup
backend/app/Http/Controllers/Admin/BackupController.php
Persistent State
- Users and plans
backend/app/Models/User.php - Node configuration
backend/app/Models/Node.php - Site settings
backend/app/Models/SiteConfig.php - Orders
backend/app/Models/Order.php
Other components
- User
- Administrator
- Node agent
Connections 29
- User → User and node API: uses
README.md - Administrator → Admin API: manages
README.md - User and node API → Authentication: routes to
backend/routes/api.php - User and node API → User features: routes to
backend/routes/api.php - Admin API → Admin features: routes to
backend/routes/web.php - Authentication → Users and plans: authenticates
backend/app/Http/Controllers/Api/AuthController.php - User features → Subscriptions: serves subscriptions
- User features → Payments and orders: creates orders
backend/app/Http/Controllers/Api/PaymentController.php - Payments and orders → Orders: records orders
backend/app/Services/PaymentService.php - Payments and orders → User: integrates gateway
README.md - Admin features → Node administration: manages nodes
backend/routes/web.php - Node administration → Node driver factory: selects driver
backend/app/Http/Controllers/Admin/NodeController.php - Node driver factory → 3x-ui client: creates client
backend/app/Drivers/NodeDriverFactory.php - Node driver factory → Node configuration: reads node type
backend/app/Drivers/NodeDriverFactory.php - Node agent → Xray agent API: registers and reports
README.md - Xray agent API → Xray configuration: renders config
backend/app/Http/Controllers/Api/NodeApiController.php - Xray agent API → Traffic synchronization: submits usage
backend/app/Http/Controllers/Api/NodeApiController.php - Xray agent API → Node configuration: updates node
backend/app/Http/Controllers/Api/NodeApiController.php - Traffic synchronization → Users and plans: updates usage
backend/app/Services/TrafficSyncService.php - Traffic synchronization → Node configuration: reads node usage
backend/app/Services/TrafficSyncService.php - Queue and scheduled jobs → Traffic synchronization: runs sync
- Queue and scheduled jobs → Limit enforcement: checks limits
- Limit enforcement → Users and plans: enforces limits
- User provisioning → Node driver factory: provisions clients
backend/app/Services/UserAdminService.php - User provisioning → Users and plans: updates accounts
backend/app/Services/UserAdminService.php - Admin features → Database backup: offers backup
README.md - Database backup → Site settings: backs up data
- Admin features → Site settings: configures site
backend/app/Http/Controllers/Admin/NodeController.php - Admin features → Orders: reviews orders