# π°πͺ BizBot Kenya β WhatsApp Commerce Platform
> AI-powered WhatsApp bot for Kenyan small businesses. Customers chat β AI replies β Orders booked β M-Pesa confirmed β Dashboard updated.
---
## ποΈ Architecture
```
Customer (WhatsApp)
β text message
βΌ
Meta Cloud API βββΊ Railway (Express) βββΊ OpenAI GPT-4o-mini
β β AI reply
ββββββββββββββββββββββββ
β
Supabase DB
(Postgres + Realtime)
β
Vercel (React)
(Live Dashboard)
β
M-Pesa STK Push (Daraja)
```
---
## π Setup Guide
### Prerequisites
- Node.js 18+
- Supabase project (already created β
)
- OpenAI API key (already have β
)
- Railway account (already have β
)
- Vercel account (already have β
)
- Meta Developer account + WhatsApp Business app
---
### Step 1 β Clone & Install
```bash
git clone
github.com
cd bizbot-kenya
cp .env.example backend/.env
cp .env.example frontend/.env.local # rename VITE_ vars
npm run install:all
```
---
### Step 2 β Supabase Setup
1. Go to your Supabase Dashboard
2. Open **SQL Editor**
3. Run migrations **in order**:
```sql
-- Paste and run each file:
supabase/migrations/001_schema.sql
supabase/migrations/002_rls.sql
supabase/migrations/003_functions.sql
```
4. Run seed data (optional demo data):
```sql
supabase/seed.sql
```
5. Enable **Realtime** for the `bizbot_realtime` publication:
- Go to Database β Replication β enable `bizbot_realtime`
6. Copy your credentials from Project Settings β API:
```
SUPABASE_URL=
xxx.supabase.co
SUPABASE_SERVICE_KEY=eyJ... (service_role key)
VITE_SUPABASE_ANON_KEY=eyJ... (anon/public key)
```
---
### Step 3 β Meta WhatsApp Cloud API Setup
1. Go to developers.facebook.com
2. Create a new App β Business β Add WhatsApp product
3. From **WhatsApp β API Setup**:
- Copy **Phone Number ID** β `WHATSAPP_PHONE_NUMBER_ID`
- Copy **WhatsApp Business Account ID** β `WHATSAPP_BUSINESS_ACCOUNT_ID`
- Generate a **Temporary/Permanent Token** β `WHATSAPP_TOKEN`
4. From **App Settings β Basic**:
- β¦