[FEATURE] Create 3x-UI Adapter and Integrate It with the Backend #18
Labels
No labels
backend
bug
documentation
duplicate
enhancement
fix
frontend
help wanted
infrastructure
invalid
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
Dependencies
No dependencies set.
Reference
PoweredDeveloper/radix-vpn#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is your feature request related to a problem?
The FastAPI Backend and the 3x-UI Panel run on the same Head Server, but the backend has no integration layer for the panel API. Business logic cannot yet provision VPN users, read subscription configs, or query panel operational state (server status, inbounds, nodes, etc.).
Describe the solution you'd like
Implement a TrixUI adapter as an internal Backend module that translates business operations into 3x-UI Panel API calls.
Authentication
Use a persistent API Bearer token on every request (
Authorization: Bearer <token>). Do not use cookie/session login or CSRF for programmatic access.Implementation scope
In scope for this issue (foundation):
config.pyTrixUIClient- async HTTP client with timeout and structured errors (TrixUIClientError)VpnPanelAdapterprotocol +TrixUIAdapterimplementationget_server_status()->GET /panel/api/server/status, parsed into typedServerStatusError handling
raise_for_status(){ "success": false }responses ->TrixUIClientErrorDescribe alternatives you've considered
Direct HTTP calls from route handlers - rejected; duplicates auth, error handling, and couples business logic to 3x-UI.
Cookie/session login to the panel - rejected for programmatic use; CSRF complicates automation. Bearer API token is the supported 3x-UI approach for
/panel/api/*.Direct access to the TrixUI PostgreSQL database - rejected; writes must go through the Panel API only (see Database — Synchronization).
Separate microservice for the adapter - rejected; docs specify an internal Backend module, not a standalone service.
Additional context
.envasXUI_API_TOKEN.Acceptance criteria
GET /panel/api/server/statusfrom inside Docker using env-configured URL + Bearer tokenTrixUIAdapter.get_server_status()returns a typedServerStatusmodelTrixUIClientError, not silent failuresVpnPanelAdapterprotocol exists so future panel implementations can be swapped without changing business logicChecklist