Skip to content

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

  1. Install dependencies:
bash
bun install
  1. Setup Database:
  • Install PostgreSQL and Redis.
bash
bun run migrate
  1. Start the backend:
bash
bun run start
  1. Setup Telegram webhook:
bash
bun run migrate
  1. Login Helper Bots:
bash
bun run login