- Frontend deployed to Netlify:
https://interview-prep-karo.netlify.app - Backend prepared for deployment
- CORS configured for production
- Backend deployed
- Frontend connected to backend
- Go to Railway.app
- Login with GitHub
- "New Project" → "Deploy from GitHub repo"
- Select your repo → Choose
backendfolder - Add environment variables:
MONGO_URI=your-mongodb-connection-string JWT_SECRET=your-super-secret-jwt-key GEMINI_API_KEY=your-gemini-api-key FRONTEND_URL=https://interview-prep-karo.netlify.app
- Go to Render.com
- "New" → "Web Service"
- Connect GitHub repo
- Build Command:
npm install - Start Command:
npm start - Add same environment variables
After deployment, you'll get a URL like:
- Railway:
https://your-app-name.railway.app - Render:
https://your-app-name.onrender.com
- Go to Netlify Dashboard
- Site Settings → Environment Variables
- Add:
VITE_API_BASE_URL = https://your-backend-url - Trigger redeploy
- Backend health check:
https://your-backend-url/api/test - Frontend loads without CORS errors
- Login/Register works
- API calls successful
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/interview-prep
JWT_SECRET=super-secret-key-make-it-long-and-random
GEMINI_API_KEY=your-gemini-api-key-here
FRONTEND_URL=https://interview-prep-karo.netlify.app
VITE_API_BASE_URL=https://your-backend-url.railway.app
After completing all steps:
- ✅ Frontend:
https://interview-prep-karo.netlify.app - ✅ Backend:
https://your-backend-url.railway.app - ✅ Full functionality with database and AI features
- Make sure
FRONTEND_URLis set in backend environment variables - Check backend CORS configuration includes your Netlify URL
- Verify all environment variables are set correctly
- Check backend logs for specific error messages
- Ensure
package.jsonhas correct scripts - Check Node.js version compatibility
- Verify
MONGO_URIis correct - Make sure MongoDB allows connections from your hosting provider's IPs
- Railway Docs: https://docs.railway.app
- Render Docs: https://render.com/docs
- Netlify Docs: https://docs.netlify.com