Skip to main content

Installation & Configuration

Clone the Repository

git clone https://github.com/t0xicVybez/ArkenBot.git
cd ArkenBot

Configure Environment Variables

Copy the example file to .env and fill in your values:

cp .env.example .env
nano .env

The .env file lives in the repository root and is read by all three services. The table below covers every required variable:

VariableDescription
DISCORD_TOKENBot token from the Discord Developer Portal
DISCORD_CLIENT_IDApplication ID
DISCORD_CLIENT_SECRETOAuth2 client secret
DISCORD_REDIRECT_URIOAuth2 callback URL — must match the portal exactly
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis connection string (default: redis://localhost:6379)
API_SECRETRandom string used to sign JWTs — generate with openssl rand -hex 32
BOT_OWNER_IDSYour Discord user ID — grants bot-owner access to the dashboard
NEXT_PUBLIC_API_URLPublic URL of the API (baked into the Next.js bundle at build time)
NEXT_PUBLIC_WS_URLPublic WebSocket URL of the API
NEXT_PUBLIC_DISCORD_CLIENT_IDSame value as DISCORD_CLIENT_ID
CORS_ORIGINURL of the web dashboard (e.g. http://localhost:3000)
WEB_URLPublic URL of the web dashboard
JWT_ACCESS_EXPIRYHow long access tokens last (e.g. 1h)
JWT_REFRESH_EXPIRYHow long refresh tokens last (e.g. 90d)
NEXT_PUBLIC_* variables

These are embedded into the Next.js build at compile time, not at runtime. If you change them you must rebuild the web package with pnpm --filter @arkenbot/web build.

Optional Variables

VariableDescription
DISCORD_GUILD_IDDev server ID — makes slash commands register instantly to one guild during development
LAVALINK_HOST / PORT / PASSWORDRequired for music playback (see Deployment)
TWITCH_CLIENT_ID / SECRETRequired for Twitch stream alerts
YOUTUBE_API_KEYRequired for YouTube stream alerts
TWITTER_BEARER_TOKENRequired for Twitter/X stream alerts
GROQ_API_KEYEnables AI-powered code review in the Code Review addon

Install Dependencies

pnpm install

Build

Build all packages in the correct dependency order:

pnpm build

This compiles: shared → addon-sdk → addons → API → bot → web. The first build takes a few minutes; subsequent builds are faster.

Deploy Slash Commands

Register slash commands with Discord. Run this once after first setup and again whenever commands are added or renamed:

pnpm deploy:commands
Guild vs. global commands

If DISCORD_GUILD_ID is set, commands register to that guild instantly. Without it, commands are registered globally and may take up to one hour to appear in Discord.


Next: Database Setup →