This manual documents the current application as built: its purpose, infrastructure, customer and operator usage, backend setup requirements, integrations, security posture, deployment expectations, and the remaining live-production configuration work still outstanding.
ChatCart is a multi-tenant SaaS application for businesses that sell, support, and manage customer interactions through WhatsApp. The product turns WhatsApp conversations into structured business operations.
Scattered WhatsApp sales and support activity becomes a shared inbox, order workflow, payment workflow, reporting layer, and management dashboard.
Businesses can reply faster, capture orders consistently, send payment requests, track performance, and prepare for live Meta operations.
The app supports two plans, Starter and Growth, with enforced feature gating and trial-to-billing logic.
Business owners, admins, agents, and viewers log into the tenant workspace to run daily operations.
/login for workspace accessInternal SaaS operators log into a separate operator console to manage tenants and monitor platform readiness.
/admin/login for operator accessPLATFORM_ADMIN_EMAILSThe product has two real plans. The distinction is enforced in the application and visible in the customer subscription experience.
| Capability | Starter | Growth |
|---|---|---|
| Monthly price | R99/mo | R199/mo |
| Seats included | 3 | 10 |
| Shared inbox | Included | Included |
| Order capture | Included | Included |
| Manual payment links | Included | Included |
| Template sync and send | Included | Included |
| Core reporting | Included | Included |
| Rules-based automations | Not included | Included |
| Advanced reporting | Not included | Included |
| PDF and Excel report exports | Not included | Included |
| Scheduled report emails | Not included | Included |
Next.js 15app/PostgreSQLPrismaRailway PostgreSQLDATABASE_URLVercelRailwayMeta Cloud APIPayFastCurrent high-level architecture Public app / Marketing pages -> Signup / Login / Forgot Password / Reset Password -> Customer workspace (/app/...) -> Platform operator console (/admin/...) Next.js server actions + route handlers -> Prisma ORM -> PostgreSQL database External systems -> Meta Cloud API + webhooks -> Billing provider (currently PayFast) -> Email webhook endpoint -> Cron scheduler for daily maintenance
/ landing page/signup plan-first signup/login customer login/forgot-password recovery request/reset-password password reset/app overview/app/getting-started onboarding checklist/app/inbox shared conversation workspace/app/reports reporting and exports/app/test-setup guided live validation/admin platform dashboard/admin/tenants all customer tenants/admin/tenants/[organizationId] per-tenant support view/admin/settings platform admin management, policy view, deletion requests, env summary/api/webhooks/whatsapp/api/whatsapp/connect/embedded-signup-session/api/whatsapp/connect/embedded-signup-callback/api/webhooks/payfast (production ITN endpoint)/api/webhooks/stripe (legacy)/api/internal/cron/daily/api/exports/[id]Getting Started./admin/login.The current environment surface is defined in .env.example and summarized in the operator console.
| Variable | Purpose | Status |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | Required |
APP_URL | Base URL for links, callbacks, and email links | Required |
APP_NAME | Display/application name | Required |
BILLING_PROVIDER | Selects the live billing provider | Required for production |
SESSION_SECRET | Signs customer and operator sessions | Required |
APP_ENCRYPTION_KEY | Encrypts sensitive tokens | Required |
APP_ENCRYPTION_KEYS | Supports key rotation | Optional / recommended later |
CRON_SECRET | Protects the daily cron endpoint | Required for production |
EMAIL_WEBHOOK_URL | Sends deletion, scheduled-report, and password-reset emails | Required for real email delivery |
EMAIL_WEBHOOK_SECRET | Secures the email webhook | Recommended |
PLATFORM_ADMIN_EMAILS | Optional bootstrap operator allow-list | Optional |
META_APP_ID | Meta Embedded Signup / Cloud API app id | Required for live Meta setup |
NEXT_PUBLIC_META_APP_ID | Client-side Meta app id | Required for live Meta setup |
META_APP_SECRET | Meta app secret | Required for live Meta setup |
META_EMBEDDED_SIGNUP_CONFIG_ID | Meta Embedded Signup config id | Required for live Meta setup |
NEXT_PUBLIC_META_EMBEDDED_SIGNUP_CONFIG_ID | Client-side signup config id | Required for live Meta setup |
META_BUSINESS_ID | Meta business context | Required for live Meta setup |
META_SYSTEM_USER_ACCESS_TOKEN | Meta API token | Required for live Meta setup |
META_WEBHOOK_VERIFY_TOKEN | Webhook verification | Required for live Meta setup |
META_GRAPH_API_VERSION | Meta Graph version | Required |
SECURITY_ALERT_EMAIL | Security/ops alert destination | Optional |
BACKUP_STORAGE_PATH | Backup posture tracking | Optional |
PAYFAST_* | PayFast merchant, return, cancel, and notify configuration | Required for the implemented billing flow |
PAYFAST_SANDBOX | Optional sandbox mode for local or test environments | Recommended outside production |
STRIPE_* | Legacy Stripe provider configuration | Optional / legacy only |
Recommended local startup npm install npm run prisma:push npm run prisma:seed npm run dev
The application currently contains a working PayFast billing architecture in code, including secure checkout handoff, ITN-driven plan activation, trial expiry rules, cancellation rules, and access gating.
For deployment readiness, PayFast is the selected production billing provider. Stripe remains in the codebase as a legacy provider path and should not be presented to customers unless the billing configuration is intentionally switched back.
npm install npm run prisma:push npm run prisma:seed npm run dev npm test npm run build
Email delivery is abstracted behind EMAIL_WEBHOOK_URL. Until that webhook is configured, email-dependent features are safe but non-delivering.
EMAIL_WEBHOOK_URL and EMAIL_WEBHOOK_SECRET