Kiosk AI: WhatsApp commerce for SMEs (n8n, Claude, Selcom, Yango)
# Kiosk AI
**Repository:**
github.com
WhatsApp automation for SMEs in Tanzania: conversational AI (Claude), deterministic checkout via WhatsApp Flows + Google Sheets, Selcom payments, and bodaboda dispatch (custom fleet first, Yango fallback). Orchestration runs in **n8n**; this repo holds workflow exports, Python snippets for n8n Code nodes, prompts, and Docker-based run instructions.
## Prerequisites
- Docker and Docker Compose v2
- A Google Sheet with the tabs/columns described in `docs/IMPLEMENTATION_GUIDE.md`
- For real webhooks: a **public HTTPS URL** (e.g. ngrok in dev, your domain in prod)
## Quick start (local development)
1. **Environment**
```bash
cp .env.example .env
```
Edit `.env` and set at least:
- `WEBHOOK_URL` — your public base URL (ngrok/cloudflared in dev), e.g. `
abc123.ngrok-free.app`
- `SELCOM_WEBHOOK_URL` — usually `https:// /webhook/selcom-callback`
- `GSHEET_CONFIG_ID` — Google Spreadsheet ID
- API keys and secrets as you obtain them
For the Claude system prompt, use the text in `prompts/claude_system_prompt.txt` (paste into `.env` as one line or with `\n` escaped).
2. **Start n8n + Postgres**
```bash
docker compose up -d
```
3. **Open n8n**
- UI:
localhost
- Complete first-time setup if prompted.
4. **Import the workflow**
- In n8n: **Workflows → Import from File**
- Choose `workflows/kiosk-ai-v1.full.n8n.json` (full routing) or `workflows/kiosk-ai-v1.n8n.json` (minimal skeleton)
5. **Connect Google Sheets** in the n8n UI (OAuth credentials) and align sheet column names with the workflow.
6. **Expose webhooks**
Point Meta WhatsApp and Selcom callbacks at your public URL:
- WhatsApp: `https:// /webhook/wa-inbound`
- Selcom: `https:// /webhook/selcom-callback`
## Production (nginx + TLS)
Use the production Compose file and helper script:
```bash
cp .env.example .env
# Edit .env: N8N_HOST, N8N_PROTOCOL=https, WEBHOOK_URL, N8N_SECURE_COOKIE=true, strong secrets
# Put TLS certs in …