Backend Setup Guide
This guide explains how to set up the backend for local development or production.
Environment Variables
Create a .env file in the project root with the following variables:
env
BOT_TOKEN=
BOT_USERNAME=
BOT_ADMIN_ID=
BOT_API_SERVER=
POOL_SIZE_REDIS=
POOL_SIZE_PGSQL=
PGSQL_USER=
PGSQL_NAME=
PGSQL_PASS=
PGSQL_HOST=
PGSQL_PORT=
REDIS_HOST=
REDIS_PORT=
API_HOST=
API_PORT=
API_AUTH_TTL=
API_JWT_SECRET=
WEBHOOK_SECRET=
WEBHOOK_URL=
HELPER_IDS=
MIN_MEMBERS_COUNT=
TELEGRAM_API_ID=
TELEGRAM_API_HASH=
ARCHIVE_CHAT_ID=
MINIAPP_SLUG=⚠️ Replace each value with your own configuration.
Local Deployment
- Install dependencies:
bash
bun install- Setup Database:
- Install PostgreSQL and Redis.
bash
bun run migrate- Start the backend:
bash
bun run start- Setup Telegram webhook:
bash
bun run migrate- Login Helper Bots:
bash
bun run login