How coding-leaf/xray-panel works
Xray Decoupled Panel is a Go/Vue control plane for administering Xray nodes, users, routing, subscriptions, and operational health. Operators enter through the authenticated web console, configure policy and accounts through APIs, and the backend applies changes to SQLite and the running Xray engine; scheduled collection and subscription export provide operational results. The graph also preserves documented Reality checks, tickets, Telegram alerts, and host monitoring. Source evidence is partial, so unsampled capability links are documented or left out rather than inferred from filenames.
Main entry points: index.ts API client · router.go HTTP API · manager.go Xray manager · UsersView.vue User workflows
Components 25
Operator console
- Web console
web/src/App.vue - Routing editor
web/src/views/RoutingView.vue - User workflows
web/src/views/UsersView.vue - Inbound workflows
web/src/views/InboundsView.vue - API client
web/src/api/index.ts - Dashboard views
web/src/views/DashboardView.vue - Geodata management
web/src/views/RoutingView.vue - Subscription assembly
web/src/views/users/services/subscription.ts
HTTP and services
- HTTP API
internal/delivery/http/router.go - Authentication
internal/service/auth_service.go - User management
internal/service/user_service.go - Subscription service
internal/service/sub_service.go - Protocol conversion
internal/protocol/node_converter.go - Subscription export
internal/sub/exporter.go - Configuration service
internal/service/config_service.go - Credential tickets
internal/service/ticket_service.go
Xray control
- Xray manager
internal/adapter/xray/manager.go - Xray gRPC client
internal/adapter/xray/grpc_client.go - Config parser
internal/adapter/xray/config_parser.go
State and operations
- SQLite repositories
internal/adapter/repository/sqlite_db.go - Traffic collection
internal/delivery/cron/traffic_sync.go - Host monitoring
internal/adapter/monitor/gopsutil_monitor.go - Reality inspection
internal/service/reality_monitor_service.go - Telegram operations
internal/adapter/telegram/bot.go
Other components
- Operator
Connections 22
- Operator → Web console: operates
- Web console → API client: requests data
web/src/App.vue - Routing editor → API client: saves policy
web/src/views/RoutingView.vue - User workflows → API client: manages users
- Inbound workflows → API client: loads nodes
- API client → HTTP API: HTTP requests
web/src/api/index.ts - HTTP API → Authentication: authenticates
- HTTP API → User management: dispatches users
- HTTP API → Configuration service: dispatches config
- User workflows → Subscription assembly: assembles shares
- Subscription service → Protocol conversion: converts nodes
- Subscription service → Subscription export: exports formats
- Configuration service → Xray manager: applies config
- Xray manager → Xray gRPC client: controls engine
- Config parser → Xray manager: parses config
- User management → SQLite repositories: persists users
- Traffic collection → Xray gRPC client: polls statistics
- Traffic collection → SQLite repositories: stores traffic
- Dashboard views → API client: requests metrics
- Reality inspection → Telegram operations: sends alerts
- Geodata management → API client: updates data
web/src/views/RoutingView.vue - Credential tickets → HTTP API: serves claims