This guide explains how to deploy your Conversational Chatbot with:
- Backend: Flask API on Render
- Frontend: React app on Vercel
User → Vercel (Frontend) → Render (Backend API)
-
Go to Render Dashboard: https://dashboard.render.com
-
Connect GitHub Repository:
- Click "New +" → "Blueprint"
- Connect your GitHub account
- Select repository:
codebyArya-bit/Conversational-Chatbot - Branch:
main
-
Configure Service:
- Service will be auto-configured from
render.yaml - Service Name:
conversational-chatbot - Environment:
Python - Build Command:
pip install -r requirements.txt - Start Command:
python app.py
- Service will be auto-configured from
-
Set Environment Variables:
OPENROUTER_API_KEY=your_api_key_here FLASK_ENV=production SECRET_KEY=your_secret_key_here -
Deploy: Click "Apply" to start deployment
- API Base URL:
https://conversational-chatbot.onrender.com - Health Check:
https://conversational-chatbot.onrender.com/health - API Endpoints:
https://conversational-chatbot.onrender.com/api/*
npm install -g vercel
vercel logincd frontend
vercel --prod --name frontend-khaki-sigma- Project name:
frontend-khaki-sigma - URL:
https://frontend-khaki-sigma.vercel.app
The frontend is configured with:
- Build Command:
npm run build - Output Directory:
build - Framework: React
- Node Version: 18
services:
- type: web
name: conversational-chatbot
env: python
buildCommand: pip install -r requirements.txt
startCommand: python app.py
envVars:
- key: OPENROUTER_API_KEY
sync: false
- key: FLASK_ENV
value: production
- key: SECRET_KEY
generateValue: true
healthCheckPath: /# Production environment variables for Vercel deployment
# Backend API URL pointing to Render deployment
REACT_APP_API_URL=https://conversational-chatbot.onrender.com
REACT_APP_DEBUG=false
REACT_APP_ENV=production
REACT_APP_VERSION=1.0.0{
"buildCommand": "npm run build",
"outputDirectory": "build",
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
]
}- Ensure all changes are committed and pushed to GitHub
- Follow Render deployment steps above
- Wait for deployment to complete
- Test backend:
curl https://conversational-chatbot.onrender.com/health
- Navigate to frontend directory:
cd frontend - Deploy:
vercel --prod --name frontend-khaki-sigma - Confirm deployment to
https://frontend-khaki-sigma.vercel.app - Wait for deployment to complete
- Open frontend URL in browser
- Test user registration/login
- Test chatbot functionality
- Check browser console for API errors
- API Base:
https://conversational-chatbot.onrender.com - Health Check:
https://conversational-chatbot.onrender.com/health - Chat API:
https://conversational-chatbot.onrender.com/api/chat
- Primary URL:
https://frontend-khaki-sigma.vercel.app
curl https://conversational-chatbot.onrender.com/health
# Expected: {"status": "healthy"}- Open browser to your Vercel URL
- Should see the Student Technical Support homepage
- Check that logo and styling load correctly
- Register a new user account
- Login successfully
- Navigate to chat interface
- Send a test message
- Verify response from backend
-
CORS Errors
- Ensure Vercel frontend URL is in backend CORS_ORIGINS
- Check
app.pyCORS configuration
-
API Connection Failed
- Verify
REACT_APP_API_URLin frontend configuration - Check Render backend is running and accessible
- Verify
-
Environment Variables
- Ensure all required env vars are set in Render dashboard
- Redeploy after adding environment variables
-
Build Failures
- Check build logs in respective dashboards
- Verify all dependencies are listed correctly
- Render: View logs in Render dashboard
- Vercel: View deployment logs in Vercel dashboard
- Frontend: Use browser developer tools
- Auto-deploys on push to
mainbranch - Configured via GitHub integration
- Auto-deploys on push to
mainbranch - Configured via GitHub integration
- Preview deployments for pull requests
This hybrid deployment approach provides:
- Scalable Backend: Render's managed Python hosting
- Fast Frontend: Vercel's global CDN for React apps
- Cost Effective: Free tiers for both platforms
- Easy Maintenance: Separate deployment pipelines
Both services will auto-deploy when you push changes to GitHub, making development and maintenance seamless.