Environment Variables in Production¶
Managing secrets securely is a critical part of deploying Atlas ERP.
General Principles¶
- Never commit
.envfiles. - Use Platform Secret Managers: Vercel, Render, and GitHub all provide secure ways to inject environment variables at build and run time.
- Separate Environments: Use completely different database credentials, Redis instances, and JWT secrets for Staging and Production.
Required Production Variables¶
Ensure these are set in your production hosting environments.
Backend (e.g., Render)¶
Frontend (e.g., Vercel)¶
| Bash | |
|---|---|
Rotating Secrets¶
If a secret (like JWT_SECRET) is compromised: 1. Generate a new secret. 2. Update the environment variable in your hosting platform. 3. Restart the backend service. (Note: Changing the JWT secret will invalidate all current user sessions, requiring everyone to log in again).