A comprehensive SaaS platform for WhatsApp Business Cloud API integration with advanced messaging automation and AI features.
- WhatsApp Cloud API Integration: Complete integration with Meta's official WhatsApp Business API
- Multi-role Dashboard: Separate admin and client interfaces
- Message Templates: Manage and send templated messages
- Contact Management: Organize and manage customer contacts
- Broadcasting: Send bulk messages to multiple contacts
- AI Automation: OpenAI-powered message enhancement and automation
- Real-time Chat: WebSocket-based live messaging
- Subscription Management: Multi-tier subscription system
- Domain Configuration: Custom domain support with verification
- Frontend: React 18, TypeScript, Tailwind CSS, shadcn/ui
- Backend: Node.js, Express, TypeScript
- Database: PostgreSQL with Drizzle ORM
- Authentication: JWT-based with role-based access control
- Real-time: WebSocket support for live updates
- Build Tools: Vite (frontend), esbuild (backend)
-
Clone and install dependencies:
npm install
-
Set up environment:
cp .env.example .env # Edit .env with your configuration -
Set up database:
npm run db:push
-
Start development server:
npm run dev
See DEPLOYMENT.md for complete Ubuntu deployment instructions.
-
Run the deployment script:
chmod +x deploy.sh ./deploy.sh
-
Upload application files and configure:
cd /opt/whatsapp-saas npm install npm run build npm run db:push pm2 start ecosystem.config.js
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | ✅ |
JWT_SECRET |
JWT signing secret | ✅ |
WHATSAPP_ACCESS_TOKEN |
WhatsApp API access token | ✅ |
WHATSAPP_PHONE_NUMBER_ID |
WhatsApp phone number ID | ✅ |
WHATSAPP_BUSINESS_ACCOUNT_ID |
WhatsApp business account ID | ✅ |
OPENAI_API_KEY |
OpenAI API key for AI features | ❌ |
NODE_ENV |
Environment (development/production) | ✅ |
PORT |
Server port (default: 5000) | ❌ |
APP_URL |
Application base URL | ✅ |
POST /api/auth/login- User loginPOST /api/auth/register- User registrationGET /api/auth/me- Get current userPOST /api/auth/logout- User logout
GET /api/whatsapp/status- Check connection statusPOST /api/whatsapp/configure- Configure WhatsApp APIPOST /api/whatsapp/send- Send messagePOST /api/whatsapp/webhook- Webhook endpoint
GET /api/templates- List templatesPOST /api/templates- Create templatePUT /api/templates/:id- Update templateDELETE /api/templates/:id- Delete template
GET /api/contacts- List contactsPOST /api/contacts- Create contactPUT /api/contacts/:id- Update contactDELETE /api/contacts/:id- Delete contact
GET /api/messages- List messagesPOST /api/messages/send- Send messageGET /api/messages/recent- Recent messages
GET /api/broadcasts- List broadcastsPOST /api/broadcasts- Create broadcastGET /api/broadcasts/recent- Recent broadcasts
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── lib/ # Utility functions
│ │ └── main.tsx # App entry point
│ └── index.html
├── server/ # Node.js backend
│ ├── routes.ts # API routes
│ ├── auth.ts # Authentication logic
│ ├── storage.ts # Data storage interface
│ ├── db.ts # Database connection
│ └── index.ts # Server entry point
├── shared/ # Shared types and schemas
│ └── schema.ts # Database schemas
├── package.json
├── vite.config.ts # Frontend build config
├── drizzle.config.ts # Database config
└── ecosystem.config.js # PM2 config
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run db:push- Push database schemanpm run check- Type check
- JWT-based authentication
- Role-based access control (admin/client)
- Input validation with Zod
- SQL injection protection
- CORS configuration
- Environment variable validation
- Create a Meta Developer account at developers.facebook.com
- Create a new app and add WhatsApp product
- Get your access token and phone number ID
- Configure webhook URL (your-domain.com/api/whatsapp/webhook)
- Add required environment variables
MIT License - see LICENSE file for details
For issues and questions:
- Check the deployment guide in DEPLOYMENT.md
- Review application logs
- Verify environment configuration
- Ensure all required services are running
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request