Production-ready VPN subscription SaaS panel built with plain PHP and SQLite for shared hosting.
- Dynamic external JSON source with editable URL and a 60-second file cache
- No server storage of VPN servers in SQLite
- Setup wizard for admin credentials, branding, API token, and source URL
- Admin panel with authentication, plans, subscriptions, and settings
- Public subscription page with HTML or JSON output depending on client intent
- Multi-format delivery:
/subscription/{id}raw meta + untouched source JSON + routing/subscription/{id}?format=happsing-box/Happ config/subscription/{id}?format=sourceoriginal source JSON exactly
- Token-based API for create, extend, delete, enable/disable, Telegram binding, and config retrieval
- Server rename mapping for Happ tags and public display only
- Clean URLs via
.htaccess
- Upload the entire project to your PHP shared hosting directory.
- Ensure PHP has
pdo_sqliteenabled and write access to:db.sqlitecache/uploads/
- Open the site root in a browser.
- Complete
/setupon first launch. - Sign in at
/login.
Use one of these:
Authorization: Bearer YOUR_TOKENX-API-Token: YOUR_TOKEN?token=YOUR_TOKEN
Create a subscription:
curl -X POST "https://your-domain.com/api/create-subscription" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d "name=Premium User" \
-d "description=Primary subscription" \
-d "badge=PRO" \
-d "telegram_id=123456789" \
-d "plan_id=monthly-pro"Extend a subscription by 30 days:
curl -X POST "https://your-domain.com/api/extend-subscription" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d "id=SUBSCRIPTION_ID" \
-d "days=30"Disable a subscription:
curl -X POST "https://your-domain.com/api/disable-subscription" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d "id=SUBSCRIPTION_ID"Assign Telegram ID:
curl -X POST "https://your-domain.com/api/assign-telegram" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d "id=SUBSCRIPTION_ID" \
-d "telegram_id=987654321"Get default routed JSON:
curl "https://your-domain.com/api/subscription/SUBSCRIPTION_ID" \
-H "Authorization: Bearer YOUR_TOKEN"Get Happ config:
curl "https://your-domain.com/api/subscription/SUBSCRIPTION_ID/happ" \
-H "Authorization: Bearer YOUR_TOKEN"Get untouched source JSON:
curl "https://your-domain.com/api/subscription/SUBSCRIPTION_ID/source" \
-H "Authorization: Bearer YOUR_TOKEN"schema.sqlis the DB init script.db.sqliteis auto-created if missing.- Original source JSON is never modified or persisted in SQLite.
- Routing rules always prioritize
ru -> direct, then all other traffic ->proxy.