Configuration

Environment Variables

Full reference for all Retrospend environment variables. These are set in your .env file. Some operational settings (audit log privacy mode, import concurrency, AI configuration, and registration controls) are managed at runtime via the Admin Panel instead.

Note

The .env.example file in the repository contains all variables with comments. Copy it to .env and fill in your values.
bashbash
cp .env.example .env
# Then edit .env with your values

Core

VariableRequiredDefaultDescription
AUTH_SECRETrequired-Secret used to sign sessions and auth tokens. Generate with: openssl rand -base64 32
PUBLIC_URLrequired-Full public URL of your instance (e.g. https://your-domain.com). Used for auth redirects and email links.
DATABASE_URLrequired-PostgreSQL connection string. In Docker: postgresql://user:pass@postgres:5432/retrospend
TRUSTED_ORIGINSoptional-Comma-separated list of additional origins to trust for auth requests. Useful for tunnel setups.

Database

VariableRequiredDefaultDescription
POSTGRES_USERrequiredpostgresPostgreSQL username.
POSTGRES_PASSWORDrequired-PostgreSQL password. Use a strong random value.
POSTGRES_DB_NAMErequiredretrospendPostgreSQL database name.

Sidecar

VariableRequiredDefaultDescription
WORKER_API_KEYrequired-Shared secret between the main app and the sidecar. Generate with: openssl rand -base64 32
SIDECAR_URLoptionalhttp://retrospend-sidecar:8080Internal URL of the sidecar service (background jobs + importer).

Storage

VariableRequiredDefaultDescription
UPLOAD_DIRoptional/data/uploadsDirectory path for uploaded files. Mounted as a Docker volume.

AI Import (LLM)

VariableRequiredDefaultDescription
OPENROUTER_API_KEYoptional-OpenRouter API key. Required if using external AI for bank import. Get one at openrouter.ai
OPENROUTER_MODELoptionalqwen/qwen-2.5-7b-instructOpenRouter model to use for import processing.
OLLAMA_ENDPOINToptionalhttp://ollama:11434/api/generateOllama API endpoint. Use http://host.docker.internal:11434/api/generate if Ollama runs on the host.
LLM_MODELoptionalqwen2.5:7bOllama model name. Must be pulled first.
ENRICH_BATCH_SIZEoptional20Merchants per LLM enrichment batch.
ENRICH_CONCURRENCYoptional3Max parallel enrichment LLM calls.
PDF_CONCURRENCYoptional3Max parallel PDF chunk parsing LLM calls.

Email (SMTP)

VariableRequiredDefaultDescription
SMTP_HOSToptional-SMTP server hostname.
SMTP_PORToptional587SMTP server port.
SMTP_USERoptional-SMTP authentication username.
SMTP_PASSWORDoptional-SMTP authentication password.
EMAIL_FROMoptional-From address for outgoing emails. Example: Retrospend <[email protected]>
UNSUBSCRIBE_SECREToptional-Secret used to sign one-click unsubscribe links in notification emails. Generate with: openssl rand -base64 32

App Behavior

VariableRequiredDefaultDescription
NEXT_PUBLIC_SHOW_LANDING_PAGEoptionaltrueShow the marketing landing page at /
NEXT_PUBLIC_ENABLE_LEGAL_PAGESoptionalfalseShow Terms and Privacy Policy links in the UI.