A comprehensive support ticketing system that integrates WhatsApp Business API with AI-powered chatbot capabilities to automatically create and manage customer support requests.
- Backend: ASP.NET Core Web API (.NET 8)
- Frontend: Next.js 14 with TypeScript
- Database: SQL Server with Entity Framework Core
- AI Integration: OpenAI GPT API
- WhatsApp Integration: WhatsApp Business API
- Authentication: JWT Bearer tokens
- ORM: Entity Framework Core
- Validation: FluentValidation
- WhatsApp Integration: Receive messages via WhatsApp Business API webhook
- AI-Powered Processing: Automatically categorize and prioritize support requests
- Ticket Management: Create, update, assign, and resolve support tickets
- Multi-language Support: Handle messages in multiple languages
- Smart Routing: Automatically assign tickets to appropriate departments
- Real-time Updates: WebSocket integration for live ticket updates
- Message intent classification
- Sentiment analysis
- Auto-categorization (Technical, Billing, General, etc.)
- Priority assessment (Low, Medium, High, Critical)
- Automated responses for common queries
- Language detection and translation
- Ticket overview and statistics
- Agent assignment and workload management
- Customer interaction history
- Performance analytics
- Export capabilities
project-root/
├── backend/
│ ├── src/
│ │ ├── WhatsAppSupport.API/
│ │ ├── WhatsAppSupport.Core/
│ │ ├── WhatsAppSupport.Infrastructure/
│ │ └── WhatsAppSupport.Application/
│ └── tests/
└── frontend/
├── components/
├── pages/
├── hooks/
├── services/
└── types/
- .NET 8 SDK
- SQL Server (LocalDB for development)
- Visual Studio 2022 or VS Code
- Node.js 18+ and npm/yarn
- TypeScript 5+
- WhatsApp Business API account
- OpenAI API key
- Ngrok (for local webhook testing)
git clone <repository-url>
cd whatsapp-ai-supportCreate appsettings.Development.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=WhatsAppSupportDb;Trusted_Connection=true;MultipleActiveResultSets=true"
},
"WhatsApp": {
"WebhookToken": "your-webhook-verify-token",
"AccessToken": "your-whatsapp-access-token",
"PhoneNumberId": "your-phone-number-id",
"BusinessAccountId": "your-business-account-id"
},
"OpenAI": {
"ApiKey": "your-openai-api-key",
"Model": "gpt-3.5-turbo"
},
"JWT": {
"SecretKey": "your-jwt-secret-key",
"Issuer": "WhatsAppSupport",
"Audience": "WhatsAppSupport-Client",
"ExpiryMinutes": 60
}
}cd backend/src/WhatsAppSupport.API
dotnet ef database updatedotnet runCreate .env.local:
NEXT_PUBLIC_API_BASE_URL=https://localhost:5001/api
NEXT_PUBLIC_SIGNALR_HUB_URL=https://localhost:5001/ticketHubcd frontend
npm install
npm run devngrok http 5001Configure webhook URL in WhatsApp Business API:
https://your-ngrok-url.ngrok.io/api/webhook/whatsapp
POST /api/auth/login
POST /api/auth/register
POST /api/auth/refreshGET /api/tickets
GET /api/tickets/{id}
POST /api/tickets
PUT /api/tickets/{id}
DELETE /api/tickets/{id}
GET /api/tickets/statsGET /api/webhook/whatsapp (verification)
POST /api/webhook/whatsapp (message handling)GET /api/customers
GET /api/customers/{id}
POST /api/customers
PUT /api/customers/{id}- Tickets: Support ticket information
- Customers: Customer details and WhatsApp info
- Agents: Support agents and assignments
- Messages: WhatsApp message history
- Categories: Ticket categorization
- Attachments: File attachments support
- Message Received: WhatsApp webhook receives customer message
- Intent Analysis: AI determines message intent and sentiment
- Category Classification: Automatically categorizes the issue type
- Priority Assessment: Assigns priority based on content analysis
- Ticket Creation: Creates support ticket with AI-generated summary
- Agent Assignment: Routes to appropriate agent/department
- Auto-Response: Sends acknowledgment message to customer
- Text messages
- Images with OCR processing
- Documents (PDF, Word, etc.)
- Voice messages (with transcription)
- Location sharing
- Contact information
dotnet publish -c Releasenpm run build
vercel deploy --prod# Backend
ASPNETCORE_ENVIRONMENT=Production
ConnectionStrings__DefaultConnection=<production-db-connection>
WhatsApp__AccessToken=<production-whatsapp-token>
OpenAI__ApiKey=<production-openai-key>
# Frontend
NEXT_PUBLIC_API_BASE_URL=<production-api-url>- Request/response logging
- AI processing metrics
- WhatsApp API call tracking
- Error monitoring and alerts
- Ticket creation rate
- Average response time
- AI classification accuracy
- Customer satisfaction scores
- JWT token authentication
- WhatsApp webhook signature verification
- API rate limiting
- Input validation and sanitization
- SQL injection prevention
- CORS configuration
cd backend
dotnet testcd frontend
npm run test- Verify webhook URL is accessible
- Check webhook token configuration
- Ensure HTTPS is enabled
- Validate webhook signature verification
- Verify OpenAI API key and quota
- Check AI model availability
- Monitor API rate limits
- Verify connection string
- Ensure SQL Server is running
- Check database permissions
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Initial release with core functionality
- WhatsApp Business API integration
- AI-powered ticket classification
- Real-time dashboard
- Mobile app for agents
- Integration with popular CRM systems
- Advanced AI features (emotion detection)
- Multi-channel support (Telegram, Facebook Messenger)
- Automated workflow triggers