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.
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.
- JWT-based authentication
- Secure password hashing with bcrypt
- Protected backend routes
- Persistent login state on frontend
- User-level access isolation
-
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)
- 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
- OpenAI API key secured on backend
- Fallback mock AI classifier if OpenAI fails
- Graceful error handling
- Modular service architecture
- React (Vite)
- TailwindCSS (Dark SaaS-style UI)
- React Router
- Axios
- Context API for global authentication state
- Node.js
- Express.js
- MongoDB with Mongoose
- JSON Web Tokens (JWT)
- bcryptjs
- OpenAI API (Chat Completions)
ai-support-system/
│
├── backend/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── utils/
│ ├── server.js
│ └── .env
│
└── frontend/
├── src/
│ ├── components/
│ ├── context/
│ ├── pages/
│ ├── services/
│ ├── App.jsx
│ └── main.jsx
git clone <repository-url>
cd ai-support-system
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
cd frontend
npm install
npm run dev
The frontend runs at:
http://localhost:5173
-
User registers or logs in.
-
User creates a support ticket.
-
Backend sends ticket description to OpenAI.
-
AI returns structured metadata:
- Category
- Priority
- Suggested reply
-
Ticket is stored with AI metadata.
-
User opens the ticket to start a contextual conversation.
-
AI continues responding using the full message history.
-
User can close or delete the ticket.
- 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.
- 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
- 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
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----------------------------