Skip to main content
Quick Setup with copy-env
From the backend/ directory, scaffold the runtime env file in one command:
This reads copy-env-config.json and copies src/.env.example to src/.env. The backend loads src/.env at startup; fill in the generated placeholders before running the server. Docker Compose can additionally load backend/.env when that file exists.

Configuration Overview Table


Detailed Configuration Breakdown

Where to Get Each Backend Value

Create the backend file from backend/src/.env.example and replace every YOUR_VALUE_HERE placeholder. Keep this file private: backend environment values are secrets unless marked public configuration.

Generate an Encryption Key

Backend Secrets and Rotation

Never place AI_API_KEY, DATABASE_URL, REDIS_URL, RESEND_API_KEY, GitHub secrets, or API_ENCRYPTION_KEY in frontend files, source control, Docker images, or public issue reports. If a secret is exposed, revoke it at the provider immediately and replace it in the backend environment.

1. Networking & CORS

PORT

  • Location: backend/.env
  • Description: Defines which port the server listens on upon startup (app.listen(port)).
  • Example:

CLIENT_URL

  • Location: backend/src/.env or the Compose environment
  • Description: Configured in Express’s cors() middleware in backend/src/server.ts:
  • Example:

2. Database & Storage

DATABASE_URL

  • Location: backend/.env
  • Description: Target PostgreSQL database instance. Required for running migrations via Drizzle ORM and managing client queries through pg.Pool.
  • Format: postgresql://[user]:[password]@[host]:[port]/[database]?sslmode=[mode]
  • Example:

REDIS_URL

  • Location: backend/.env
  • Description: Redis instance utilized for BullMQ task distribution, queueing pull request webhooks, managing user sessions, and coordinating async worker jobs.
  • Example:

3. AI Engine & Provider Routing

BASE_MODEL

  • Location: backend/.env
  • Description: Default model slug invoked when a review job does not supply an explicit model preference.
  • Example:

AI_API_KEY & AI_BASE_URL

  • Location: backend/.env
  • Description: Supplies authentication and custom base URL for the backend’s AI service (backend/src/service/ai.service.ts).
  • Example:

OPEN_AI_INTERFACE

  • Location: backend/.env
  • Description: Determines interface method on OpenAI SDK (chat by default).

4. Email Service & Delivery

RESEND_API_KEY

  • Location: backend/.env
  • Description: Authenticates with Resend API (backend/src/lib/resendEmail.ts) to dispatch transactional authentication emails (email verification OTPs, password reset links).
  • Example:

5. Platform Branding & Email Theming

Configured in backend/.env or defaults in backend/src/config/config.ts:

6. In-Code Platform Pricing & Quotas

Located in backend/src/config/config.ts:

Server Environment Template (backend/.env.example)