A Node.js server that:
Hosting → Railway. It’s the right choice for this. You connect it to a GitHub account, paste your code, and it’s live with a public URL in about 5 minutes. Free tier handles POC’s volume easily. No servers to manage, no command line knowledge needed beyond copy-paste.
Meta WhatsApp Business API is simply a Meta product that lets a server receive and send WhatsApp messages automatically. You apply through Meta’s developer portal, get a test phone number immediately, and are sending/receiving messages in about 20 minutes. It’s free for the volume POC needs.
Google Sheets as database — perfect for the MVP. The webhook reads worker registrations from one sheet and writes child records to another. No new database to set up. Your existing spreadsheet structure already works.
6 code files, each with one job:
server.js — starts the web server. Receives the WhatsApp ping from Meta, responds immediately (so Meta doesn’t resend), then hands the message to the processor.
processor.js — the brain. Looks up the sender, determines what stage the video is for, and calls the right function. Handles all the WhatsApp reply messages that Let sees.
whatsapp.js — talks to Meta’s API. Downloads videos, sends text messages back, parses the video caption to determine BEFORE/DURING/AFTERCARE/HOME.
sheets.js — reads and writes your existing Google Sheet. Looks up workers by phone number, writes new children, updates stages as videos come in.
youtube.js — uploads every video automatically with the correct title format matching your existing convention (e.g. “AMINA HASSAN (11156) – BEFORE VIDEO”).
contract.js — calls the smart contracts on Base. Registers children on-chain and extends the hash chain at each proof step.
Read the README first — it has the exact setup steps in order. The sequence is: Meta WhatsApp account → Google Service Account → Railway deployment → connect the two together. Total time about 35–40 minutes.
The one thing to be aware of: the contract calls are wired up but need your deployed contract addresses in the .env file. Until those are filled in, the webhook runs perfectly — registering children in your Google Sheet, uploading to YouTube, and replying to workers — it just skips the on-chain step gracefully without crashing.
That means you can test the full WhatsApp → Sheets → YouTube flow right now, and add the blockchain layer once your contracts are deployed to Base Mainnet.
Receives WhatsApp videos from outreach workers → uploads to YouTube → calls smart contracts on Base → updates your Google Sheet → replies to the worker.
Getting a Permanent Access Token:
This allows the webhook to read/write your Google Sheet and upload to YouTube.
Share your Google Sheet with the service account:
Add two new tabs to your sheet:
If verification passes (you’ll see a ✓), your webhook is live.
Add a row manually:
phone | worker_code | name | trust | wallet | rating | cases |
|---|---|---|---|---|---|---|
+255711234567 | 145LET | Let Mwangi | HIGH | 0x… | 4.8 | 147 |
Phone must include country code with + prefix.
Send a video to your test WhatsApp number (the one from Meta’s dashboard). You should receive a reply within 90 seconds.
Test sequence:
poc-webhook/
├── server.js ← Entry point — starts the web server
├── src/
│ ├── processor.js ← Brain — decides what to do with each message
│ ├── whatsapp.js ← Meta API — send/receive messages and videos
│ ├── sheets.js ← Google Sheets — read/write records
│ ├── youtube.js ← YouTube — upload videos automatically
│ └── contract.js ← Smart contracts — register/update on Base blockchain
├── package.json
├── .env.example ← Copy to .env and fill in your values
└── README.md
“Webhook verification failed” → Check WHATSAPP_VERIFY_TOKEN in Railway matches what you entered in Meta
“Your number is not registered” → Add the worker’s phone to the Workers sheet with + prefix
“YouTube upload failed” → Make sure the YouTube channel is linked to the same Google account as your service account, and YouTube Data API v3 is enabled
“Contract call failed (non-fatal)” → This is expected until you fill in CONTRACT_OUTCOME_ADDRESS. The Google Sheet still records everything correctly. Add the contract address when you’ve deployed to Base.
Service | Cost |
|---|---|
Railway hosting | Free tier (500 hours/month) — sufficient for POC MVP |
Meta WhatsApp API | Free up to 1,000 conversations/month |
Google Sheets API | Free |
YouTube Data API | Free (10,000 units/day — 1 video upload ≈ 1,600 units) |
Base blockchain gas | ~$0.001 per transaction |