Skip to content

Environment Variables

All variables are validated at startup via Zod in packages/config. The app refuses to boot if required variables are missing or invalid.

Required (all apps)

VariableDescription
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis connection string (used by BullMQ)
JWT_SECRETSecret for signing JWTs — minimum 32 characters
NODE_ENVdevelopment, test, or production

media-api

VariableDescription
R2_ACCOUNT_IDCloudflare account ID
R2_ACCESS_KEY_IDR2 API token access key
R2_SECRET_ACCESS_KEYR2 API token secret key
R2_BUCKET_NAMER2 bucket name
R2_PUBLIC_URLR2 bucket endpoint URL
RETINA_SERVICE_URLURL of the Retina face clustering service (Google Cloud Run)
RETINA_API_KEYAPI key sent as x-api-key header to the Retina service
MAIN_WEB_URLPublic-facing URL of main-web — used by the notify_user_invited worker to build invite links (e.g. https://app.example.com). Optional; invite emails fall back to a relative path if unset.

All media-api variables are optional — workers skip gracefully when not configured. This allows the API to start in dev without cloud credentials.

main-api

VariableDescription
STRIPE_SECRET_KEYStripe secret key (sk_live_... or sk_test_...)
STRIPE_WEBHOOK_SECRETStripe webhook signing secret (whsec_...)
RESEND_API_KEYResend API key for transactional email
RESEND_FROM_EMAILOverride sender address (optional). Useful for staging without a verified domain — e.g. onboarding@resend.dev. Defaults to no-reply@wairo.app.

Docker Compose (backoffice-web)

VariableDescription
BACKOFFICE_API_URLInternal URL to backoffice-api (e.g. http://backoffice-api:3001)
MEDIA_API_URLInternal URL to media-api (e.g. http://media-api:3003)
NEXT_PUBLIC_MAIN_WEB_URLPublic-facing URL of main-web — used to build shareable customer join links (e.g. https://app.example.com). Must be set at build time.
NEXT_PUBLIC_GOOGLE_PLACES_API_KEYGoogle Maps Platform API key. Enables location autocomplete (Places API New) and timezone auto-detection (Time Zone API) in the project create/edit forms. Must be set at build time (client-side). See External Services for setup details.

Docker Compose (main-web)

VariableDescription
MAIN_API_URLInternal URL to main-api (e.g. http://main-api:3002)
MEDIA_API_URLInternal URL to media-api (e.g. http://media-api:3003)
NEXT_PUBLIC_BACKOFFICE_URLPublic-facing URL of backoffice-web — used on the landing page for operator sign-up / login links. Must be set at build time.

Notes

  • Never read process.env directly in app code — always import env from @repo/config
  • Never commit .env files — only .env.example files belong in the repo
  • Empty string values are treated as undefined (handled by Zod preprocess)

Wairo — Internal Documentation