This guide will help you deploy your AI Bid Generator with:
- Backend (FastAPI) → Render
- Frontend (React + Vite) → Vercel
- Ensure your
backend/main.pyhas CORS configured for all origins (already updated) - Create a
requirements.txtin the backend folder if not present
- Go to render.com and sign up/login
- Click New + → Web Service
- Connect your GitHub repository
- Configure:
- Name:
ai-bid-generator-api(or your choice) - Root Directory:
backend - Environment:
Python 3 - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT
- Name:
- Add Environment Variables:
GEMINI_API_KEY: Your Gemini API keyOPENAI_API_KEY: Your OpenAI API key (if using)- Any other config from your
.envfile
- Click Create Web Service
- Wait for deployment (5-10 minutes)
- Copy your Render URL:
https://your-app-name.onrender.com
- In the
frontendfolder, create a.envfile:Replace with your actual Render URL (without trailing slash)VITE_API_URL=https://your-app-name.onrender.com
- Go to vercel.com and sign up/login
- Click Add New → Project
- Import your GitHub repository
- Configure:
- Framework Preset: Vite
- Root Directory:
frontend - Build Command:
npm run build - Output Directory:
dist
- Add Environment Variable:
- Key:
VITE_API_URL - Value:
https://your-app-name.onrender.com(your Render URL)
- Key:
- Click Deploy
- Wait for deployment (2-3 minutes)
- Your app is live! 🎉
- Open your Vercel URL
- Try generating a bid
- Check that the frontend connects to the backend successfully
- Monitor Render logs for any errors: Dashboard → Your Service → Logs
- Already fixed! Backend now accepts all origins with
allow_origins=["*"]
- Make sure your
VITE_API_URLin Vercel environment variables matches your Render URL exactly - Verify the backend is running on Render (check logs)
- Verify environment variables are set correctly in Render dashboard
- Make sure there are no extra spaces in API keys
- Free tier Render services spin down after inactivity
- First request after inactivity may take 30-60 seconds
- Push changes to your GitHub repository
- Render will automatically rebuild and redeploy
- Push changes to your GitHub repository
- Vercel will automatically rebuild and redeploy
- Render: Free tier available (750 hours/month)
- Vercel: Free tier includes unlimited deployments
- Add custom domain (optional)
- Set up monitoring/analytics
- Configure GitHub Actions for CI/CD (optional)
- Add rate limiting for production use