DataBased-chatbot

#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

  1. Create a virtual env and install:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Copy environment file and fill keys:
cp .env.example .env
# edit .env to add TWILIO / OPENAI / UPI values
  1. Run the app:
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

Next steps

If you want, I can now implement the WhatsApp webhook routing for menu flows and OTP end-to-end.