Professional Telegram shop bot for selling digital products with balance top-ups, admin panel, and dual payment gateways (Pakasir + Tripay).
This repo is designed for the Sebelas Storebot deployment and can be configured to run on a custom subdomain (e.g.,
bot-tg.sebelasindonesia.app).
- Telegram bot storefront with catalog, cart, and order flow
- Balance top-up system for quick checkout
- Pakasir payment gateway integration
- Tripay payment gateway integration (optional, still supported)
- Admin panel for products, categories, orders, users, and config
- Payment gateway and payment method configuration in the web panel
- Automatic payment polling + status updates
- File-based digital delivery (codes, files, links)
- SQLite persistence
- Node.js + Express
- SQLite
- Telegram Bot API
- Pakasir SDK
- Tripay REST API
-
Install dependencies:
npm install
-
Create environment file:
cp env.example .env
-
Configure
.env:# Telegram TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here TELEGRAM_WEBHOOK_URL=https://bot-tg.sebelasindonesia.app/webhook BASE_URL=https://bot-tg.sebelasindonesia.app # Database DATABASE_PATH=./data/shop.db # Auth JWT_SECRET=your_jwt_secret_here # Pakasir PAKASIR_SLUG=your_pakasir_project_slug PAKASIR_API_KEY=your_pakasir_api_key_here # Tripay (optional) TRIPAY_ENVIRONMENT=sandbox TRIPAY_API_KEY=your_tripay_api_key_here TRIPAY_PRIVATE_KEY=your_tripay_private_key_here TRIPAY_MERCHANT_CODE=your_merchant_code_here # Server PORT=3000 NODE_ENV=production
-
Start the app:
npm run dev
-
Open admin panel:
http://localhost:3000/admin
- Configure via Admin Panel:
- Tab: Payment Gateway
- Section: Pakasir Configuration
- Enter
PAKASIR_SLUGandPAKASIR_API_KEY
- Tripay is still supported.
- Configure via Admin Panel:
- Tab: Payment Gateway
- Section: Tripay Payment Configuration
- Admin Panel → Payment Gateway → Payment Method Configuration
- Choose:
- Default gateway: Pakasir or Tripay
- Default method
- Available methods (enable/disable)
/start- Start the bot/shop- Browse products/cart- View cart/orders- Order history/balance- Check balance/deposit- Add balance/help- Help info
Example (replace your domain):
server {
listen 80;
server_name bot-tg.sebelasindonesia.app;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}Use Certbot:
sudo certbot --nginx -d bot-tg.sebelasindonesia.appSet Telegram webhook:
curl -X POST "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook" \
-H "Content-Type: application/json" \
-d '{"url": "https://bot-tg.sebelasindonesia.app/webhook"}'- Default:
http://localhost:3000/admin - Authentication headers are defined in
.env:ADMIN_USERNAMEADMIN_PASSWORD
npm run dev- Start in dev modenpm start- Start in productionnpm run init- Setup workflownpm run reset-db- Reset databasenpm run test:payment-config- Test payment config API
src/
api/ Admin REST API
bot/ Telegram bot handlers
config/ Gateway configs
database/ SQLite layer + migrations
routes/ Payment routes
services/ Payment services
utils/ Helpers
public/ Admin panel UI
- Ensure
.envexists and is loaded - Restart the server after editing gateway settings
- Confirm your subdomain DNS points to the VPS
- Verify webhook is set to the correct URL
See SECURITY.md for reporting vulnerabilities.
See CONTRIBUTING.md.
See CODE_OF_CONDUCT.md.
Thanks to everyone who contributed:
- @aliahmadnawawi
MIT License. See LICENSE.