How priyanshsaxena01/whatsapp-chatbot works
Project type and purpose
• This is a single-service chatbot application (backend only) that uses Python/Flask to expose a webhook endpoint. It integrates with the Meta WhatsApp Business Cloud API to present users with an interactive, button-driven conversation flow, backed by an in-memory session store and static content.
File structure
• Top-level files:
– app.py: contains the Flask server, webhook routes, conversation logic, state management, and outbound HTTP calls to WhatsApp.
– requirements.txt: lists dependencies (Flask, requests, python-dotenv).
– readme.md: project overview, setup, and runtime instructions.
– .gitignore: standard ignore patterns.
• No separate frontend, database, or microservices—everything lives in one Flask service.
README for architectural insights
• The service exposes a single /webhook route (for GET verification and POST message events).
• Outgoing messages use the WhatsApp Graph API via HTTP requests.
• User state is managed in a Python dict (user_sessions).
• All interactive content is hard-coded in the script.
• Deployment is flexible: locally via ngrok, on Heroku/Codespaces, etc.
Elements
• Clear labeled components (User, WhatsApp Cloud API, Flask Service, Session Store, Env Config, Deployment Layer).
– User → WhatsApp Cloud → Flask /webhook
– Flask → WhatsApp Cloud (sendMessage API) → User
– Internal service components (Flask app, session store) in another
– Configuration/deployment in a third