Skip to main content

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:
ServicePurposeRequired for
annie-mei bot serviceDiscord slash commands, AniList and theme song lookups, health endpointAll bot features
auth serviceAniList OAuth start and callback flow, secure account linking/register and new account links
If you want full feature parity with the hosted bot, run both services.

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:
rustup update

What you need to configure

Before you start the services, gather credentials for:
  1. Discord Bot Token from the Discord Developer Portal
  2. Spotify API credentials from Spotify for Developers
  3. MyAnimeList API client ID from MyAnimeList API Config
  4. AniList OAuth app credentials for the auth service
  5. Sentry DSN if you want production-style monitoring
Both services also need PostgreSQL access. The bot needs Redis. See Environment Variables for the full reference.
Never commit your .env file to version control. Add it to .gitignore to keep your credentials safe.

Self-host checklist

1

Clone the repository

git clone https://github.com/annie-mei/annie-mei.git
cd annie-mei
2

Prepare PostgreSQL and Redis

Create the database resources your deployment will use.
createdb annie_mei
createdb annie_mei_auth
The bot and auth service each run their own migrations on startup. The bot also needs Redis before cargo run succeeds.
3

Configure the bot service

Create the bot .env file in the repo root and set the current bot variables.
touch .env
The bot now requires AUTH_SERVICE_BASE_URL and OAUTH_CONTEXT_SIGNING_SECRET at startup. Use Bot service for the exact setup.
4

Configure the auth service

Set up auth/.env, your AniList OAuth app, and the shared OAuth secrets.
cd auth
cp .env.example .env
Use Auth service for the exact setup.
5

Run both services

Start the auth service and the bot service in separate terminals.
terminal 1: cd auth && cargo run
terminal 2: cargo run
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.
6

Verify the stack

Test the core flows in Discord:
/ping
/register
/whoami
/register should open the auth service flow in your browser, and /whoami should show the linked AniList account after the callback finishes.

Where to go next

Next steps

Now that you have Annie Mei running, check out the Quickstart Guide to learn about all available commands and features.