-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This guide walks you through system prerequisites, installation, environment configuration, and launching Master-Bot for local development and self-hosting.
- Prerequisites
- Step-by-Step Installation
- Discord Application Setup
- Environment Configuration
- Launching the Stack
- Testing & Quality Verification
- Where Data Lives
- Related Guides
Ensure your host environment meets the following specifications:
| Requirement | Supported Version | Purpose |
|---|---|---|
| Node.js |
>= 20.0.0 (v24 LTS recommended) |
JavaScript/TypeScript runtime for bot and dashboard. |
| pnpm |
>= 8.0.0 (repository pins pnpm@8.6.7) |
Fast, disk-efficient package manager. |
| Java |
Java 17+ (Adoptium / Temurin 21 recommended) |
Only required if running a local Lavalink v4 audio engine. |
| Discord App | Developer Portal Account | Bot token, client ID, and secret. |
Tip
Master-Bot operates with zero external database dependencies for local setups. SQLite persistence and in-memory Redis caching (ioredis-mock) are initialized automatically.
flowchart LR
Clone[1. Clone Repo] --> Install[2. pnpm install]
Install --> DBInit[Auto: Prepare Schema & /data/db.sqlite]
DBInit --> Config[3. Configure .env]
Config --> Run[4. pnpm dev]
git clone https://github.com/galnir/Master-Bot.git
cd Master-Botpnpm installpnpm install automatically runs the database bootstrap hook:
- Compiles the Prisma schema for SQLite.
- Creates the
/datadirectory if missing. - Pushes the database schema directly to
/data/db.sqlite.
- Open the Discord Developer Portal and click New Application.
- Under the Bot tab:
- Click Reset Token and save your
DISCORD_TOKEN. - Enable Privileged Gateway Intents:
- β Presence Intent
- β Server Members Intent
- β Message Content Intent
- Click Reset Token and save your
- Under the OAuth2 β General tab:
- Copy your Client ID (
DISCORD_CLIENT_ID) and Client Secret (DISCORD_CLIENT_SECRET). - Add your redirect callback:
https://your-domain.com/api/auth/callback/discord(orhttp://localhost:3000/api/auth/callback/discordfor local dev).
- Copy your Client ID (
- Under OAuth2 β URL Generator:
- Select scopes:
botandapplications.commands. - Select permissions:
Administrator(recommended for full feature suite, or standard moderation and voice permissions).
- Select scopes:
Copy .env.example to .env:
cp .env.example .envPopulate your mandatory configuration settings:
# Database (URI string: SQLite stored at /data/db.sqlite, or external PostgreSQL)
DB_URI="file:/data/db.sqlite"
# Dashboard URLs
# INTERNAL_URL binds to 0.0.0.0:3000 to listen on all interfaces, allowing public connections
INTERNAL_URL="0.0.0.0:3000"
PUBLIC_URL="http://localhost:3000"
DISCORD_CALLBACK_URL="https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=8&scope=bot%20applications.commands"
# Discord Bot Credentials
DISCORD_TOKEN="your-discord-bot-token"
DISCORD_CLIENT_ID="your-client-id"
DISCORD_CLIENT_SECRET="your-client-secret"
NEXTAUTH_SECRET="your-random-32-char-secret"
# Audio & Lavalink
LAVA_ENABLED=true
LAVA_EXTERNAL=falsepnpm dev- Launches the Sapphire Discord bot with
tsx watch. - Launches the Next.js 15 Web Dashboard at
http://localhost:3000. - Automatically initializes the embedded Lavalink v4 engine if Java 17+ is installed.
# Compile all TypeScript apps and packages:
pnpm build
# Start the unified production cluster:
pnpm start# Run Vitest test suite:
pnpm test
# Verify TypeScript compilation across monorepo:
pnpm type-check
# Run linter and boundary validation:
pnpm lint-
Database:
/data/db.sqliteβ Single persistent SQLite database file (or external PostgreSQL database). -
In-Memory Cache:
ioredis-mockruns in-process; connects to external Redis ifREDIS_URLis set. -
Log Files:
logs/β Process logs for debugging and telemetry.
- Home β Return to wiki main page
-
Configuration Reference β Detailed explanation of all
.envoptions - Architecture β System design and data layer deep dive
-
Commands Reference β Slash commands and
/setoptions - Developer Guide β How to add new commands and listeners
- Deployment β Production VPS and Docker deployment guide
Home β’ Documentation Index β’ GitHub Repository
π Home β’ ποΈ Architecture β’ βοΈ Configuration β’ π΅ Music β’ π» Dashboard β’ βοΈ Deployment β’ β FAQ
Master-Bot Documentation β’ Licensed under MIT β’ Maintained by galnir and the Master-Bot community
Master-Bot β Unified Discord music, moderation & utility bot with embedded Next.js 15 Web Dashboard, dual PostgreSQL/SQLite fallbacks, and embedded Lavalink v4 Audio.
- π Home β Project overview & quick start
- β‘οΈ Getting Started β Prerequisites, installation & startup
-
βοΈ Configuration β Complete
.envreference & fallbacks
- ποΈ Architecture β Unified single-process runtime & storage
- ποΈ Database & Fallbacks β Dual PostgreSQL & SQLite
-
β‘οΈ Cache & State β External Redis &
ioredis-mock -
π Commands Reference β Complete catalog of slash commands &
/setoptions
- π΅ Music & Audio β Embedded Lavalink v4, filters & playlists
- π‘οΈ Moderation β Ban, timeout, slowmode & audit logging
-
π« Support Tickets β Thread tickets &
.txttranscripts - π Welcome & Temp Channels β Greetings & dynamic voice hubs
- β° Reminders & Stream Alerts β Scheduled reminders, YouTube & Twitch alerts
- π» Web Dashboard β Next.js 15 App Router, tRPC v11 & 9 Studios
- π Deployment Guide β Docker, Low-Cost VPS & Self-Hosting
- π οΈ Developer Guide β Creating commands, listeners & features
-
π§ͺ Testing Suite β
@helix-origin/vitest-suitetesting toolkit - π‘οΈ Privacy Policy β Data collection, retention & deletion rights
- π Terms of Service β Service terms, permitted use & liability
- π Security Policy β Vulnerability reporting, advisories & hardening
- β FAQ & Troubleshooting β Common questions & solutions
- π€ Contributing β Contributor guide & commit standards
- π¦ Standalone Audio: HELIX-Origin/Lavalink-Server
- π§ͺ Vitest Suite: HELIX-Origin/vitest-suite
- π€ GitHub Repository: galnir/Master-Bot