Skip to main content

Deployment Guide

Praeto Dispatcher currently deploys as a Cloudflare Worker with a Cloudflare Queue binding and Neon Postgres as the database.

Requirements

  • Node.js installed
  • npm installed
  • Cloudflare Wrangler installed through npx wrangler
  • Cloudflare account with Workers enabled
  • Cloudflare Queue created
  • Neon Postgres database

Install dependencies

Required package:

Wrangler config

This repo should use wrangler.jsonc as the primary Worker config. Avoid maintaining both wrangler.toml and wrangler.jsonc long-term. If both exist, Wrangler may use the JSONC file depending on the repo state, which can cause confusion. Example wrangler.jsonc shape:

Secrets

Set database URL:
Set admin key:
Then deploy:

Database migrations

Apply migrations in order. Important schema areas:
  • tenant_profile
  • api_keys
  • endpoint_destinations
  • events
  • deliveries
  • delivery_attempts
  • rate_limit_counters
Phase 8 requires:

Deploy

Expected output should show bindings such as:
If expected vars are missing, Wrangler is probably using a different config file than you think.

Tail logs

Use this during tests and delivery debugging.

Health check


Post-deploy smoke tests


Production hardening checklist

Before a production deploy:
  • Use separate production Neon database or branch
  • Use separate production Cloudflare Queue
  • Set production Worker name
  • Rotate ADMIN_API_KEY
  • Confirm all retention values
  • Confirm all usage limits
  • Confirm all rate limits
  • Confirm logs do not leak webhook secrets
  • Confirm endpoint signing secrets are never returned except create/rotate
  • Confirm DLQ replay works
  • Confirm retention dry-run works
  • Confirm rate-limit SQL exists