A Next.js app that makes the HIVE marketing-agency-OS prototype functional with real data: auth, a SQLite-backed API, a WhatsApp lead-capture webhook, and an AI content-generation endpoint (real Claude API when ANTHROPIC_API_KEY is set, simulated output otherwise).
npm install
npx drizzle-kit push --force
npx tsx src/db/seed.ts
npm run devOpen http://localhost:3000 and log in with james@jdnexus.co / hive2026.
- The prototype UI (
public/prototype.html) is a single-file React app loaded via CDN scripts, served throughsrc/app/prototype/route.tsinside an iframe. src/components/HiveApp.tsxbridges the iframe to the real Next.js API viapostMessage.src/db/schema.tsdefines the Drizzle/SQLite schema; all tables are scoped byagencyIdfor multi-tenancy.- API routes under
src/app/api/*cover clients, jobs, approvals, leads, messages, invoices, and activity. src/app/api/whatsapp/webhookhandles the Meta WhatsApp Business verification handshake and inbound messages;src/app/api/whatsapp/simulateis a dev-only helper to exercise that flow without real Meta credentials.src/app/api/ai/generatecalls Claude whenANTHROPIC_API_KEYis set, otherwise returns realistic simulated variants.