The production backend container runs pending Drizzle migrations before starting the API. Set
DATABASE_URL in the container environment before startup. Keep migration execution in the container’s startup command rather than the image build so the image can be built without database access.Configuration Overview Table
Detailed Configuration Breakdown
Where to Get Each Backend Value
Create the backend file frombackend/src/.env.example and replace every YOUR_VALUE_HERE placeholder. Keep this file private: backend environment values are secrets unless marked public configuration.
GITHUB_WEBHOOK_VERIFICATION_SECRET
This secret authenticates incoming POST /webhook requests. The backend verifies GitHub’s HMAC-SHA256 signature against the raw request body before checking the event type or writing to PostgreSQL and Redis.
Configure the same secret in both places:
- In the GitHub repository or GitHub App webhook settings, enter it in the Secret field.
- In
backend/src/.envor the production backend environment, setGITHUB_WEBHOOK_VERIFICATION_SECRETto the same value.
/webhook endpoint does not require a user session because GitHub authenticates it with this signature.
Generate an Encryption Key
Backend Secrets and Rotation
Never placeAI_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/.envor the Compose environment - Description: Configured in Express’s
cors()middleware inbackend/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 (
chatby 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 inbackend/.env or defaults in backend/src/config/config.ts:
6. In-Code Platform Pricing & Quotas
Located inbackend/src/config/config.ts: