Skip to content

Arnav181/aisupport-ticket-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI-Assisted Customer Support Ticket System

A full-stack AI-powered customer support ticket management platform built using the MERN stack with OpenAI integration.

This system enables users to create support tickets, receive automated AI-based classification, and engage in contextual multi-turn conversations with an AI assistant. The architecture is modular, secure, and designed to reflect production-level SaaS patterns.


Overview

The application combines secure authentication, structured ticket management, and contextual AI-driven conversations. It demonstrates full-stack engineering capabilities, backend architecture design, and practical integration of AI services into a real-world support workflow.


Core Features

Authentication

  • JWT-based authentication
  • Secure password hashing with bcrypt
  • Protected backend routes
  • Persistent login state on frontend
  • User-level access isolation

Ticket Management

  • Create support tickets (Title and Description)

  • Automatic AI classification:

    • Category (Billing, Technical, General, Bug, Feature Request)
    • Priority (Low, Medium, High, Urgent)
    • AI-generated suggested reply
  • View user-specific tickets

  • Close resolved tickets

  • Delete tickets

  • Ticket lifecycle management (Open → Closed)

Contextual AI Chat

  • Multi-turn conversation per ticket
  • AI responses based on full ticket context
  • Persistent message storage in MongoDB
  • Secure user-based access control
  • Structured OpenAI prompt design for controlled outputs

Reliability Design

  • OpenAI API key secured on backend
  • Fallback mock AI classifier if OpenAI fails
  • Graceful error handling
  • Modular service architecture

Technology Stack

Frontend

  • React (Vite)
  • TailwindCSS (Dark SaaS-style UI)
  • React Router
  • Axios
  • Context API for global authentication state

Backend

  • Node.js
  • Express.js
  • MongoDB with Mongoose
  • JSON Web Tokens (JWT)
  • bcryptjs
  • OpenAI API (Chat Completions)

Project Structure

ai-support-system/
│
├── backend/
│   ├── controllers/
│   ├── middleware/
│   ├── models/
│   ├── routes/
│   ├── utils/
│   ├── server.js
│   └── .env
│
└── frontend/
    ├── src/
    │   ├── components/
    │   ├── context/
    │   ├── pages/
    │   ├── services/
    │   ├── App.jsx
    │   └── main.jsx

Installation and Setup

1. Clone the Repository

git clone <repository-url>
cd ai-support-system

2. Backend Setup

cd backend
npm install

Create a .env file inside the backend directory:

MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
OPENAI_API_KEY=your_openai_api_key
PORT=5000

Run the backend:

npm run dev

The backend server runs at:

http://localhost:5000

3. Frontend Setup

cd frontend
npm install
npm run dev

The frontend runs at:

http://localhost:5173

Application Workflow

  1. User registers or logs in.

  2. User creates a support ticket.

  3. Backend sends ticket description to OpenAI.

  4. AI returns structured metadata:

    • Category
    • Priority
    • Suggested reply
  5. Ticket is stored with AI metadata.

  6. User opens the ticket to start a contextual conversation.

  7. AI continues responding using the full message history.

  8. User can close or delete the ticket.


AI Architecture Design

  • Structured system prompts enforce consistent JSON output.
  • Ticket-based message arrays maintain contextual continuity.
  • All AI communication occurs server-side.
  • Fallback mock classifier ensures system stability.
  • Each ticket stores conversation history independently.

Security Considerations

  • JWT authentication middleware
  • Role-based access isolation (user-level)
  • Secure environment variable management
  • API key never exposed to client
  • Authorization validation on all ticket operations

Potential Future Enhancements

  • Voice-to-text integration (Speech-to-Text)
  • Admin dashboard and analytics
  • Sentiment analysis and escalation logic
  • Email notifications
  • Streaming AI responses
  • Deployment using Docker and cloud hosting

Purpose

This project demonstrates:

  • Full-stack system design
  • Secure authentication implementation
  • AI integration with structured outputs
  • Multi-turn conversational context handling
  • Production-style backend architecture
  • Scalable SaaS workflow modeling

It extends beyond a simple CRUD application by integrating intelligent automation and contextual AI conversation within a secure and modular system.

-------------------X--------------------------------------X----------------------------

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages