A comprehensive WhatsApp messaging platform built with Laravel and Node.js, featuring advanced campaign management, real-time message tracking, and automated reply handling.
- Create & Edit Campaigns: Full CRUD operations for marketing campaigns
- Bulk Messaging: Send messages to multiple recipients simultaneously
- Campaign Restart: Restart completed campaigns with reset statistics
- Message Templates: Support for both text and template messages
- Phone Number Management: Add/remove recipients dynamically
- Message Status: Track sent, delivered, and read status
- Reply Tracking: Automatic capture and linking of customer replies
- Live Statistics: Real-time campaign analytics and metrics
- Webhook Integration: Seamless integration with WhatsApp Business API
- Campaign Statistics: Delivery rates, read rates, and reply rates
- Reply Management: View and manage customer responses
- Export Functionality: Export campaign results to CSV
- Performance Metrics: Comprehensive campaign performance tracking
- Backend: Laravel 10+ (PHP 8.1+)
- Frontend: Livewire, TailwindCSS, Alpine.js
- WhatsApp Engine: Node.js with Baileys library
- Database: MySQL/PostgreSQL
- Real-time: WebSocket integration
- Queue System: Laravel Queues for message processing
- PHP 8.1 or higher
- Composer
- Node.js 16+ and npm
- MySQL/PostgreSQL database
- WhatsApp Business account
git clone <repository-url>
cd laravel-whatsapp-saas
composer install
npm installcp .env.example .env
php artisan key:generateDB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=whatsapp_saas
DB_USERNAME=your_username
DB_PASSWORD=your_passwordphp artisan migratenpm run build# Terminal 1: Laravel Application
php artisan serve
# Terminal 2: WhatsApp Engine
cd whatsapp-engine
npm install
npm startcd whatsapp-engine
npm install# Create .env file in whatsapp-engine directory
WHATSAPP_ENGINE_PORT=3000
APP_URL=http://localhost:8000
WEBHOOK_URL=http://localhost:8000/webhook/whatsapp
NODE_ENV=developmentnpm start
# Visit http://localhost:3000/status
# Scan QR code with your WhatsApp- Navigate to Campaigns section
- Click "New Campaign"
- Fill in campaign details:
- Campaign name and description
- Message content
- Phone numbers (one per line)
- Click "Create Campaign"
- Start: Begin sending messages
- Pause: Temporarily stop campaign
- Edit: Modify content or recipients (even completed campaigns)
- Restart: Reset and resend completed campaigns
- View Details: See detailed statistics and replies
- Real-time Tracking: Replies appear automatically
- Reply Management: View all replies in dedicated section
- Export Data: Download campaign results with replies
# Get campaign status
GET /api/campaigns/{id}
# Create campaign
POST /api/campaigns
# Update campaign
PUT /api/campaigns/{id}# Send single message
POST /api/messages
{
"phone_number": "+1234567890",
"message": "Hello World!"
}
# Get message status
GET /api/messages/{id}/status# WhatsApp webhook (auto-configured)
POST /webhook/whatsapp
# Webhook verification
GET /webhook/whatsappThe system automatically handles WhatsApp webhooks for:
- Message Sent: Confirms message delivery to WhatsApp
- Message Delivered: Updates delivery status
- Message Read: Tracks read receipts
- Incoming Messages: Captures and links customer replies
- Total Recipients: Number of target recipients
- Sent Count: Successfully sent messages
- Delivered Count: Messages delivered to devices
- Read Count: Messages opened by recipients
- Reply Count: Customer responses received
- Failed Count: Failed message attempts
- Success Rate: (Delivered / Sent) Γ 100
- Read Rate: (Read / Delivered) Γ 100
- Reply Rate: (Replies / Delivered) Γ 100
- CSRF Protection: Webhook endpoints properly secured
- Input Validation: All user inputs validated
- Rate Limiting: API endpoints rate limited
- Authentication: User authentication required
- Data Sanitization: Phone numbers and content sanitized
php artisan test- Create a test campaign
- Send messages via WhatsApp Engine
- Reply from your phone
- Verify statistics update in real-time
./vendor/bin/pintnpm run devphp artisan db:seedβββ app/
β βββ Http/Controllers/ # API & Webhook controllers
β βββ Livewire/ # Frontend components
β βββ Models/ # Database models
β βββ Services/ # Business logic
βββ whatsapp-engine/ # Node.js WhatsApp integration
βββ resources/views/ # Blade templates
βββ database/migrations/ # Database schema
βββ routes/ # Application routes
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: Report bugs via GitHub Issues
- Documentation: Check the wiki for detailed guides
- Community: Join our Discord server for support
- Built with Laravel
- WhatsApp integration via Baileys
- UI components with TailwindCSS
- Real-time features with Livewire