This guide covers deploying TaskFlow to Render using a monorepo structure.
- GitHub repository (already have your code pushed)
- Render account (https://render.com)
- MongoDB Atlas account (for database)
- Generated JWT_SECRET
- Go to MongoDB Atlas
- Create a cluster (free tier available)
- Create a database user with username and password
- Get connection string:
mongodb+srv://username:password@cluster.mongodb.net/taskflow - Keep this safe - you'll need it for environment variables
-
Create Web Service on Render:
- Go to Render Dashboard
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Select your TaskFlow repository
-
Configure Backend Service:
- Name: taskflow-backend (or similar)
- Root Directory:
backend⚠️ (Important!) - Runtime: Node
- Build Command:
npm install - Start Command:
node src/index.js - Instance Type: Free (or Starter if Free unavailable)
-
Add Environment Variables:
- Click "Environment"
- Add these variables:
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/taskflow JWT_SECRET=generate_a_strong_random_secret_here NODE_ENV=production PORT=5000
-
Deploy:
- Render will automatically build and deploy
- Copy your service URL (e.g.,
https://taskflow-backend.onrender.com) - Wait for "Live" status (2-3 minutes)
# 1. Install Render CLI
npm install -g @render-com/cli
# 2. Log in
render login
# 3. Deploy backend
cd backend
render deploy --name taskflow-backend-
Create Web Service for Frontend:
- "New +" → "Web Service"
- Connect GitHub repository
- Select TaskFlow repo
-
Configure Frontend:
- Name: taskflow-frontend
- Root Directory:
frontend - Runtime: Node
- Build Command:
npm run build - Start Command:
npx serve -s build - Instance Type: Free
-
Add Environment Variables:
REACT_APP_API_URL=https://taskflow-backend.onrender.com NODE_ENV=production -
Deploy and wait for live status
-
Push to GitHub:
git push origin main
-
Connect to Vercel:
- Go to Vercel
- Import your repository
- Select project
-
Configure Frontend:
- Framework: Create React App
- Root Directory:
frontend - Build Command:
npm run build(auto-detected) - Output Directory:
build
-
Set Environment Variables:
REACT_APP_API_URL=https://taskflow-backend.onrender.com -
Deploy - Vercel will handle it automatically
curl https://taskflow-backend.onrender.com/health- Open your frontend URL in browser
- Try logging in / creating tasks
- Check browser console for errors
| Issue | Solution |
|---|---|
| 502 Bad Gateway | Check backend logs on Render, verify environment variables |
| CORS errors | Ensure backend CORS config includes frontend URL |
| MongoDB connection fails | Verify MONGODB_URI and IP whitelist in Atlas |
| Blank frontend | Check REACT_APP_API_URL in environment variables |
| API calls timeout | Free tier on Render may be slow - upgrade if needed |
- Go to Web Service → Settings → Domains
- Add custom domain
- Update DNS records
- Go to Project Settings → Domains
- Add custom domain
- Follow DNS instructions
- ✅ MONGODB_URI
- ✅ JWT_SECRET
- ✅ NODE_ENV=production
- ✅ PORT=5000
- ✅ REACT_APP_API_URL=
- ✅ NODE_ENV=production
- Render Dashboard → Select Service → Logs
- Render provides uptime status
- Push to GitHub → Auto-redeploy (if connected)
- Or manually redeploy from Render Dashboard
# Check if backend is running
curl -I https://taskflow-backend.onrender.com
# View render.yaml (backend config)
cat backend/render.yaml
# Test API locally before deployment
cd backend
npm start
curl http://localhost:5000- ✅ Deploy backend first
- ✅ Get backend URL
- ✅ Update frontend REACT_APP_API_URL
- ✅ Deploy frontend
- ✅ Test end-to-end
- ✅ Add custom domains (optional)
Need Help?
- Render Docs: https://render.com/docs
- MongoDB Docs: https://docs.mongodb.com
- Vercel Docs: https://vercel.com/docs