- Server: Deploy to Render.com
- Client: Deploy to Vercel.com
- Database: MongoDB Atlas (free tier)
- Go to render.com
- Sign up with GitHub
- Connect your GitHub account
- Click "New +" → "Web Service"
- Connect your GitHub repository:
saurav-kumar-sah-dev/SyncRunCode - Configure:
- Name:
syncruncode-backend - Root Directory:
server - Environment:
Node - Build Command:
npm install - Start Command:
npm start
- Name:
Add these environment variables in Render dashboard:
NODE_ENV=production
PORT=10000
JWT_SECRET=your-super-secure-jwt-secret-here
JWT_EXPIRE=7d
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/syncruncode
CORS_ORIGIN=https://your-client-domain.vercel.app
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
EXECUTION_TIMEOUT=5000
MAX_FILE_SIZE=10485760- Click "Create Web Service"
- Wait for deployment (5-10 minutes)
- Note the deployed URL (e.g.,
https://syncruncode-backend.onrender.com)
- Go to vercel.com
- Sign up with GitHub
- Connect your GitHub account
- Click "New Project"
- Import your repository:
saurav-kumar-sah-dev/SyncRunCode - Configure:
- Framework Preset:
Vite - Root Directory:
client - Build Command:
npm run build - Output Directory:
dist
- Framework Preset:
Add these environment variables in Vercel dashboard:
VITE_API_URL=https://syncruncode-backend.onrender.com/api
VITE_SOCKET_URL=https://syncruncode-backend.onrender.com- Click "Deploy"
- Wait for deployment (2-5 minutes)
- Note the deployed URL (e.g.,
https://syncruncode.vercel.app)
- Go to mongodb.com/atlas
- Sign up for free
- Create a new cluster
- Database Access: Create a user with read/write permissions
- Network Access: Add
0.0.0.0/0(allow all IPs) - Get Connection String: Copy the MongoDB URI
- Go to your Render service dashboard
- Update
MONGODB_URIwith your Atlas connection string - Redeploy the service
- Go to Render dashboard
- Update
CORS_ORIGINto your Vercel URL - Redeploy
- Go to Vercel dashboard
- Update
VITE_API_URLto your Render URL - Redeploy
curl https://syncruncode-backend.onrender.com/api/health- Visit your Vercel URL
- Try to register/login
- Test code compilation
- SSH into your Render service (if needed)
- Run:
npm run create-superadmin - Or use the admin creation API
After deployment, you'll have:
- Frontend:
https://syncruncode.vercel.app - Backend:
https://syncruncode-backend.onrender.com - API:
https://syncruncode-backend.onrender.com/api
-
CORS Errors
- Check CORS_ORIGIN in Render
- Ensure URLs match exactly
-
Database Connection
- Verify MongoDB Atlas connection string
- Check network access settings
-
Build Failures
- Check package.json scripts
- Verify all dependencies are listed
-
Environment Variables
- Ensure all required variables are set
- Check for typos in variable names
If you encounter issues:
- Check Render/Vercel deployment logs
- Verify environment variables
- Test API endpoints individually
- Check MongoDB Atlas connection
Happy Deploying! 🚀