ShopMate is a WhatsApp-only stock assistant for kirana stores.
- WhatsApp receives voice/text sales update
- OpenAI extracts product and quantity
- Supabase stock updates
- WhatsApp confirmation reply
- Low-stock warning
- Summary command
WhatsApp → Express Webhook → OpenAI → Supabase → WhatsApp Reply
- Person A: AI + webhook
- Person B: database + WhatsApp sender
- Person C: integration + demo
npm install
Copy-Item .env.example .env
npm run dev- Create Supabase project
- Run
sql/schema.sql - Run
sql/seed.sql - Copy
SUPABASE_URLandSUPABASE_KEYinto.env
- Create Meta Developer app
- Add WhatsApp product
- Copy access token
- Copy phone number ID
- Set webhook callback URL:
https://YOUR_NGROK_URL/webhook
- Verify token:
shopmate123
Start the server in PowerShell:
npm run devOpen another PowerShell window and start ngrok:
ngrok http 3000Copy the HTTPS forwarding URL.
In Meta Developer Dashboard:
- Go to WhatsApp configuration
- Callback URL:
https://YOUR_NGROK_URL/webhook
- Verify token: same as
WEBHOOK_VERIFY_TOKENin.env - Subscribe to
messageswebhook field
Important: if ngrok restarts, the URL changes. Update the Meta webhook URL again.
npm run test:local- Send text:
3 soap, 5 Pepsi sold - Send voice note with same sale
- Send:
? - See summary
- Use
curl.exeinstead ofcurl - Use
Copy-Iteminstead ofcp - Use
New-Iteminstead oftouch - If PowerShell blocks scripts, run:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned- OpenAI mock mode still on
- WhatsApp mock mode still on
- Supabase env missing
- ngrok URL changed
- webhook verification failed