Services
Architecture and internals for AntiRaid's four core services.
Updated April 11, 2026
AntiRaid is split into four independent services. Each service has a single responsibility and communicates with the others over HTTP or internal RPC.
Services
| Service | Language | Responsibility |
|---|---|---|
bot | Rust | Discord gateway — events, slash commands, moderation actions |
api | Go | HTTP API for the dashboard, external integrations, and internal service calls |
jobserver | Go | Background jobs — scheduled backups, message pruning, async tasks |
template-worker | Rust | Sandboxed Luau script execution for user-defined templates |
How they communicate
- bot → api: The bot calls the API over HTTP for operations that require shared state (e.g. reading guild settings, logging actions).
- api → jobserver: The API enqueues background jobs by calling the jobserver over HTTP.
- bot → template-worker: When a template needs to run, the bot dispatches an event to the template worker via an internal RPC call.
- All services → PostgreSQL: Every service reads and writes to the shared Postgres database directly.
Running a service
Each service can run in Docker (recommended) or natively as a systemd unit. See the Hosting guide for setup instructions.
For development, you can run a single service in isolation — just make sure its dependencies (Postgres, any sibling services it calls) are available. Each service reads its config from environment variables; see the service README for the full list.