Quick Reference
Run
bun run setup to automatically generate all .env files with proper values.Required Services
| Service | Env File | Purpose |
|---|---|---|
| Backend | apps/backend/.env | API server configuration |
| Web | apps/web/.env | Frontend configuration |
| Cluster | apps/cluster/.env | Workflow service |
| Electric Proxy | apps/electric-proxy/.env | Real-time sync proxy |
| Database | packages/db/.env | Database migrations |
Backend Variables
Configuration for the Effect-TS API server.Database
PostgreSQL connection string for the main application database.
WorkOS Authentication
WorkOS client ID for your application.Get from: WorkOS Dashboard → Configuration → Client ID
OAuth callback URL for authentication flow.
This URL must be added to Redirect URIs in your WorkOS dashboard.
Domain for session cookies.
Secret for verifying WorkOS webhook signatures.Get from: WorkOS Dashboard → Webhooks → Webhook Secret
S3-Compatible Storage
S3 bucket name for file uploads (works with Cloudflare R2, AWS S3, MinIO).
S3 API endpoint URL.
S3 access key ID.
Bun automatically reads
S3_* variables. AWS_* variables work as fallback.S3 secret access key.
Service URLs
URL of the Effect Cluster service for background workflows.
URL of the Electric SQL proxy for real-time sync.
Public URL of the backend API.
URL of the frontend application (for auth redirects).
Redis
Redis connection URL for rate limiting and caching.
Integrations (Optional)
Linear OAuth client ID for Linear integration.
Linear OAuth client secret.
Linear OAuth callback URL.
Discord bot client ID.
Discord bot client secret.
Discord bot token.
Enable Discord gateway connection.
Discord gateway intents bitmask.
Observability (Optional)
OpenTelemetry Protocol endpoint for traces.Supported backends:
- Honeycomb
- Datadog
- Grafana Tempo
- Jaeger
Web (Frontend) Variables
Configuration for the React frontend application.All frontend variables are prefixed with
VITE_ to be included in the build.Backend URLs
URL of the backend API server.
URL of the cluster service.
WorkOS
WorkOS client ID (same as backend).
Frontend OAuth callback URL.
Electric SQL
Electric SQL proxy URL for real-time sync.
The Electric proxy adds authentication and caching. Using the proxy is recommended over direct Electric connection.
CDN
Public CDN URL for uploaded files.
Cluster Variables
Configuration for the Effect Cluster workflow service.Database
PostgreSQL connection string (same as backend).
Dedicated database for Effect Cluster persistence.
The cluster service uses a separate database for workflow state isolation.
Electric Proxy Variables
Configuration for the Cloudflare Worker proxy.Server port for local development.
PostgreSQL connection string.
Development mode flag.
Electric SQL service URL.
Electric Cloud source ID (only for Electric Cloud).
Electric Cloud source secret.
WorkOS API key for authentication.
WorkOS client ID.
CORS allowed origin.
OpenTelemetry endpoint for observability.
Database Package Variables
Configuration for Drizzle ORM migrations.PostgreSQL connection string for migrations.
Environment File Templates
Backend Template
apps/backend/.env.example
Web Template
apps/web/.env.example
Cluster Template
apps/cluster/.env.example
Setup Wizard
The setup wizard automatically generates all.env files:
- Start Docker services
- Validate your environment
- Configure WorkOS authentication
- Generate secrets
- Create all
.envfiles - Initialize the database
The setup wizard is the recommended way to configure environment variables for development.
Security Best Practices
Secret Management
Use different keys per environment
Development and production should have completely different secrets.
Use secret management services
For production, consider:
- AWS Secrets Manager
- HashiCorp Vault
- Doppler
- 1Password Secrets Automation
Next Steps
Getting Started
Set up your development environment
Deployment
Deploy to production
WorkOS Configuration
Configure authentication
Database Setup
Set up PostgreSQL