Create a .env file in the root of your backend project and add the following variables.
Each one is explained below.
- CLOUDINARY_API_KEY — Your Cloudinary API key
- CLOUDINARY_API_SECRET — Your Cloudinary secret key
- CLOUDINARY_CLOUD_NAME — Your Cloudinary cloud name
Get them from:
🔗 https://cloudinary.com/console
- JWT_SECRET — Secret key used to sign and verify user authentication tokens
- MONGODB_URI — Your MongoDB connection string
Get it from:
🔗 https://cloud.mongodb.com
- SMTP_FROM — Email address shown as sender
- SMTP_HOST — SMTP host (e.g.
smtp.gmail.com) - SMTP_PORT — SMTP port (e.g.
587for TLS) - SMTP_USER — SMTP username (email)
- SMTP_PASS — SMTP password or app password
Learn how to create Gmail App Passwords:
🔗 https://myaccount.google.com/apppasswords
- CORS_ORIGIN — Allowed frontend domain for API requests
- FRONTEND_URL — URL of your frontend site
- NODE_ENV — Current environment mode (
developmentorproduction)
npm install
npm run dev