Skip to content

Self-hosting overview

This page is a short map. The operations documents live in the Altar repository and are the source of truth for commands and settings.

Part What it does
Backend The HTTP API (/api/v1).
Collectors Read each chain and store finalized deposits.
Pricing and points workers Price deposits and calculate points versions.
Database PostgreSQL. It holds campaigns, deposits, prices, and points.
Web server Caddy. It serves the app and proxies /api.
Registry indexer Mirrors the onchain registry contract (packages/rpc-indexer).

The stack is Node.js 22, Express, Drizzle with PostgreSQL, a React app, Docker Compose, and Ansible.

All paths are in the repository:

  • ops/README.md: deployment, environment files, migrations, and backups.
  • ops/ansible/README.md: the Ansible playbooks.
  • docs/cycle-operations.md: the campaign cycle runbook (commands, schedule, kill switch).
  • docs/staging-environment.md: the staging site, which previews a user-interface build of any git ref.
  • docs/runbooks/first-campaign-creation.md: creating the first campaign.
  • docs/registry-verification.md: how the registry contract source was verified.

The main deployment starts the new backend next to the old one, checks it, and then switches the web server over. It rolls back on its own if the switch fails. Read ops/README.md before you deploy.

These docs are a static site built from the packages/docs package: yarn docs:build writes packages/docs/dist. The OpenAPI file is generated from the server code during that build. The hosting setup is in docs/docs-site.md.