Render's free tier sleeps after 15 minutes of inactivity. It takes 30-60 seconds to wake up on first request.
Test if backend is awake:
# Open this in your browser or use curl
https://retexture.onrender.com/healthExpected Response:
{"status":"healthy"}If you get 502 Bad Gateway:
- ✅ This is NORMAL - service is waking up
- ✅ Wait 30-60 seconds
- ✅ Try again
- ✅ Once it responds, try variations again
Pro Tip: Keep this tab open to ping every few minutes:
<!-- Save as wake-render.html and open in browser -->
<script>
setInterval(() => {
fetch('https://retexture.onrender.com/health')
.then(r => r.json())
.then(d => console.log('✓ Backend alive:', d))
.catch(e => console.log('✗ Waking up...', e));
}, 300000); // Every 5 min
</script>- Go to https://vercel.com/dashboard
- Select your
ReTextureproject - Go to Settings → Environment Variables
- Check
NEXT_PUBLIC_API_URLexists and equals:https://retexture.onrender.com - If missing or wrong, add/fix it
- Important: Go to Deployments → Click ••• → Redeploy
- Go to https://dashboard.render.com
- Click your
retexture-backendservice - Click Logs tab
- Look for errors when you try to generate variations
Common issues in logs:
GOOGLE_API_KEY not found→ Add it in Render environment variablesModuleNotFoundError→ Build may have failed, redeployPort already in use→ Render issue, redeploy service
Open the test file I created: backend-test.html in your browser
# Or test with curl
curl https://retexture.onrender.com/health
curl https://retexture.onrender.com/- Open your Vercel site: https://retexture.vercel.app
- Open Developer Tools (F12)
- Go to Console tab
- Try to generate variations
- Look for errors
Common errors:
❌ "Failed to fetch"
- Backend is down or sleeping
- Wrong backend URL
- Solution: Wait for backend to wake up
❌ "CORS error"
- Backend CORS not configured
- Solution: Check
app/main.pyhas CORS middleware (already added)
❌ "502 Bad Gateway"
- Backend is cold starting
- Solution: Wait 30-60 seconds and retry
❌ "Request timeout"
- Backend taking too long
- Solution: Check Render logs, may need to upgrade from free tier
- Backend responds at https://retexture.onrender.com/health
- Vercel has
NEXT_PUBLIC_API_URL=https://retexture.onrender.com - Vercel redeployed after adding env variable
- Render has
GOOGLE_API_KEYset - Waited 30-60 seconds for cold start on first request
- Browser console shows no errors
# Test variations endpoint (replace with actual base64 image)
curl -X POST https://retexture.onrender.com/generate/variations/stream \
-H "Content-Type: application/json" \
-d '{"image_data":"BASE64_IMAGE_HERE","concept":"product photography"}'In Vercel (Frontend):
// Add this to any page temporarily
console.log('Backend URL:', process.env.NEXT_PUBLIC_API_URL);
// Should show: https://retexture.onrender.comIn Render (Backend):
- Check Render dashboard → Environment → Variables
- Should have
GOOGLE_API_KEY
- 75% chance: Render free tier sleeping (wait 30-60 sec)
- 15% chance: Missing/wrong
NEXT_PUBLIC_API_URLin Vercel - 5% chance: Missing
GOOGLE_API_KEYin Render - 5% chance: Vercel not redeployed after env variable change
✅ Backend responds to /health in < 2 seconds
✅ Frontend shows "Starting AI service..." toast
✅ After 5-10 seconds, first variation appears
✅ All 3 variations generated within 30-45 seconds
Problem: Free tier sleeps = slow Solution: Upgrade to Render Starter ($7/month)
Benefits:
- ⚡ Always running (no cold starts)
- 🚀 Instant responses
- 💪 Better performance
- 📈 More RAM (512MB)
To upgrade:
- Go to Render dashboard
- Select your service
- Click Upgrade → Starter
- Confirm
Need more help? Check backend logs or DM me!