Appearance
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.
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | The 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.
| Variable | Description | Required | Default |
|---|---|---|---|
BETTER_AUTH_SECRET | Secret key for Better Auth. | In production | - |
NODE_ENV | The node environment. | No | - |
APP_ORIGIN | The origin URL of the frontend application. | No | http://localhost:5173 |
API_ORIGIN | The origin URL of the API gateway. | No | http://localhost:3001 |
EMAIL_ADDRESS | The email address to use for sending emails. | Yes | - |
RESEND_API_KEY | The API key for Resend (email service). | Yes | - |
PRODUCTION_URL | The 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.
| Variable | Description | Required | Notes |
|---|---|---|---|
AUTH_SERVICE_URL | The URL of the authentication service. | Yes | |
CAMPAIGNS_SERVICE_URL | The URL of the campaigns service. | Yes | |
BRAND_SERVICE_URL | The URL of the brand service. | Yes | |
API_ORIGIN | The origin URL of the API gateway. | Yes | |
ALLOWED_ORIGINS | Comma-separated list of allowed origins for CORS. | Yes |