- Go to https://github.com/new
- Repository name:
portfolio-chatbot-widget - Description: "Self-hosted RAG chatbot widget for portfolio website"
- Choose Private or Public (your choice)
- DO NOT initialize with README, .gitignore, or license (we already have these)
- Click "Create repository"
After creating the repo, run these commands:
cd /Users/arnob_t78/Projects/NextJS/portfolio-chatbot-widget
git remote add origin https://github.com/arnobt78/portfolio-chatbot-widget.git
git branch -M main
git push -u origin main- Go to https://vercel.com/new
- Import the
portfolio-chatbot-widgetrepository - Configure environment variables (see
.env.localfor all required keys):UPSTASH_REDIS_URLUPSTASH_REDIS_TOKENHUGGING_FACE_API_KEYGOOGLE_GEMINI_API_KEYOPENROUTER_API_KEYGROQ_API_KEY(optional)OPENAI_API_KEY(optional, if you have it)NEXT_PUBLIC_CHATBOT_URL- Leave this EMPTY for first deployment (it has a fallback, and you'll update it after deployment)
- Click "Deploy"
- Wait for deployment to complete
- Copy your Vercel deployment URL (e.g.,
https://portfolio-chatbot-widget.vercel.app)
After deployment, run the seed endpoint:
curl -X POST https://your-vercel-url.vercel.app/api/seedYou should see: {"success":true,"count":20}
- Go back to Vercel dashboard → Your project → Settings → Environment Variables
- Add or update
NEXT_PUBLIC_CHATBOT_URLto your actual Vercel URL (e.g.,https://portfolio-chatbot-widget.vercel.app) - Save the environment variable
- Vercel will automatically trigger a new deployment, or you can manually redeploy
- Open your Vercel URL in a browser
- The widget button should appear in the bottom-right corner
- Click it and test a question like "Tell me about Arnob Mahmud"
- Verify RAG search and AI responses work
Once testing is successful, update your portfolio (portfolio-arnob-new):
- Edit
app/layout.tsxin your portfolio project - Add the widget script:
<script
dangerouslySetInnerHTML={{
__html: `
window.CHATBOT_BASE_URL = "https://your-vercel-url.vercel.app";
window.CHATBOT_TITLE = "Arnob's Assistant";
window.CHATBOT_GREETING = "👋 How can I help you today?";
window.CHATBOT_PLACEHOLDER = "Ask about Arnob...";
`,
}}
/>
<script
src="https://your-vercel-url.vercel.app/widget.js"
async
></script>- Test locally:
npm run devin your portfolio project - Deploy portfolio to Vercel
Once everything works on Vercel, you can deploy to your VPS via Coolify:
- Push to GitHub (already done)
- In Coolify, create a new application
- Connect to your GitHub repo
- Set all environment variables
- Deploy
- Update
NEXT_PUBLIC_CHATBOT_URLto your VPS domain - Update portfolio widget script to point to VPS domain