This guide explains how to configure environment variables for CareerPilot across different environments.
- Copy the example files to create your local
.envfiles:
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env- Fill in your actual values in the
.envfiles - Never commit
.envfiles to version control — they are already listed in.gitignore
CareerPilot uses three environments:
| Environment | Purpose |
|---|---|
| development | Local development on your machine |
| staging | Testing before releasing to production |
| production | Live app used by real users |
Local setup for contributors. Runs entirely on your machine.
PORT=5001
NODE_ENV=development
FRONTEND_URL=http://localhost:5173
MONGODB_URI=mongodb://localhost:27017/career-pilot
REDIS_URL=redis://localhost:6379
GEMINI_API_KEY=<your-gemini-api-key>
GROQ_API_KEY=<your-groq-api-key>
RAPIDAPI_KEY=<your-rapidapi-key>
RAPIDAPI_HOST=jsearch.p.rapidapi.com
FIREBASE_PROJECT_ID=<your-firebase-project-id>
FIREBASE_STORAGE_BUCKET=<your-firebase-project-id>.appspot.com
FIREBASE_SERVICE_ACCOUNT_PATH=./path/to/service-account-key.json
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=<your-email-address>
EMAIL_PASS=<placeholder>
EMAIL_SERVICE_URL=https://email-service.example.com
EMAIL_API_KEY=<your-email-api-key>
RAZORPAY_KEY_ID=rzp_test_<your-key-id>
RAZORPAY_KEY_SECRET=<your-razorpay-key-secret>
LINKEDIN_CLIENT_ID=<your-linkedin-client-id>
LINKEDIN_CLIENT_SECRET=<your-linkedin-client-secret>
LINKEDIN_REDIRECT_URI=http://localhost:5001/api/auth/linkedin/callback
PROXYCURL_API_KEY=<your-proxycurl-api-key>
TOTP_ENCRYPTION_KEY=<64-char-hex-string>
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
ALERT_CRON_SCHEDULE="0 */6 * * *"
ALERT_TEST_INTERVAL=
ENABLE_DB_PROFILING=false
DEV_BYPASS_AUTH=false
DEV_USER_UID=dev-user-001
DEV_USER_EMAIL=dev@example.comVITE_API_URL=http://localhost:5001
VITE_API_BASE=http://localhost:5001/api
VITE_FIREBASE_API_KEY=<your-firebase-web-api-key>
VITE_FIREBASE_AUTH_DOMAIN=<your-firebase-project-id>.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=<your-firebase-project-id>
VITE_FIREBASE_STORAGE_BUCKET=<your-firebase-project-id>.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=<your-sender-id>
VITE_FIREBASE_APP_ID=<your-firebase-app-id>
VITE_FIREBASE_MEASUREMENT_ID=G-<your-measurement-id>
VITE_MAX_SIZE_MB=5DEV_BYPASS_AUTH=false— set totrueonly to skip Firebase login during local testingALERT_TEST_INTERVAL— set a value in milliseconds (e.g.10000for 10 seconds) to test job alerts faster locallyENABLE_DB_PROFILING=false— set totrueto log slow MongoDB queries while debuggingPROXYCURL_API_KEY— required only for the LinkedIn profile import feature; leave blank to disable that feature without affecting anything else. Free tier: 10 credits, no credit card required (proxycurl.com)
Used for testing the full app before pushing to production. Mirrors production settings but uses test credentials.
| Variable | Development | Staging |
|---|---|---|
NODE_ENV |
development |
staging |
MONGODB_URI |
local MongoDB | separate Atlas cluster |
REDIS_URL |
local Redis | Upstash or Redis Cloud |
FRONTEND_URL |
http://localhost:5173 |
staging frontend URL |
RAZORPAY_KEY_ID |
rzp_test_ prefix |
rzp_test_ prefix |
DEV_BYPASS_AUTH |
optional true |
always false |
ENABLE_DB_PROFILING |
optional true |
true |
EMAIL_SERVICE_URL |
not needed | deployed email service URL |
- Always use test credentials for Razorpay in staging — never real payment keys
- Set
ENABLE_DB_PROFILING=truein staging to catch slow queries before they hit production DEV_BYPASS_AUTHmust always befalsein staging
The live environment. All values must be real, secure, and set as environment variables on your hosting platform — never in a .env file on the server.
| Variable | Staging | Production |
|---|---|---|
NODE_ENV |
staging |
production |
RAZORPAY_KEY_ID |
rzp_test_ prefix |
rzp_live_ prefix |
FRONTEND_URL |
staging URL | live frontend URL |
ENABLE_DB_PROFILING |
true |
false |
ALERT_TEST_INTERVAL |
optional | must be empty |
DEV_BYPASS_AUTH |
false |
false |
- Set all variables directly in your hosting platform dashboard (Railway, Render, Heroku etc.) — do not use a
.envfile - Use live Razorpay keys (
rzp_live_prefix) only in production ENABLE_DB_PROFILINGmust befalse— profiling adds overhead and slows down the appDEV_BYPASS_AUTHmust always befalse— setting it totruewould let anyone access the app without logging in- Rotate
TOTP_ENCRYPTION_KEYandRAZORPAY_KEY_SECRETimmediately if they are ever exposed
| Service | Where to get it |
|---|---|
| Firebase | Firebase Console > Project Settings |
| Google Gemini | Google AI Studio |
| Groq | Groq Console |
| RapidAPI / JSearch | RapidAPI |
| Razorpay | Razorpay Dashboard |
| LinkedIn OAuth | LinkedIn Developers |
| Proxycurl | proxycurl.com — free tier: 10 credits, no credit card required |
| Gmail App Password | Google Account |
| TOTP Key | Run: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" |
Before deploying, make sure:
-
.envfiles are in.gitignoreand never committed - All placeholders in
.env.exampleuse<angle-bracket>format — not realistic-looking values that could be flagged by secret scanners -
DEV_BYPASS_AUTH=falsein staging and production -
ENABLE_DB_PROFILING=falsein production - Razorpay live keys are only used in production
-
TOTP_ENCRYPTION_KEYis a unique 64-char hex string -
RAZORPAY_KEY_SECRETis never exposed to the frontend -
ALERT_TEST_INTERVALis empty in staging and production -
PROXYCURL_API_KEYis kept server-side only and rotated if exposed - No API keys appear in client-side code, logs, or error responses