Skip to content

AmirDezyani/xui-shop

Repository files navigation

xui-seller

Sell your 3x-ui VPN access on Telegram, paid in USDT — automatically.

xui-seller is a self-hosted product you install on your own server, next to your own 3x-ui panel. It gives your customers a Telegram bot to buy VPN configs with crypto, and gives you a web dashboard to run the whole thing. Payments go straight to your own wallet and are watched on-chain — there is no middleman and no third-party payment processor.

The GitHub repository is named xui-shop; the product and its binary are named xui-seller.


What it does

You already run a 3x-ui panel. xui-seller turns it into a business:

  • A Telegram bot for your customers. They tap Start, claim a free trial config, browse your plans, pay in USDT, and instantly receive a working vless:// link and a QR code. They can also see their active configs with live usage, and reach your support contact. Persian by default, English fallback.
  • A web dashboard for you. Configure the bot, connect your 3x-ui panel, set your wallet addresses, define plans and prices, and watch revenue, users, orders, on-chain transactions, and issued configs — all from the browser. Dark, bilingual, mobile-friendly.

The customer pays → the on-chain watcher sees the confirmed transaction → xui-seller provisions a client on your 3x-ui panel and delivers the config to the buyer. Hands-off.

How a sale works

  1. A customer picks a plan and a payment network in the bot.
  2. The bot shows them your wallet address and an exact amount to send (each order gets a unique amount so payments can be matched unambiguously).
  3. Your server polls the blockchain. When it sees a confirmed, exact-amount payment to your wallet, it marks the order paid.
  4. It calls your 3x-ui panel to create the client, builds the vless:// link (or subscription link), and sends it to the customer with a QR code.
  5. You get an operator alert; the sale shows up on your dashboard.

Under/over/late payments are never auto-fulfilled — they're flagged for you to review.

Features

  • Crypto, direct to your wallet. USDT on Tron (TRC-20) and BSC (BEP-20) out of the box. No Cryptomus, no custody, no fees beyond the chain's. The payment layer is multi-chain by design — each network is just a row you fill in.
  • Free trials. Hand out time-limited / data-limited trial configs, optionally once per user, to convert browsers into buyers.
  • Operator dashboard. Revenue (today / 7d / 30d), active configs, pending orders, trial→paid conversion, recent sales, and a live view of every subsystem. Manage plans, networks, users, orders, on-chain transactions, and issued configs.
  • Strict, safe payment matching. Only a confirmed transaction for the exact expected amount provisions a config. Everything else is surfaced for manual review.
  • Built for censored regions. The bot uses long-polling (no inbound port required) and supports a SOCKS5 proxy to reach Telegram. The dashboard is Persian-first with full right-to-left layout. No assets are loaded from third-party CDNs.
  • One command to install. A Docker-based installer mirrors the 3x-ui experience: paste one line, answer a couple of prompts, done.
  • Operator alerts to Telegram. Sales, unmatched payments, and provisioning failures can be DMed to your own Telegram account.
  • Single binary, tiny footprint. Everything — bot, payment watcher, API, and the embedded dashboard — ships as one static Go binary with a SQLite database.

Install

On a fresh Linux VPS (the installer sets up Docker if it's missing):

bash <(curl -Ls https://raw.githubusercontent.com/AmirDezyani/xui-shop/main/deploy/install.sh)

It clones the project, builds the image on your server, asks for a dashboard username / password / port, starts everything, and prints your dashboard URL and credentials.

Then open the dashboard, sign in, and configure it (the bot token from @BotFather, your 3x-ui connection, your USDT wallet + a free TronGrid API key, and your plans), then press Restart. The bot and payment watcher come online.

Manage it afterwards with:

xui-seller status | logs | update | uninstall

Full operator guide — first-login walkthrough, HTTPS with Nginx + Let's Encrypt, enabling BEP-20, backups, and troubleshooting: Docs/DEPLOY.md.

The dashboard

A dark "operator console" with a single tether-teal accent. Eight screens:

Screen What it's for
Overview Revenue and usage KPIs, recent sales, live subsystem health.
Plans Your products — name, duration, data cap, device limit, price.
Payment networks Per-chain wallet, contract, API key, confirmations. One-click enable, per-row connection test, and a wrong-network warning.
Orders Every purchase attempt, filterable by status and network, plus a tab of raw on-chain transactions (unmatched ones flagged).
Configs Every issued vless:// credential, with revoke.
Users Your Telegram customers, searchable, with their configs and orders.
Settings Bot, 3x-ui panel, subscription links, trial limits, payments, and your dashboard password — in tidy sections.
Login Single operator account, set at install.

It's bilingual (فارسی / English) and flips the entire layout to RTL for Persian.

How it's built

One Go binary runs three cooperating subsystems; pick which with --mode:

xui-seller --mode=all      # everything in one process (default)
xui-seller --mode=bot      # Telegram bot only
xui-seller --mode=api      # dashboard API + UI only
xui-seller --mode=watcher  # on-chain payment watcher only
  • Backend: Go, standard library HTTP, SQLite (pure-Go, no CGO) — Postgres-swappable.
  • 3x-ui: talked to only over its HTTP API; your panel is never modified or forked.
  • Payments: a pluggable ChainWatcher interface; adding a new chain is a new package and one line, with zero changes to the bot or order logic.
  • Dashboard: React + Vite + TypeScript, embedded into the binary — so the whole product is a single artifact with no separate web server to run.
  • Packaging: Docker + docker-compose + a one-line installer.

Money is stored as integer micro-USDT everywhere; each chain normalizes its own decimals before the order layer ever sees a value, so the core logic never deals in floats or chain-specific units.

Security & principles

  • Single-tenant. One install serves one operator. No central hosting, no custody of anyone else's funds.
  • No third-party payment processor. Crypto goes directly to wallets you control, watched on-chain.
  • 3x-ui stays untouched. xui-seller is a separate process that only calls your panel's API.
  • Secrets stay server-side. The bot token, panel password, and chain API keys are write-only over the API — the dashboard never reads them back. Put the dashboard behind HTTPS in production (guide included).
  • Operator password is hashed (bcrypt); the login endpoint is rate-limited; sessions are server-side, HttpOnly cookies.

Development

You need Go and Node.

git clone https://github.com/AmirDezyani/xui-shop
cd xui-shop
cp .env.example .env       # set DATABASE_DSN + OPERATOR_USERNAME/PASSWORD at minimum
make release               # build the React dashboard, then the Go binary with it embedded
./xui-seller --mode=all

Open http://127.0.0.1:8080 and sign in with the credentials from .env. A fresh install boots with nothing configured — the dashboard comes up and you configure the rest from the browser, then restart.

Settings model: environment variables seed the database once, on the first boot. After that the dashboard is the source of truth; later .env changes are ignored for bot / panel / trial settings.

Frontend hot-reload loop:

go run ./cmd/xui-seller --mode=api   # API on 127.0.0.1:8080
cd web && npm run dev                # Vite dev server, /api proxied

Tests:

make test       # Go: unit + integration against in-memory SQLite
make web-test   # frontend money/digit math

More: the architectural blueprint is in Docs/BUILD_SPEC.md, frontend conventions (RTL, i18n, money) in web/README.md, and contributor working notes in CLAUDE.md.

Non-goals

So you know what this deliberately is not:

  • It does not modify, fork, or inject UI into 3x-ui.
  • It is not a multi-tenant SaaS — one operator per install.
  • It does not use third-party payment processors — crypto goes straight to your wallets.

Built to install next to your 3x-ui panel and quietly run a small VPN business. Self-hosted, single binary, your keys, your customers.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors