Before deploying to Render, ensure you have completed these steps:
- Code is committed to Git
- Repository is pushed to GitHub/GitLab
-
.envfile is NOT in the repository (check.gitignore) -
.env.exampleis up to date with all required variables
- MongoDB Atlas database is created
- Database user is created with read/write permissions
- Network access allows connections from anywhere (0.0.0.0/0)
- Connection string is ready
- Google Cloud project is created
- OAuth 2.0 Client ID is created
- Authorized redirect URIs include production URL
- Client ID and Client Secret are ready
Have these values prepared:
-
MONGO_URL- MongoDB connection string -
SESSION_KEY- Random secret (32+ characters) -
JWT_SECRET- Random secret (32+ characters) -
GOOGLE_CLIENT_ID- From Google Cloud Console -
GOOGLE_CLIENT_SECRET- From Google Cloud Console -
BACKEND_URL- Will behttps://your-app-name.onrender.com -
FRONTEND_URL- Your frontend URL -
APP_REDIRECT_URL- Mobile app deep link -
MCP_SERVER_URL- MCP server URL (if applicable) -
SENDGRID_API_KEY- SendGrid key (if using email) -
SENDGRID_FROM_EMAIL- Email sender address (if using email)
- All router files are properly imported in
app.js - Error handling middleware is in place
- Health check endpoint (
/) is working - CORS is properly configured
- Port is read from
process.env.PORT
- Go to Render: https://dashboard.render.com
- New Web Service: Click "New +" → "Web Service"
- Connect Repository: Link your GitHub/GitLab account
- Configure Service:
- Name:
nirveonx-app-backend - Runtime: Node
- Build:
npm install - Start:
npm start
- Name:
- Add Environment Variables: Copy from your
.envfile - Deploy: Click "Create Web Service"
After successful deployment:
- Visit your app URL to verify it's running
- Check logs for any errors
- Test health check endpoint
- Update Google OAuth redirect URIs with production URL
- Test authentication flow
- Test API endpoints
- Update mobile app with production backend URL
Build fails: Check Node.js version in logs App won't start: Verify all environment variables are set Database errors: Check MongoDB connection string and network access OAuth errors: Verify redirect URIs in Google Cloud Console
- Free tier spins down after 15 minutes of inactivity
- First request after spin-down takes 30-60 seconds
- Consider upgrading to Starter plan ($7/month) for production
- Full deployment guide: DEPLOYMENT.md
- Render documentation: https://render.com/docs
- MongoDB Atlas: https://cloud.mongodb.com