Configuration

Environment variables and configuration files for the backend

Configuration

Environment Files

Symfony loads environment files in this order (later files override earlier ones):

  1. .env — committed defaults and documentation
  2. .env.localyour local overrides (gitignored)
  3. .env.{APP_ENV} — environment-specific defaults (e.g., .env.test)
  4. .env.{APP_ENV}.local — environment-specific local overrides

Real environment variables (set in your shell or Docker) always win over .env files.

Never commit secrets. Put all real credentials in .env.local or set them as environment variables in your deployment platform.

Environment Variables

Core

VariableDescriptionExample
APP_ENVSymfony environmentdev, test, prod
APP_SECRETSymfony secret (CSRF, signing)Random 32+ char string
DATABASE_URLPostgreSQL connection stringpostgresql://app:pass@database:5432/app
MESSENGER_TRANSPORT_DSNMessage transportsync:// (dev) or redis://redis:6379/messages
JWT_PASSPHRASEPassphrase for JWT key pairRandom string
CORS_ALLOW_ORIGINAllowed CORS origins (regex)^https?://(localhost)(:[0-9]+)?$

Email / Brevo

VariableDescriptionExample
EMAIL_SENDER_EMAILFrom address for all emailsnoreply@yourdomain.com
EMAIL_SENDER_NAMEFrom name for all emailsYour App Name
MAILER_DSNSymfony Mailer transportsmtp://mailer:1025 (dev)
BREVO_API_KEYBrevo API key (production emails)xkeysib-...

In development, emails go to Mailpit at http://localhost:8025. In production, emails are sent via the Brevo API.

Stripe

VariableDescriptionExample
STRIPE_SECRET_KEYStripe API secret keysk_test_... or sk_live_...
STRIPE_WEBHOOK_SECRETStripe webhook signing secretwhsec_...
STRIPE_SUCCESS_URLRedirect after successful paymenthttps://yourapp.com/payment/success
STRIPE_CANCEL_URLRedirect after cancelled paymenthttps://yourapp.com/payment/cancel

Firebase

VariableDescriptionExample
FIREBASE_PROJECT_IDFirebase project IDmy-app-12345

Frontend URLs

VariableDescriptionExample
EMAIL_VALIDATION_REDIRECT_URLWhere users land after email validationhttps://yourapp.com/auth/email-verified
FRONTEND_RESET_PASSWORD_URLFrontend password reset formhttps://yourapp.com/auth/reset-password

GitHub (Optional)

VariableDescriptionExample
PERSONAL_GITHUB_API_TOKENGitHub PAT with admin:org scopeghp_...
ORGANIZATION_GITHUB_NAMEGitHub organization nameyour-github-org

Only needed if using the GitHub organization auto-invite feature for paid subscribers.

Config Files

Stripe Plans — config/packages/stripe.yaml

Defines your plan tiers. Supports both one-time and recurring payment models:

parameters:
    stripe_plans:
        starter:
            name: 'Starter Plan'
            type: 'one_time'
            price_cents: 4900          # $49.00
        pro:
            name: 'Pro Plan'
            type: 'one_time'
            price_cents: 14900         # $149.00

After changing plan definitions, sync to Stripe:

docker compose exec php bin/console app:stripe:sync-plans

Brevo Email Templates — config/packages/brevo.yaml

Maps Brevo template IDs to email types:

TemplateVariables
WelcomeuserName, validationLink
Password ChangeduserName
Password ResetuserName, resetLink
GitHub MembershipuserName, organizationUrl

Rate Limiting — config/packages/rate_limiter.yaml

LimiterLimitWindowScope
auth_signup_ip515 minutesIP
auth_signup_email315 minutesEmail
auth_login_ip515 minutesIP
auth_login_email515 minutesEmail
auth_logout101 minuteIP

JWT Configuration

SettingValue
Access token TTL3600s (1 hour)
Refresh token TTL2592000s (30 days)
Refresh tokenSingle-use (rotated on each refresh)