Go to https://render.com and sign up (free tier available)
- From Render Dashboard, click New → PostgreSQL
- Configure:
- Name:
assesly-db - Database:
assesly - User:
assesly_user - Region: Oregon (or closest to you)
- Plan: Free
- Name:
- Click Create Database
- Once created, copy the Internal Database URL (it looks like:
postgresql://user:pass@host/db)
-
Click New → Web Service
-
Connect your Git repository (GitHub/GitLab)
-
Configure the service:
- Name:
assesly-backend - Region: Oregon (same as database)
- Branch:
mainormaster - Root Directory:
backend - Runtime: Node
- Build Command:
npm install && npx prisma generate && npm run build - Start Command:
npx prisma migrate deploy && npm start - Plan: Free
- Name:
-
Add Environment Variables: Click "Advanced" → "Add Environment Variable":
NODE_ENV=production DATABASE_URL=<paste your Internal Database URL from Step 2> JWT_SECRET=<generate a random 32+ character string> CORS_ORIGINS=https://assesly.netlify.app PORT=10000 -
Click Create Web Service
Once your backend is deployed, you'll get a URL like:
https://assesly-backend.onrender.com
Update your Netlify environment variable:
cd frontend
netlify env:set VITE_API_URL "https://assesly-backend.onrender.com"Then redeploy frontend:
npm run build
netlify deploy --prod- Backend spins down after 15 minutes of inactivity
- First request after spin-down takes 30-50 seconds to wake up
- Database has 90-day expiry on free tier
Use this command to generate a secure JWT secret:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Your CORS_ORIGINS should include your Netlify frontend URL:
CORS_ORIGINS=https://assesly.netlify.app
Add more origins separated by commas for multiple domains:
CORS_ORIGINS=https://assesly.netlify.app,https://custom-domain.com
- View logs: Dashboard → Your Service → Logs
- Monitor health: Dashboard → Your Service → Metrics
- Database metrics: Dashboard → Database → Metrics
Render automatically deploys when you push to your connected Git branch.
- Verify DATABASE_URL is the Internal Database URL
- Check database is in same region as web service
- Ensure Prisma schema matches migrations
- Check Node version matches local (add
NODE_VERSION=20env var if needed) - Verify all dependencies are in package.json
- Check build logs for specific errors
- Run migrations manually from Render Shell:
npx prisma migrate deploy
- Or reset database (WARNING: deletes all data):
npx prisma migrate reset --force
Access Render Shell (under service's "Shell" tab):
# Check Prisma status
npx prisma migrate status
# View database
npx prisma studio
# Run seed
npm run seedFree tier limitations can be removed with paid plans ($7/month):
- No spin-down
- Faster performance
- More resources
- Persistent database