Skip to content

rishicodely/ai-support-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ AI-Powered Support Ticket System

A production-style event-driven microservices system that automatically classifies support tickets using AI and updates the UI in real time.


🎯 Problem This Solves

Support teams often handle large volumes of tickets manually, leading to:

  • Slow response times
  • Incorrect routing of issues
  • Poor user experience

This system automates ticket classification and processing using AI, improving efficiency and enabling real-time visibility.


✨ Overview

This project simulates how modern SaaS platforms (like Zendesk, Freshdesk) handle support workflows:

  • Users create support tickets
  • AI classifies them asynchronously
  • System updates status in real-time
  • Multiple services consume the same event stream

Designed to demonstrate scalable backend architecture, not just CRUD functionality.


🧠 Key Features

  • ⚑ Event-driven architecture (RabbitMQ)
  • πŸ€– AI-powered ticket classification (Groq LLM)
  • πŸ” Retry + Dead Letter Queue (DLQ) handling
  • 🌐 Real-time UI updates via WebSockets
  • πŸ—„οΈ Persistent state with PostgreSQL (Neon)
  • 🧩 Microservices-based design
  • πŸ”„ Eventual consistency with DB as source of truth

🌐 Live Demo


πŸ—οΈ Architecture

Frontend (React)
        β”‚
        β–Ό
Ticket Service (NestJS + Prisma)
        β”‚
        β–Ό
   RabbitMQ (Event Bus)
        β”‚
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί AI Service (Python - Groq)
        β”‚                     β”‚
        β”‚                     β–Ό
        β”‚             ticket.ai_processed
        β”‚
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Audit Service (Event Store)
        β”‚
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Notification Service
        β”‚
        └──────────────► WebSocket Service
                              β”‚
                              β–Ό
                       Real-time UI updates

        β–Ό
Ticket Service (consumes AI result β†’ updates DB)

🧩 Microservices Breakdown

🟦 Ticket Service (Core)

  • Handles ticket creation
  • Stores data in PostgreSQL (Neon)
  • Publishes ticket.created
  • Consumes AI results to update DB (source of truth)

🟩 AI Service

  • Consumes ticket.created

  • Classifies using Groq LLM

  • Publishes:

    • ticket.ai_processed
    • ticket.ai_failed
  • Implements retry + DLQ handling


🟨 WebSocket Service

  • Subscribes to event stream
  • Emits real-time updates to frontend

πŸŸͺ Audit Service

  • Logs all system events
  • Enables traceability and debugging
  • Acts as event store

πŸŸ₯ Notification Service

  • Subscribes to critical events
  • Designed for alerts, emails, escalation workflows

πŸ”„ Event Flow

1. Ticket Creation

  • User creates ticket
  • Stored in DB with PROCESSING status
  • Event published β†’ ticket.created

2. AI Processing

  • AI service consumes event

  • Classifies ticket

  • Publishes:

    • ticket.ai_processed βœ…
    • ticket.ai_failed ❌

3. Database Update

  • Ticket service consumes AI result

  • Updates DB:

    • CLASSIFIED + category + confidence
    • or FAILED

4. Real-Time Update

  • WebSocket service emits update
  • Frontend updates instantly

πŸ“¦ Event Contract

ticket.created

{
  "event_type": "ticket.created",
  "aggregate_id": "ticket_id",
  "payload": {
    "status": "PROCESSING",
    "subject": "...",
    "priority": "..."
  }
}

ticket.ai_processed

{
  "event_type": "ticket.ai_processed",
  "aggregate_id": "ticket_id",
  "payload": {
    "status": "CLASSIFIED",
    "category": "technical",
    "confidence": 0.95
  }
}

ticket.ai_failed

{
  "event_type": "ticket.ai_failed",
  "aggregate_id": "ticket_id"
}

🧰 Tech Stack

πŸ–₯️ Frontend

  • React (Vite)
  • Socket.IO client
  • Tailwind CSS

🧠 Backend

Ticket Service

  • NestJS
  • Prisma ORM
  • PostgreSQL (Neon)
  • RabbitMQ

AI Service

  • Python
  • Groq API
  • RabbitMQ

WebSocket Service

  • Node.js
  • Socket.IO

βš™οΈ Infrastructure

  • RabbitMQ
  • Docker
  • Neon (serverless Postgres)
  • Render (backend deployment)
  • Vercel (frontend deployment)

πŸ–ΌοΈ Screenshots

Screenshot from 2026-04-04 15-58-57

🧠 Key Design Decisions

  • Used RabbitMQ to decouple services and enable scalability
  • Maintained Ticket Service as single source of truth
  • Used WebSocket for real-time updates instead of polling
  • Implemented retry + DLQ to handle failures safely
  • Designed system for multiple independent consumers

⚠️ Challenges Solved

Event Contract Consistency

  • Missing fields caused UI inconsistencies
  • Fixed by enforcing structured payloads

Distributed Debugging

  • Debugged across:

    • Vercel (frontend)
    • Render (backend)
    • Neon (DB)
    • RabbitMQ

Eventual Consistency

  • Ensured DB reflects final state
  • UI reflects real-time updates

Failure Handling

  • Prevented infinite retries
  • Used DLQ for safe failure management

πŸš€ Local Setup

Start Infrastructure

docker-compose up

Start Services

Ticket Service

cd ticket-service
npm install
npm run start:dev

AI Service

cd ai-orchestrator
pip install -r requirements.txt
python main.py

WebSocket Service

cd websocket-service
npm install
node index.js

Frontend

cd support-ui
npm install
npm run dev

🌍 Environment Variables

RABBITMQ_URL=amqp://user:pass@localhost:5672
DATABASE_URL=postgresql://...
FRONTEND_URL=http://localhost:5173
EXCHANGE=support.events

πŸ’‘ Future Improvements

  • πŸ” Authentication & multi-tenant support
  • πŸ“Š Analytics dashboard
  • πŸ“© Email / Slack notifications
  • 🧾 Ticket history timeline
  • πŸ€– Improved AI models

πŸ‘©β€πŸ’» Author

Rishika Reddy

  • Backend & MERN Developer
  • Exploring AI + System Design
  • Building production-style systems

⭐ Final Note

This project demonstrates how real-world systems are built using:

  • Event-driven architecture
  • Microservices
  • Asynchronous processing
  • Real-time communication

Releases

No releases published

Packages

 
 
 

Contributors