Environment Variables

All environment variables are configured in the root .env file, shared by both frontend and backend.

cp .env.example .env

Security

Variables are scoped by prefix:

PrefixAccessible FromNotes
PUBLIC_Frontend + Website + BackendExposed to browser, do not put sensitive data
No prefixBackend onlyNot included in frontend bundles

Backend Variables (Server Only)

Basic Config

VariableDescriptionExample
NODE_ENVRuntime environmentdevelopment / production
CONFIG_SUFFIXConfig file suffixexample
ALLOWED_ORIGINSAllowed CORS origins, comma-separatedexample.com,app.example.com

Database & Cache

VariableDescriptionExample
POSTGRES_CONNECTION_STRINGPostgreSQL connection stringpostgresql://admin:admin@localhost:5432/readystart
VALKEY_CONNECTION_STRINGValkey/Redis connection stringredis://localhost:6379
VALKEY_PREFIXCache key prefixprod:

JWT

VariableDescriptionExample
JWT_SECRETJWT signing secretyour-secret-key
JWT_EXPIRES_INToken expiration365d

Stripe Payments

VariableDescription
STRIPE_SECRET_KEYStripe API key
STRIPE_WEBHOOK_SECRET_KEYWebhook signing secret

Email (SMTP)

VariableDescriptionExample
MAIL_SEND_ENABLEDEnable email sendingtrue / false
MAIL_HOSTSMTP hostemail-smtp.us-east-1.amazonaws.com
MAIL_PORTSMTP port587
MAIL_USERSMTP username
MAIL_PASSSMTP password
MAIL_FROM_NAMESender nameYour App Name
MAIL_FROM_ADDRESSSender emailno-reply@example.com
MAIL_SUPPORT_URLSupport page URLhttps://www.example.com/support
MAIL_UNSUBSCRIBE_URLUnsubscribe URLhttps://console.example.com/settings/notifications

Google OAuth

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth Client ID

Cloudflare Turnstile

VariableDescription
TURNSTILE_VERIFY_URLVerification endpoint
TURNSTILE_SECRET_KEYServer-side secret key

Cloudflare R2 Storage

VariableDescription
R2_ACCOUNT_IDCloudflare Account ID
R2_ACCESS_KEY_IDR2 access key
R2_SECRET_ACCESS_KEYR2 secret key
R2_BUCKET_NAMEBucket name
R2_PUBLIC_DOMAINPublic access domain

AWS (Optional)

Not needed if using IAM Roles on EC2/ECS.

VariableDescription
AWS_REGIONAWS region
AWS_ACCESS_KEY_IDAccess key
AWS_SECRET_ACCESS_KEYSecret key

Frontend Variables (PUBLIC_ prefix)

Shared by frontend (console) and website. Exposed to the browser.

VariableDescriptionExample
PUBLIC_BACK_ENDBackend API URLhttp://localhost:16888
PUBLIC_CONSOLE_URLFrontend URL (also used for Stripe callbacks)http://localhost:5173
PUBLIC_TITLEApp nameYour App Name
PUBLIC_GOOGLE_CLIENT_IDGoogle OAuth Client ID (frontend)
PUBLIC_TURNSTILETurnstile frontend Site Key
PUBLIC_SUPPORT_EMAILContact email (shown on legal pages)support@example.com
PUBLIC_LEDAL_TERMSTerms of service URL/legal/terms
PUBLIC_LEDAL_PRIVACYPrivacy policy URL/legal/privacy
PUBLIC_CONSOLE_CLARITY_PROJECT_IDConsole Clarity project ID (optional)
PUBLIC_WEBSITE_CLARITY_PROJECT_IDWebsite Clarity project ID (optional)