This guide explains how to deploy both the backend Flask API and frontend React application to Render.
- Create a Render account
- Connect your GitHub repository to Render
- Ensure your code is pushed to GitHub
-
Push your code to GitHub with the
render.yamlfile in the root directory -
Create a new Blueprint on Render:
- Go to your Render dashboard
- Click "New" → "Blueprint"
- Connect your GitHub repository
- Render will automatically detect the
render.yamlfile - Click "Apply" to deploy both services
-
Set Environment Variables:
- The backend service will need:
OPENROUTER_API_KEY: Your OpenRouter API keyFLASK_ENV: Set toproductionSECRET_KEY: Will be auto-generated
- The backend service will need:
-
Create a new Web Service:
- Go to Render dashboard → "New" → "Web Service"
- Connect your GitHub repository
- Configure:
- Name:
conversational-chatbot - Environment:
Python 3 - Build Command:
pip install -r requirements.txt - Start Command:
python app.py - Root Directory: Leave empty (root of repo)
- Name:
-
Set Environment Variables:
OPENROUTER_API_KEY: Your OpenRouter API keyFLASK_ENV:productionSECRET_KEY: Generate a secure random string
-
Add Persistent Disk:
- Name:
chatbot-disk - Mount Path:
/opt/render/project/src/instance - Size: 1 GB
- Name:
-
Create a new Static Site:
- Go to Render dashboard → "New" → "Static Site"
- Connect your GitHub repository
- Configure:
- Name:
chatbot-frontend - Build Command:
cd frontend && npm ci && npm run build - Publish Directory:
frontend/build - Root Directory: Leave empty
- Name:
-
Set Environment Variables:
REACT_APP_API_URL:https://conversational-chatbot.onrender.com(your backend URL)
The render.yaml file in the root directory contains the complete configuration for both services.
The frontend uses .env.production for production environment variables.
After successful deployment:
- Backend API:
https://conversational-chatbot.onrender.com - Frontend:
https://chatbot-frontend.onrender.com
-
Build Failures:
- Check the build logs in Render dashboard
- Ensure all dependencies are listed in
package.jsonandrequirements.txt - Verify Node.js version compatibility
-
API Connection Issues:
- Verify
REACT_APP_API_URLpoints to the correct backend URL - Check CORS configuration in the Flask backend
- Ensure backend is running and accessible
- Verify
-
Database Issues:
- Verify persistent disk is properly mounted
- Check database initialization in the Flask app
- Access logs through Render dashboard
- Monitor service health and performance
- Set up alerts for service downtime
OPENROUTER_API_KEY: Your OpenRouter API keyFLASK_ENV:productionSECRET_KEY: Auto-generated secure key
REACT_APP_API_URL: Backend service URLREACT_APP_DEBUG:false
- Render free tier has limitations (services sleep after inactivity)
- Consider upgrading to paid plans for production use
- Both services will have HTTPS enabled automatically
- Database data persists with the mounted disk