How mohansai5942/brandique-chatbot works
BrandiQue ChatBot is a browser-based customer-support assistant. A visitor sends a message through the chat UI; the server uses conversation context and built-in business answers, optionally consults Google Sheets for missing facts, and generates a response through an AI provider when needed. The README documents OpenRouter; sampled server code also exposes Gemini support. The server excerpts omit parts of the request orchestration, so uncertain internal call links are left out.
Main entry points: server.js Chat endpoint · app.js Chat client logic · index.html Chat interface · Code.gs Sheets script
Components 14
Chat client
- Chat interface
public/index.html - Chat client logic
public/app.js - Browser history
public/app.js
Chat runtime
- HTTP server
server.js - Chat endpoint
server.js - Health endpoint
server.js
Business knowledge
- Conversation memory
server.js - Built-in answers
server.js - Sheets lookup
server.js - Sheets script
google-apps-script/Code.gs
External integrations
- OpenRouter
- Gemini
- Google Sheets
Other components
- Visitor
Connections 15
- Visitor → Chat interface: uses
- Chat interface → Chat client logic: submits messages
- Chat client logic → Browser history: reads and writes
- Chat client logic → Chat endpoint: posts conversation
- HTTP server → Chat endpoint: serves
- HTTP server → Health endpoint: serves
- Chat endpoint → Conversation memory: extracts context
- Chat endpoint → Built-in answers: checks facts
- Chat endpoint → Sheets lookup: queries if needed
- Sheets lookup → Google Sheets: fetches knowledge
- Google Sheets → Sheets script: serves queries
- Chat endpoint → OpenRouter: requests generation
- Chat endpoint → Gemini: requests generation
- Chat endpoint → Chat client logic: returns reply
- Chat client logic → Chat interface: renders reply