Prerequisites
Before you begin, make sure you have the following installed and available:- Node.js 22 or later
- pnpm (
npm install -g pnpm) - PostgreSQL 17 or later
- Redis 7 or later (recommended)
- An Anthropic API key for Claude
- A Discord application with a bot token
Clone the repository and install dependencies
Clone the repo and install all dependencies with pnpm:
Copy the environment file
Copy the example environment file and open it for editing:Fill in the required values. The table below describes every variable:Required variables
Optional but recommended
Web dashboard variables (required only if running the dashboard)
| Variable | Description |
|---|---|
DISCORD_TOKEN | Your Discord bot token |
DISCORD_CLIENT_ID | Your Discord application/client ID |
ANTHROPIC_API_KEY | Anthropic API key for Claude |
DATABASE_URL | PostgreSQL connection string, e.g. postgresql://postgres:postgres@localhost:5432/volvoxbot |
SESSION_SECRET | Secret for JWT signing — generate with openssl rand -base64 32 |
| Variable | Description | Default |
|---|---|---|
REDIS_URL | Redis connection string | in-memory fallback |
BOT_API_SECRET | Shared secret for bot ↔ dashboard API auth | — |
LOG_LEVEL | Logging level (debug, info, warn, error) | info |
SENTRY_DSN | Sentry error tracking DSN | disabled |
MEM0_API_KEY | mem0 API key for long-term user memory | disabled |
| Variable | Description |
|---|---|
NEXTAUTH_URL | Dashboard canonical URL, e.g. http://localhost:3000 |
NEXTAUTH_SECRET | NextAuth.js JWT encryption secret — generate with openssl rand -base64 32 |
DISCORD_CLIENT_SECRET | Discord OAuth2 client secret |
BOT_API_URL | URL the dashboard uses to reach the bot API |
DASHBOARD_URL | Dashboard URL for CORS origin |
NEXT_PUBLIC_DISCORD_CLIENT_ID | Discord client ID exposed to the browser |
Edit config.json
Open Other key sections you may want to review:
config.json at the project root and update it to match your Discord server. At minimum, set your bot owner ID in permissions.botOwners so you have full access:ai— enable AI chat, set channel blocklists, configure conversation history lengthwelcome— set a welcome channel ID and message templatemoderation— configure the alert channel and protected rolestriage— adjust the AI triage model, daily budget, and keyword triggers
config.json can also be changed at runtime using the /config slash command or the web dashboard.Set up your Discord application
If you haven’t already configured your bot in the Discord developer portal, follow these steps:
- Go to discord.com/developers/applications and open your application.
- Navigate to Bot and copy your bot token into
DISCORD_TOKENin your.env. - Under Privileged Gateway Intents, enable all four intents:
- Message Content Intent
- Server Members Intent
- Guild Voice States Intent (listed as Presence Intent in the portal)
- Guild Message Reactions Intent
- Navigate to OAuth2 → URL Generator and select the following:
- Scopes:
bot,applications.commands - Bot permissions: View Channels, Send Messages, Read Message History, Manage Messages, Add Reactions, Manage Roles
- Scopes:
- Copy the generated URL and use it to invite the bot to your server.
All four privileged intents are required. Missing any one of them will prevent features like welcome messages, reaction roles, and AI chat from working correctly.
Run database migrations
Apply all pending migrations to set up the database schema:This runs
node-pg-migrate up against the DATABASE_URL in your .env. Make sure PostgreSQL is running and the database exists before running this command.Deploy slash commands to Discord
Register all slash commands with the Discord API:This reads Guild-scoped commands update instantly.
DISCORD_TOKEN and DISCORD_CLIENT_ID from your .env and deploys commands globally. Global command propagation can take up to an hour.For faster iteration during development, deploy to a single guild instead:Start the bot
Start Volvox.Bot:Once running, you should see log output confirming the database connection, configuration load, and Discord login. Mention the bot in any channel to verify AI chat is working.
The bot exposes a REST API and WebSocket server on port
3001 (or BOT_API_PORT if set). The /api/v1/health endpoint returns the bot’s health status.What’s next
Configuration
Explore all configuration options and learn how to update settings at runtime.
AI chat
Learn how AI chat works, how to manage conversation history, and how to configure channel blocklists.
Dashboard
Set up the Next.js web dashboard for analytics, audit logs, and live configuration.