Handling and processing Incoming webhook request configured at Glific.
- pyenv
- python 3.12
-
Clone the repository
git clone https://github.com/DostEducation/whatsapp-webhook-analytics.git
-
Switch to project folder and setup the vertual environment
cd whatsapp-webhook-analytics python -m venv venv -
Activate the virtual environment
For Windows
venv\Scripts\Activate.ps1
For Mac
source ./venv/bin/activate -
Install the dependencies:
pip install -r requirements.txt
-
Set up your .env file by copying .env.example
cp .env.example .env
-
Add/update variables in your
.envfile for your environment. -
Run these commands to add environment variables in the system.
For Windows
$env:FLASK_APP="manage.py" $env:PYTHONPATH="<Path of your project, eg: C:\Users\whatsapp-webhook-analytics>"
For Mac
export FLASK_APP=manage.py export PYTHONPATH=path-of-the-project
-
Upgrade DB to the latest version using this command.
flask db upgrade
-
Run the following command to get started with pre-commit
pre-commit install
-
Start the server by following command
functions_framework --target=handle_payload --debug