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.
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: