AntiRaidAntiRaid

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

ServiceLanguageResponsibility
botRustDiscord gateway — events, slash commands, moderation actions
apiGoHTTP API for the dashboard, external integrations, and internal service calls
jobserverGoBackground jobs — scheduled backups, message pruning, async tasks
template-workerRustSandboxed 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.

Further reading