Backend Variables
Required
| Variable | Description | Example |
|---|---|---|
SUPABASE_URL | Supabase project URL | https://xxx.supabase.co |
SUPABASE_ANON_KEY | Supabase anonymous key | eyJhbGciOiJIUzI1... |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key | eyJhbGciOiJIUzI1... |
DATABASE_URL | PostgreSQL connection string | postgresql://... |
SECRET_KEY | Application secret (256-bit) | abc123... |
Application
| Variable | Description | Default |
|---|---|---|
ENVIRONMENT | Environment name | development |
DEBUG | Enable debug mode | false |
APP_VERSION | Application version | 1.0.0 |
LOG_LEVEL | Logging level | INFO |
Redis
| Variable | Description | Default |
|---|---|---|
REDIS_URL | Redis connection URL | redis://localhost:6379 |
Security
| Variable | Description | Default |
|---|---|---|
ALLOWED_ORIGINS | CORS allowed origins | http://localhost:5173 |
RATE_LIMIT_REQUESTS | Requests per window | 100 |
RATE_LIMIT_WINDOW | Window in seconds | 60 |
Monitoring
| Variable | Description | Default |
|---|---|---|
SENTRY_DSN | Sentry error tracking | (none) |
Frontend Variables
All frontend variables must be prefixed withVITE_.
| Variable | Description | Example |
|---|---|---|
VITE_SUPABASE_URL | Supabase project URL | https://xxx.supabase.co |
VITE_SUPABASE_ANON_KEY | Supabase anonymous key | eyJhbGciOiJIUzI1... |
VITE_API_URL | Backend API URL | https://api.risklegion.com |
VITE_ENVIRONMENT | Environment name | production |
VITE_SENTRY_DSN | Sentry DSN (optional) | https://... |
Example Files
backend/.env.example
frontend/.env.example
Environment-Specific Values
Development
Staging
Production
Generating Secret Key
Security Best Practices
Key Management
Key Management
- Store secrets in environment variables, not code
- Use different keys for each environment
- Rotate keys periodically
- Never log secret values
Access Control
Access Control
- Limit who has access to production secrets
- Use secret management tools (AWS Secrets Manager, Vault)
- Audit secret access
CI/CD
CI/CD
- Use GitHub Secrets for CI/CD
- Don’t echo secrets in logs
- Mask secrets in output