Deployment
Deploy Retrace to production with Render
Deployment
Retrace deploys on Render using the included render.yaml Blueprint.
Prerequisites
- A Render account
- A Neon PostgreSQL database with pgvector extension
- An Upstash Redis instance
- A Clerk application
- A Google AI Gemini API key
- A Dodo Payments account for billing
One-Click Deploy
- Fork the Retrace repository
- In Render Dashboard, click New then Blueprint
- Select your forked repository
- Render detects
render.yamland creates both services - Set the required environment variables
Environment Variables
API Service
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string (Neon) |
UPSTASH_REDIS_REST_URL | Yes | Upstash Redis REST URL |
UPSTASH_REDIS_REST_TOKEN | Yes | Upstash Redis REST token |
UPSTASH_REDIS_URL | Yes | Redis URL for BullMQ |
CLERK_SECRET_KEY | Yes | Clerk backend secret key |
GEMINI_API_KEY | Yes | Gemini API key for fork replay and eval |
ENCRYPTION_KEY | Yes | AES-256 key for user provider keys |
DODO_PAYMENTS_API_KEY | Yes | Dodo Payments API key |
DODO_PAYMENTS_WEBHOOK_SECRET | Yes | Dodo Payments webhook secret |
DODO_PRO_PRODUCT_ID | Yes | Dodo Payments Product ID for Pro plan |
DODO_ENTERPRISE_PRODUCT_ID | No | Dodo Payments Product ID for Enterprise |
WEB_URL | Yes | URL of the web service |
Web Service
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_API_URL | Yes | URL of the API service |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Yes | Clerk publishable key |
CLERK_SECRET_KEY | Yes | Clerk backend secret key |
Database Migrations
Migrations run automatically on startup via the render.yaml startCommand. For manual runs:
cd packages/api
npx drizzle-kit migrateThen apply the pgvector migration:
psql $DATABASE_URL -f drizzle/0002_pgvector.sqlHealth Monitoring
The API provides a /health endpoint that checks PostgreSQL and Redis:
curl https://api.retrace.yashbogam.me/health{
"status": "ok",
"service": "retrace-api",
"version": "0.2.0",
"checks": { "database": "ok", "redis": "ok" }
}Smoke Test
After deployment, run the smoke test:
SMOKE_API_URL=https://api.retrace.yashbogam.me npm run smoke-test --workspace=packages/api[!TIP] Set up Render health checks using the /health endpoint. Render will automatically restart the service if checks fail.