Skip to main content
Budgetron uses environment variables for configuration. These should be configured in a .env file at the root of your project or passed in at container runtime.

Quick Start

Copy the example file and fill in your values:
cp .env.example .env

Environment Variable Reference

Core Configuration

NODE_ENV
string
default:"development"
The environment the application is running in.Options: development, test, productionRequired: No (defaults to development)

Docker Configuration

DOCKER_PORT
number
default:"3000"
Port to expose the container on. Only used for Docker deployments.Required: NoExample: 3000

Configuration by Category

Environment variables are organized into the following categories:

Authentication

Configure authentication providers and settings

Database

Configure PostgreSQL database connection

AI Providers

Configure OpenAI-compatible AI providers

Email

Configure email service for notifications

Blob Storage

Configure file upload and storage

Validation

All environment variables are validated at runtime using Zod schemas defined in src/env/server.ts. If required variables are missing or invalid, the application will fail to start with a clear error message.

Validation Behavior

  • Development: All environment variables are validated on application start
  • Production: Environment variables are validated unless CI=true or DOCKER=true is set
  • Empty strings: Automatically converted to undefined for cleaner validation

Security Best Practices

Never commit your .env file to version control. Always use .env.example as a template.
Use strong, randomly generated values for secrets like AUTH_SECRET, CRON_SECRET_TOKEN, and API keys.

Generating Secure Secrets

Generate a secure random secret for AUTH_SECRET:
openssl rand -base64 32

Build docs developers (and LLMs) love