Installation guide
This guide covers both ways to get Annie Mei running:- Use the hosted bot in your Discord server
- Self-host Annie Mei from source
Option 1: use the hosted bot
If you want the fastest setup, invite the hosted Annie Mei bot to your Discord server: Add Annie Mei to your Discord server After you add it, head to the Quickstart Guide to try the core slash commands.You’ll need permission to manage the Discord server before you can add bots.
Option 2: self-host Annie Mei
Use this path if you want to run your own instance, change the code, or develop new features. Self-hosted Annie Mei now has two Rust services:| Service | Purpose | Required for |
|---|---|---|
annie-mei bot service | Discord slash commands, AniList and theme song lookups, health endpoint | All bot features |
auth service | AniList OAuth start and callback flow, secure account linking | /register and new account links |
Self-hosting architecture
See how the bot service and auth service fit together.
Bot service
Configure and run the main Discord bot process.
Auth service
Configure and run the AniList OAuth companion service.
Environment Variables
Review the current env surface for both services.
Prerequisites
Before you begin, ensure you have the following installed:- Rust 1.94 or higher - Install from rustup.rs
- PostgreSQL - The bot and auth service both need database access
- Redis - The bot uses Redis for cached API responses
- Git - To clone the repository
Annie Mei uses the Rust 2024 edition. Make sure your Rust installation is up to date:
What you need to configure
Before you start the services, gather credentials for:- Discord Bot Token from the Discord Developer Portal
- Spotify API credentials from Spotify for Developers
- MyAnimeList API client ID from MyAnimeList API Config
- AniList OAuth app credentials for the auth service
- Sentry DSN if you want production-style monitoring
Self-host checklist
Prepare PostgreSQL and Redis
Create the database resources your deployment will use.
The bot and auth service each run their own migrations on startup. The bot also needs Redis before
cargo run succeeds.Configure the bot service
Create the bot
.env file in the repo root and set the current bot variables.The bot now requires
AUTH_SERVICE_BASE_URL and OAUTH_CONTEXT_SIGNING_SECRET at startup. Use Bot service for the exact setup.Configure the auth service
Set up Use Auth service for the exact setup.
auth/.env, your AniList OAuth app, and the shared OAuth secrets.Run both services
Start the auth service and the bot service in separate terminals.The local defaults are
http://127.0.0.1:8000 for the auth service and http://127.0.0.1:8080/healthz for the bot health endpoint.Where to go next
- Use Self-hosting architecture to understand the service split
- Use Bot service for the main process setup
- Use Auth service for AniList OAuth setup
- Use Environment Variables for the current config reference
