#DataBased WhatsApp Chatbot
This repository contains a scaffold for a premium BSNL WhatsApp chatbot: FastAPI backend, SQLite DB models, WhatsApp webhook, OTP auth, and stubs for AI, voice, payments, and Fiber flows.
Quick start
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# edit .env to add TWILIO / OPENAI / UPI values
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
WhatsApp webhook
Configure your WhatsApp provider (Twilio / Meta Cloud API) to forward incoming messages to /webhook.
Mermaid workflow (paste into GitHub or Mermaid live editor):
flowchart TD
User-->WhatsAppChatbot
WhatsAppChatbot-->Menu[Main Menu]
Menu-->OTP[OTP Verification]
OTP-->FastAPI
FastAPI-->DB[Database / Services]
DB-->FastAPI
FastAPI-->WhatsAppChatbot
WhatsAppChatbot-->User
subgraph Escalation
UserIssue-->Chatbot
Chatbot-->TicketCreated
TicketCreated-->HumanAgent
end
Files added
app/main.py — FastAPI app + webhook and sample endpointsapp/db.py — SQLModel/SQLite engineapp/models.py — core models (User, Ticket, Transaction)app/services.py — business logic stubsapp/utils.py — OTP + helpersrequirements.txt — Python deps.env.example — env vars templateNext steps
If you want, I can now implement the WhatsApp webhook routing for menu flows and OTP end-to-end.