SYSTEM ARCHITECTURE

Modern Bot Infrastructure

A robust, secure, and scalable architecture designed to keep your Discord bot online, your deployments automated, and your AI chat responsive.

RUNTIME & HOSTINGPersistent Gateway
Bot Process
Node.js + PM2 (VPS)
Dedicated Node.js runtime environment managed by PM2 to ensure 24/7 Discord Gateway connectivity.
Gateway Ping< 40ms
Resources64MB RAM
Automated process restarts on unexpected runtime failures
Isolated environment variables for secure token handling
Real-time heartbeat monitoring via authenticated API
Active ModuleTIER 1
WEB INTERFACESecure Client
Dashboard UI
React + Tailwind SPA
Modern React dashboard providing real-time telemetry, configuration, and AI chat management.
Bundle Size128 KB
ResourcesZero Secrets
Responsive design for desktop and mobile monitoring
Secure OAuth flow for GitHub and Discord integration
Encrypted communication with backend API services
Active ModuleTIER 2
DATA & AIProduction Ready
Backend API
Node.js + PostgreSQL
Secure backend API handling bot status, AI conversation history, and repository deployment logs.
API Latency< 50ms
ResourcesAuto-Scaled
Rate-limited endpoints for secure dashboard requests
Encrypted storage for AI conversation history logs
GitHub webhook integration for deployment triggers
Active ModuleTIER 3

SECURITY FIRST

Secrets are stored in secure environment variables; no tokens are ever exposed to the frontend.

REAL-TIME SYNC

Gateway heartbeats and deployment status updates are pushed to the dashboard in real-time.

SCALABLE DESIGN

Modular architecture allows for easy expansion of AI models and new Discord bot features.

SETUP GUIDE

Bot health monitoring

Follow these steps to connect your bot to the dashboard and enable real-time status tracking.

01
SETUPACTIVE

Bot runtime environment

Prepare your VPS and secure your bot credentials.

02
TELEMETRY

Heartbeat schema setup

Define the database schema for status tracking.

03
CONNECTION

Gateway ping integration

Implement the recurring heartbeat ping.

04
MONITORING

Timeout & offline logic

Handle connection drops and status updates.

.env / setup.sh
bash
Step 01•SETUP
Bot runtime environment
Set up your Node.js runtime, install required Discord gateway libraries, and store your bot token in a secure environment variable file.
# Initialize project directory
mkdir bot-runtime && cd bot-runtime
npm init -y

# Install gateway dependencies
npm install discord.js dotenv

# Create secure config
cat << 'EOF' > .env
DISCORD_TOKEN="your_secret_token"
HEARTBEAT_URL="https://api.botdash.com/v1/heartbeat"
EOF

Secure tokens

Keep your bot token in environment variables, never in your code.

Gateway pings

Regular heartbeats ensure the dashboard reflects real-time status.

Auto-offline

Dashboard flags bot as offline if no heartbeat arrives in 30s.

Latency tracking

Monitor your bot's ping to Discord gateway directly in the UI.