Skip to content

Configuration

The backend services are configured using environment variables. You can create a .env file in the root of each service package to set the required variables for local development.

Global Variables

These variables are used across multiple services.

VariableDescriptionExample
DATABASE_URLThe connection string for the MongoDB database.mongodb+srv://user:pass@host/db

Auth Package Configuration

These environment variables are defined in packages/auth/env.ts and are primarily used by the auth service.

VariableDescriptionRequiredDefault
BETTER_AUTH_SECRETSecret key for Better Auth.In production-
NODE_ENVThe node environment.No-
APP_ORIGINThe origin URL of the frontend application.Nohttp://localhost:5173
API_ORIGINThe origin URL of the API gateway.Nohttp://localhost:3001
EMAIL_ADDRESSThe email address to use for sending emails.Yes-
RESEND_API_KEYThe API key for Resend (email service).Yes-
PRODUCTION_URLThe production URL of the application.No-

Shared Package Configuration

These environment variables are defined in packages/shared/env.ts and are used by multiple services, especially the API Gateway.

VariableDescriptionRequiredNotes
AUTH_SERVICE_URLThe URL of the authentication service.Yes
CAMPAIGNS_SERVICE_URLThe URL of the campaigns service.Yes
BRAND_SERVICE_URLThe URL of the brand service.Yes
API_ORIGINThe origin URL of the API gateway.Yes
ALLOWED_ORIGINSComma-separated list of allowed origins for CORS.Yes