- A Netlify account
- Your repository hosted on GitHub, GitLab, or Bitbucket
- Environment variables configured
Set these environment variables in your Netlify dashboard (Site settings → Environment variables):
MONGODB_URI- Your MongoDB connection stringNEXTAUTH_SECRET- A random secret for NextAuth.jsNEXTAUTH_URL- Your Netlify site URL (e.g., https://your-site.netlify.app)NEXT_PUBLIC_BACKEND_URL- External backend URL:https://focus-mentor-backend.onrender.comNODE_ENV- Set toproduction
GOOGLE_CLIENT_ID- For Google OAuthGOOGLE_CLIENT_SECRET- For Google OAuthGROQ_API_KEY- For AI servicesOPENAI_API_KEY- If using OpenAI- Any other API keys your app requires
- Push your code to GitHub/GitLab/Bitbucket
- Login to Netlify Dashboard
- Click "New site from Git"
- Connect your repository
- Netlify will automatically detect the build settings from
netlify.toml - Add your environment variables
- Deploy!
- Run
npm run buildlocally - Drag and drop the
.nextfolder to Netlify deploy area - Configure environment variables manually
- Make sure your MongoDB instance allows connections from Netlify
- Consider using MongoDB Atlas for better reliability
- Whitelist Netlify's IP ranges or use 0.0.0.0/0 (less secure)
- Your current file upload functionality may not work on Netlify
- Consider using cloud storage (AWS S3, Cloudinary) for file uploads
- The
uploads/directory will be ephemeral in serverless functions
- Netlify Functions don't support WebSocket connections
- Your Socket.IO features won't work
- Consider using Netlify's real-time features or external WebSocket services
- Netlify Functions have a 10-second timeout on the free plan
- 26 seconds on Pro plans
- Optimize long-running operations
- Check the build logs in Netlify dashboard
- Ensure all dependencies are in package.json
- Verify environment variables are set
- Check that serverless function is deployed correctly
- Verify environment variables are accessible
- Check function logs in Netlify dashboard
- Ensure MongoDB URI is correct
- Check if MongoDB Atlas allows Netlify connections
- Verify connection string format
- Test all functionality
- Update any hardcoded URLs to your Netlify domain
- Configure custom domain if desired
- Set up monitoring and analytics