DarthProxy is a VPN subscription service that lives inside Telegram. Users start the bot and get a working VPN connection link right away. They can buy plans with Telegram Stars, follow step-by-step setup guides for iOS, Android, Windows, macOS and Linux, and manage their account from a dashboard that opens as a Telegram Mini App. There's no separate signup and no password. Behind the bot is a Rails 8 app that creates and manages VPN users on a Marzban (Xray) panel automatically: it creates users, issues subscription links, enforces expiry and data limits, and messages users when something changes. An admin panel lets the operator activate plans by hand for off-platform payments, manage nodes, and send custom announcements to users. The whole product is available in English, Russian and Spanish. Stack: Ruby on Rails 8, PostgreSQL, Solid Queue / Cache / Cable, Hotwire (Turbo + Stimulus), ViewComponent, Tailwind CSS, telegram-bot, OmniAuth Telegram, Marzban REST API, Telegram Stars (XTR), Motor Admin, Docker, Kamal, GitHub Actions.

- Telegram-first users. The audience was people who live in Telegram and expect to get a VPN without creating an account, installing an unfamiliar app first, or using a credit card. Everything had to work from one chat. - Two sources of truth. Subscriptions are stored in the app's database, but the real access (expiry, traffic limits, enabled or disabled) is enforced by a separate Marzban panel. The two had to stay in sync even when the network fails, payments are retried, or the panel changes a user's state on its own. - Payments that can't go wrong. Telegram Stars uses a pre-checkout step and a confirmation step. A charge must never leave a user without access, and a single payment must never provision access twice (for example, someone buying a "lifetime" plan they already have). - Hard setup for non-technical users. VPN clients differ on every platform. Copying a subscription link into the right app was where most users gave up. Telegram's limits. Messages older than 48 hours can't be deleted, editing a message with identical content returns an error, users can block the bot, and Mini App requests have to be checked to prove they came from Telegram. A changing business model. Over the project the product went from a 7-day free trial, to paid plans, to manual payments, to free access, to closed public access. Each change had to ship without a rewrite.
- Telegram as the identity layer. A /start command creates the user from their Telegram profile. Mini App requests are verified with Telegram's HMAC initData check plus a freshness window. The website uses Telegram OAuth, so the same account works in both places. Guest links (/start <token>) turn anonymous trial users into full accounts and keep their remaining time. - A bot built as screens. The bot uses inline keyboards: Menu, then My Link, then Language. It edits a single "live" menu message in place instead of filling the chat with new ones. Old menus are deleted, or their buttons are removed if Telegram won't delete them, so only one menu ever works. Errors and blocked-bot events are caught so one bad update can't break the webhook. - Business logic in Interactors. Each workflow (activate a subscription, pre-checkout, create a remote user, extend from a guest subscription, process a webhook) is a small step-by-step Interactor that runs inside a database transaction. - Calls to outside services and jobs go through an after_transaction hook, so Marzban and Telegram are only contacted after the database commit succeeds. This prevents "charged but not provisioned" and "provisioned but rolled back" cases. - Swappable VPN provider. XrayService wraps the panel behind adapters: a full Marzban REST client for production, and a Fake adapter for local development and CI. The app can be developed and tested without a live VPN server. - Two-way sync. The app sends changes to Marzban through background jobs. Marzban sends user events back to a webhook endpoint that checks a signature. Each event is saved as an InboundWebhook record, processed in the background, and turned into a localized Telegram notification. Cleanup jobs that run repeatedly remove expired and over-limit users from the panel. - Guided setup. Setup pages for each platform recommend one app (Happ is the default on iOS and Android), give a deep link or QR code, and show the user's own subscription link, all inside the Mini App. Operations and change. Feature flags (PAYMENTS_ENABLED, PUBLIC_ACCESS_CLOSED) switch the business model without a deploy. Motor Admin handles manual plan activation and announcements. Mission Control monitors the job queues. CI runs Brakeman and RuboCop, then builds a Docker image and deploys it with Kamal.