Deployment Roadmap

Full Setup Guide

Follow this professional roadmap to deploy the entire AudioFlux ecosystem across your own infrastructure. This guide covers everything from credential acquisition to production deployment and monitoring.

Prerequisites

Required tools and accounts before you begin.

Development Tools

  • Node.js 18+ - Runtime environment for backend and frontend
  • Git - Version control for cloning repositories
  • npm/yarn - Package manager (comes with Node.js)

Cloud Accounts

  • Telegram Account - For creating the bot
  • Upstash Account - For Redis database (free tier available)
  • Hosting Platform - Railway, Heroku, or VPS

Step 1: Credential Acquisition

Collect the necessary API keys and database strings.

Telegram Bot Token

Required • From @BotFather

REQUIRED

The bot token allows the backend to authenticate with Telegram's Bot API and intercept music search commands from users.

Step-by-Step Instructions:
  1. 1.Open Telegram and search for @BotFather
  2. 2.Send the command /newbot
  3. 3.Follow the prompts to choose a name and username for your bot
  4. 4.Copy the HTTP API token (format: 123456:ABC-DEF...)
  5. 5.Optional: Disable privacy mode with /setprivacy to allow group message reading

Upstash Redis Database

Required • Global State Engine

REQUIRED

Global state is persisted in Upstash Redis. This includes room queues, playback state, user history, and viewer presence.

Setup Instructions:
  1. 1.Sign up at upstash.com
  2. 2.Create a new Redis database (select a region close to your backend deployment)
  3. 3.Copy the REST URL (starts with https://...)
  4. 4.CRITICAL: Go to Settings → Eviction Policy → Set to noeviction
Eviction Policy Warning

If eviction is enabled, Redis will automatically delete keys when memory is full, causing queue loss and state desynchronization. Always use noeviction for production.

Admin User ID

Required • For Administrative Access

REQUIRED

Your Telegram user ID is used to grant administrative permissions for queue management and system commands.

How to Find Your ID:
  1. 1.Open Telegram and search for @userinfobot
  2. 2.Send any message to the bot
  3. 3.Copy your numeric ID (e.g., 123456789)

Step 2: Deploying the Backend

The orchestration core must be live first.

Clone the Repository

git clone https://github.com/4nuxd/AudioFlux.git
cd AudioFlux/audioflux-backend

Configure Environment Variables

Create a .env file in the backend root directory:

cp .envexample .env
nano .env  # or use your preferred editor
VariableDescriptionExample
BOT_TOKENTelegram bot API token123456:ABC-DEF...
REDIS_URLUpstash Redis REST URLhttps://...
OWNER_IDYour Telegram user ID123456789
NODE_ENVEnvironment modeproduction
PORTServer port (auto-injected on most platforms)3001

Platform-Specific Deployment

Railway (Recommended)

  1. 1. Connect your GitHub repository to Railway
  2. 2. Add environment variables in the dashboard
  3. 3. Deploy automatically on push
✓ Free tier available • ✓ Auto-scaling • ✓ Zero config

Heroku

heroku create audioflux-backend
git push heroku main
heroku config:set BOT_TOKEN=...

VPS (DigitalOcean, Linode)

npm install
npm install -g pm2
pm2 start server.js --name audioflux
pm2 save

Docker

docker build -t audioflux-backend .
docker run -p 3001:3001 --env-file .env audioflux-backend

Verify Backend is Running

Test the health endpoint:

curl https://your-backend-url.com/health

Expected response: {"status":"healthy",...}

Step 3: Frontend & Status Monitor

Final steps to link the ecosystem.

Web Player (Frontend)

Point the web player to your backend using the public URL.

cd ../audioflux-frontend
cp .env.example .env.local
Deploy to Vercel or Netlify for best performance

Status Monitor

Configure health check endpoints.

cd ../audioflux-status
cp .env.example .env.local
Deploy separately for fault tolerance

Common Issues & Solutions

Bot not responding to commands

  • • Verify BOT_TOKEN is correct
  • • Check if backend /health endpoint returns 200
  • • Ensure bot privacy mode is disabled for group chats

Queue state lost after restart

  • • Verify Redis eviction policy is set to noeviction
  • • Check Redis connection in backend logs
  • • Ensure REDIS_URL uses HTTPS (not rediss://)

Frontend can't connect to backend

  • • Verify NEXT_PUBLIC_API_URL is publicly accessible
  • • Check CORS settings in backend (should allow your frontend domain)
  • • Test Socket.IO connection manually in browser console

Next Steps

Once deployed, test the entire flow: send a music search command to your bot in Telegram, verify the web player loads, and check the status monitor shows all systems operational.

Enterprise-Grade Deployment Guide • v2.0