How jaikewhh166/3x-ui works
3X-UI is a web control panel for configuring and monitoring Xray proxy servers, managing clients and subscriptions, and operating multi-node deployments. The main workflow runs from the panel UI through HTTP controllers and services to persistent state and Xray or remote-node runtimes; subscription requests also produce client-ready configuration formats. The README documents further capabilities including routing, outbound management, Telegram, Fail2ban, and API documentation. Some UI and backend links are documented only at product level; unsampled implementation details are not asserted.
Main entry points: api API client · controller.go Subscription routes · db.go Persistent storage · client_bulk.go Client operations
Components 21
Panel interface
- Management UI
frontend/src/pages - Routing editor
frontend/src/pages/xray/routing - Client management
frontend/src/pages/clients - API client
frontend/src/api
Web API
- Application entry
main.go - Web server
internal/web/controller/server.go - Client endpoints
internal/web/controller/client.go - Subscription routes
internal/sub/controller.go
Management services
- Client operations
internal/web/service/client_bulk.go - Panel operations
internal/web/service/server.go - Persistent storage
internal/database/db.go - Telegram bot
internal/web/service/tgbot
Proxy runtimes
- Xray core
internal/xray - Node runtime dispatch
internal/web/runtime/manager.go - MTProto sidecar
internal/mtproto/manager.go
Subscriptions
- Subscription generation
internal/sub/service.go - JSON subscriptions
internal/sub/json_service.go - Clash subscriptions
internal/sub/clash_service.go
Other components
- Panel operator
- Remote nodes
- Subscription client
Connections 21
- Panel operator → Management UI: uses
README.md - Management UI → API client: requests data
- Routing editor → API client: saves configuration
- Client management → API client: manages clients
- Application entry → Web server: starts server
main.go - API client → Web server: calls API
- API client → Client endpoints: calls API
- Web server → Panel operations: serves operations
internal/web/controller/server.go - Client endpoints → Client operations: delegates
- Client operations → Persistent storage: reads and writes
internal/web/service/client_bulk.go - Client operations → Xray core: updates clients
internal/web/service/client_bulk.go - Panel operations → Persistent storage: uses storage
internal/web/service/server.go - Panel operations → Xray core: manages core
internal/web/service/server.go - Node runtime dispatch → Persistent storage: loads nodes
internal/web/runtime/manager.go - Node runtime dispatch → Remote nodes: dispatches remotely
- Subscription routes → Subscription generation: builds subscriptions
internal/sub/controller.go - Subscription generation → Persistent storage: reads client state
internal/sub/service.go - Subscription routes → JSON subscriptions: serves JSON
internal/sub/controller.go - Subscription routes → Clash subscriptions: serves Clash
internal/sub/controller.go - Subscription client → Subscription routes: requests config
README.md - Application entry → MTProto sidecar: initializes service
main.go