Overview
Tresa Contafy API requires several environment variables to function properly. This guide covers all required and optional configuration settings.Required Variables
Server Configuration
Environment mode:
development, production, or testPort number for the API server
Database Configuration
PostgreSQL connection string with the format:
For Railway deployments, SSL is automatically enabled when the URL contains
railway.app or rlwy.netJWT Authentication
Secret key for signing access tokens (expires in 15 minutes)
Secret key for signing refresh tokens (expires in 7 days)
Email Service (Brevo)
API key for Brevo (formerly Sendinblue) email service
Sender email address for transactional emails
Sender name for transactional emails
Application URL
Base URL of your frontend application (used for email verification links)
Optional Variables
CORS Configuration
Frontend URL for CORS configuration (overrides APP_URL for CORS)
If neither
FRONTEND_URL nor APP_URL is set in production, CORS will be disabled for securityRate Limiting
Maximum requests per 15-minute window per IP address
Logging
Logging level:
fatal, error, warn, info, debug, or traceExample Configuration
Security Best Practices
Use Different Secrets Per Environment
Production, staging, and development should have unique JWT secrets
Next Steps
Database Setup
Configure PostgreSQL database
Run Migrations
Initialize database schema