Setu ("bridge" in Hindi) is a server-owned procurement pipeline that turns vendor WhatsApp messages — voice notes, text, and delivery photos — into structured purchase-order updates. The dashboard is a live window into that pipeline; the product is the workflow running on the server.
Built for the Kaya AI India Hackathon 2026 (Track 2: Supply Chain).
| Layer | What it does | Where it lives |
|---|---|---|
| WhatsApp webhook | Ingest vendor messages, transcribe voice, extract structured PO updates | POST /api/webhook/whatsapp |
| Vision / GRN | Verify delivery photos against POs via Claude Vision | Same webhook, photo branch |
| Agent loop | Auto-nudge stale vendors, escalate after 2 unanswered nudges | POST /api/agent/nudge (Vercel Cron) |
| PO API | Read/write purchase orders for dashboard and integrations | GET/POST /api/po |
| Dashboard | Kanban board + PO detail (read-only view of pipeline state) | /dashboard |
| Layer | Choice | Hosting |
|---|---|---|
| API + frontend | Next.js 14 (App Router, TypeScript) | Vercel |
| Database | PostgreSQL via Supabase (Neon also works) | Supabase or Neon |
| Twilio Sandbox | Twilio | |
| Voice transcription | Deepgram | Deepgram API |
| LLM (extraction + vision) | Anthropic Claude | Anthropic API |
git clone <repo-url>
cd Setu
npm install
cp .env.example .env.local # fill in keys — see docs/environment.md
# Run supabase/schema.sql in your Supabase SQL editor
npm run seed
npm run devOpen http://localhost:3000/dashboard.
For PM/engineer access flow, open http://localhost:3000/login.
Full setup: docs/setup.md
Beginner / junior dev: start with docs/setup-beginner.md
Copy .env.example → .env.local and fill in:
| Variable | Service | Get it from |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase | Project Settings → API |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase | Project Settings → API |
SUPABASE_SERVICE_ROLE_KEY |
Supabase | Project Settings → API (server only) |
ANTHROPIC_API_KEY |
Claude | console.anthropic.com |
DEEPGRAM_API_KEY |
Deepgram | console.deepgram.com |
TWILIO_ACCOUNT_SID |
Twilio | Twilio Console |
TWILIO_AUTH_TOKEN |
Twilio | Twilio Console |
TWILIO_WHATSAPP_NUMBER |
Twilio | Sandbox default: whatsapp:+14155238886 |
CRON_SECRET |
Self | Any random string (protects agent endpoint) |
NEXT_PUBLIC_CRON_SECRET |
Self | Same value (dashboard trigger button) |
AUTH_SECRET |
Self | Random secret for session signing (login/signup flow) |
Details: docs/environment.md
| Doc | Description |
|---|---|
| docs/setup-beginner.md | Start here — beginner setup (junior devs) |
| docs/setup-supabase.md | Database setup step-by-step |
| docs/setup-twilio.md | WhatsApp / Twilio sandbox setup |
| docs/setup-local-demo.md | Rehearse full demo locally |
| docs/setup.md | End-to-end setup from zero |
| docs/architecture.md | Server workflow and pipeline design |
| docs/api.md | API route reference |
| docs/hosting.md | Deploy to Vercel + Supabase |
| docs/build.md | Dev, build, seed, and lint commands |
| docs/folder-structure.md | Repo layout explained |
| docs/database.md | Schema, Supabase vs Neon |
| docs/pipeline-events.md | Pipeline audit log reference |
| docs/demo-script.md | 2-minute hackathon demo script |
| docs/troubleshooting.md | Production troubleshooting |
| docs/roadmap.md | Post-hackathon roadmap |
| docs/PROJECT_BRIEF.md | Elaborate project brief, use cases, MVP scope |
| docs/render.md | Render deployment for MVP hosting |
npm run dev # local dev server (port 3000)
npm run build # production build
npm run start # run production build locally
npm run seed # load demo vendors + POs into Supabase
npm run export:pos # export POs as JSON
npm run check:webhook # verify webhook endpoint is livelib/pipeline/webhook-router.ts ← every WhatsApp message
lib/pipeline/text-handler.ts ← text → Claude → PO update
lib/pipeline/voice-handler.ts ← voice → Deepgram → text
lib/pipeline/photo-handler.ts ← photo → Claude Vision → GRN
lib/agent/run.ts ← autonomous nudge + escalation
lib/db/* ← repository layer
Deploy to Vercel or Render — see docs/render.md.
Health check: GET /api/health/ready
Private — Kaya AI India Hackathon 2026 submission.