WAPPX is a WhatsApp Business automation and CRM. It connects the Meta WhatsApp Cloud API, Facebook Messenger, and Instagram to a workspace for live chat, visual flow automation, catalogs, orders, campaigns, templates, contacts, and support tickets.
Client workspaces live at /app. Super-admin client and ticket management lives at /admin. Inbound Meta events arrive at /api/webhook.
- Next.js 16 (App Router) and React 19
- TypeScript
- Tailwind CSS 4
- Supabase (
@supabase/supabase-js) for data, Auth, Storage uploads, and realtime - Meta Graph API v21.0 (
src/lib/meta-client.ts) @xyflow/reactfor the flow builder- Recharts for dashboard charts
- Three.js, OGL, AOS, and Lenis on the landing page
- Lucide React icons
The client sidebar covers Dashboard, Live Inbox, Order Management, Catalog, Campaigns, Templates, Integrations, Flows & Automations, Simulator, Contacts, and Settings. Support tickets are available from the workspace. Admin mode lists clients and tickets.
Public routes:
| Path | Purpose |
|---|---|
/ |
Landing page and sign-in |
/login |
Email and password sign-in (Supabase Auth) |
/app |
Client workspace |
/admin |
Super-admin clients and tickets |
/privacy |
Privacy policy |
/data-deletion |
Data deletion instructions |
Sign-in stores the session in the browser (src/lib/auth-session.ts).
-
Install dependencies (this repo uses the npm lockfile):
npm install
-
Copy the env template and fill in your own values. Do not commit
.env.local.cp .env.example .env.local
-
In the Supabase SQL editor, run
supabase/schema.sql. That creates contacts, messages, flows, catalogs, orders, clients, Meta config, and support tickets, and enables realtime on those tables. Optional demo rows are insupabase/seed.sql. -
Start the app:
npm run dev
Open http://localhost:3000.
-
In the Meta Developer console, set the WhatsApp (and Messenger / Instagram) webhook callback to
{NEXT_PUBLIC_APP_URL}/api/webhook. Use the same verify token asMETA_VERIFY_TOKEN. Per-client phone numbers, access tokens, and verify tokens are saved in themeta_configtable from Settings.GET /api/webhookchecks those rows before the env fallback.
The app reads these variables (see .env.example):
| Variable | Where it is used |
|---|---|
NEXT_PUBLIC_APP_URL |
Site metadata, sitemap, robots, and the webhook URL shown in Settings |
NEXT_PUBLIC_SUPABASE_URL |
Browser and server Supabase clients, and uploads |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Browser Supabase client; server fallback when the service role key is unset |
SUPABASE_SERVICE_ROLE_KEY |
Server admin client (src/lib/supabase/server.ts) and uploads |
META_VERIFY_TOKEN |
Fallback hub.verify_token for GET /api/webhook and diagnostics |
META_ACCESS_TOKEN |
Fallback Graph token for GET /api/whatsapp/media/[id] when meta_config has no access token |
| Script | Command |
|---|---|
| Development server | npm run dev |
| Production build | npm run build |
| Production server | npm start |
| Lint | npm run lint |
src/app— pages and route handlers (api/webhook, WhatsApp, catalog, admin, support, upload)src/components— landing, workspace, inbox, flow builder, catalog, campaigns, settingssrc/lib— Supabase clients, Meta client, bot engine, auth sessionsupabase/schema.sqlandsupabase/seed.sql— database schema and optional seed data