Backend server for YATU Learn platform.
npm installCreate a .env file in the root directory:
# Database
MONGO_URI=your_mongodb_connection_string
# JWT Secrets
Jwt_Sec=your_jwt_secret_key
Activation_Secret=your_activation_secret_key
Forgot_Secret=your_forgot_password_secret_key
# Email Configuration (Gmail)
Gmail=your_email@gmail.com
Password=your_gmail_app_password
# Frontend URL
frontendurl=https://www.yatulearn.fun
# Server
PORT=8080
NODE_ENV=developmentOption A: Resend (RECOMMENDED - works on all platforms including Render)
- Sign up at https://resend.com (free 3,000 emails/month)
- Get your API key from dashboard
- Add to
.env:RESEND_API_KEY=re_xxxxxxxxxxxxx RESEND_FROM_EMAIL=onboarding@resend.dev - That's it! ✅
Option B: Gmail SMTP (may not work on Render due to blocked ports)
If you still want to try:
- Go to https://myaccount.google.com/apppasswords
- Generate a 16-character App Password
- Add to
.env:Gmail=your_email@gmail.com Password=xxxxxxxxxxxxxxxx
Development:
npm run devProduction:
npm startMake sure to set these environment variables in Render dashboard:
MONGO_URI- Your MongoDB connection stringJwt_Sec- Secret key for JWT tokensActivation_Secret- Secret key for activation tokensForgot_Secret- Secret key for password reset tokensRESEND_API_KEY- Your Resend API key (get from https://resend.com)RESEND_FROM_EMAIL-onboarding@resend.dev(or your verified domain)frontendurl- Your frontend URL (e.g., https://www.yatulearn.fun)NODE_ENV- Set toproduction
Optional (Gmail fallback - not recommended for Render):
Gmail- Your Gmail addressPassword- Gmail App Password
- Use Resend instead of Gmail - it's more reliable on cloud platforms
- Check Render logs for email errors
- Verify
RESEND_API_KEYis set correctly - Make sure you're using
onboarding@resend.devor a verified domain