Skip to content

pguatibonza/python-whatsapp-bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Application Deployment Guide

This repository contains two services packaged as Podman containers:

  1. LangGraph Service (FastAPI AI agent exposing /chat endpoint)
  2. Quart App (handles WhatsApp webhooks and forwards messages to LangGraph)

Both services can be built and run locally using Podman. Follow the steps below to get everything up and running.


Prerequisites

  • Podman installed on your machine

  • A project root containing:

    • langgraph-service/ directory
    • meta_app/ directory
    • .env file with your environment variables

Environment Variables

Create a .env file in the project root with the following variables:

# Shared variables
APP_SECRET
ACCESS_TOKEN
APP_ID
APP_SECRET
RECIPIENT_WAID
VERSION=v19.0
PHONE_NUMBER_ID
VERIFY_TOKEN
LANGGRAPH_URL=http://langgraph-service:8000

Important: Do not surround values with quotes (") in your .env file.


Project Structure

project-root/
├── langgraph/
│   ├── __pycache__/
│   ├── graphrag_reduced/
│   ├── secrets/
│   ├── src/
│   ├── yamls/
│   ├── .env
│   ├── config.py
│   ├── Dockerfile
│   ├── main.py
│   ├── models.py
│   ├── README.md
│   └── requirements.txt
├── meta_app/
│   ├── app/
│   │   └── utils/whatsapp_utils.py
│   ├── .env
│   ├── Dockerfile
│   ├── requirements.txt
│   ├── run.py
│   ├── .gitignore
│   ├── README.md
│   └── supabase_setup.txt
└── README.md

1) Build the Images

a) LangGraph Service

cd langgraph
podman build -t langgraph-service .

b) Quart App

cd meta_-app
podman build -t meta_app .

2) Setup Networking

Create a user-defined Podman network to allow containers to communicate by name:

podman network create meta-net

3) Run the Containers

a) LangGraph Service

podman run -d \
  --name langgraph-service \
  --env-file .env \
  --network meta-net \
  -p 8000:8000 \
  langgraph-service

b) Quart App

podman run -d \
  --name meta_app \
  --env-file .env \
  --network meta-net \
  -p 8080:8080 \
  meta_app

Now:

  • LangGraph API is at http://localhost:8000/chat
  • Quart App (WhatsApp webhook) is at http://localhost:8080 (adjust your webhook route if different)

4) Testing

Test LangGraph Directly

curl -X POST http://localhost:8000/chat \
  -H "Content-Type: application/json" \
  -d '{"wa_id":"test","message":"Hola"}'

About

Build AI WhatsApp Bots with Pure Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 70.1%
  • Python 29.6%
  • Dockerfile 0.3%