A modern, full-stack ticket management system powered by AI for intelligent ticket triage, automated assignment, and streamlined workflow management.
- Automatic Priority Detection: AI analyzes tickets and assigns priority levels (Low, Medium, High)
- Smart Skill Matching: Identifies required technical skills for each ticket
- Intelligent Assignment: Automatically assigns tickets to moderators with matching skills
- Helpful Notes Generation: Provides detailed analysis and helpful resources for resolution
- Multi-Role System: User, Moderator, and Admin roles with different permissions
- Skill-Based Matching: Users can have skills for intelligent ticket assignment
- Admin Panel: Comprehensive user management with role and skill editing
- Welcome Emails: Automated welcome messages for new users
- Assignment Notifications: Email alerts when tickets are assigned to moderators
- Background Processing: Uses Inngest for reliable background job processing
- Responsive Design: Works seamlessly on desktop and mobile
- Real-time Updates: Dynamic ticket status updates
- Markdown Support: Rich text formatting in ticket notes
- Intuitive Navigation: Clean, modern interface built with React and Tailwind CSS
- React 19 with modern hooks and components
- Tailwind CSS 4 for responsive styling
- DaisyUI for consistent UI components
- React Router for client-side routing
- React Markdown for rich text rendering
- Node.js with Express.js framework
- MongoDB with Mongoose ODM
- JWT Authentication for secure user sessions
- bcrypt for password hashing
- CORS enabled for cross-origin requests
- Google Gemini AI for intelligent ticket analysis
- Inngest for background job processing
- Nodemailer for email notifications
- Mailtrap for email testing
- Node.js (v18 or higher)
- MongoDB Atlas account or local MongoDB instance
- Google AI API key (Gemini)
- Mailtrap account for email testing
-
Clone the repository
git clone <repository-url> cd Ticket-AI
-
Install dependencies
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Environment Setup
Server (.env)
PORT=3000 MONGO_URI=your_mongodb_connection_string GEMINI_API_KEY=your_google_ai_api_key JWT_SECRET=your_jwt_secret_key CORS_ORIGINS=http://localhost:5173 INNGEST_EVENT_KEY=your_inngest_event_key INNGEST_SIGNING_KEY=your_inngest_signing_key # Mailtrap SMTP Configuration MAILTRAP_SMTP_HOST=sandbox.smtp.mailtrap.io MAILTRAP_SMTP_PORT=2525 MAILTRAP_SMTP_USER=your_mailtrap_user MAILTRAP_SMTP_PASS=your_mailtrap_password
Client (.env)
VITE_SERVER_URL=http://localhost:3000
You can also copy the provided examples:
server/.env.example→server/.envclient/.env.example→client/.env
-
Start the application
Terminal 1 - Start the server:
cd server npm run devTerminal 2 - Start the client:
cd client npm run devTerminal 3 - Start Inngest (for background jobs):
cd server npm run inngest-dev -
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
- Inngest Dev Server: http://localhost:8288
Ai_agent/
├── client/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable React components
│ │ │ ├── check-auth.jsx
│ │ │ └── navbar.jsx
│ │ ├── page/ # Page components
│ │ │ ├── admin.jsx
│ │ │ ├── login.jsx
│ │ │ ├── signup.jsx
│ │ │ ├── ticket.jsx
│ │ │ └── tickets.jsx
│ │ ├── assets/ # Static assets
│ │ ├── index.css # Global styles
│ │ └── main.jsx # App entry point
│ ├── package.json
│ └── vite.config.js
├── server/ # Node.js backend application
│ ├── controllers/ # Route handlers
│ │ ├── ticket.controller.js
│ │ └── user.controller.js
│ ├── middleware/ # Custom middleware
│ │ └── auth.js
│ ├── models/ # Database models
│ │ ├── ticket.model.js
│ │ └── user.models.js
│ ├── routes/ # API routes
│ │ ├── ticket.routes.js
│ │ └── user.routes.js
│ ├── inngest/ # Background job functions
│ │ ├── client.js
│ │ └── functions/
│ │ ├── on-ticket-create.js
│ │ └── OnSignup.js
│ ├── utils/ # Utility functions
│ │ ├── api.js # AI integration
│ │ └── mailer.js # Email utilities
│ ├── index.js # Server entry point
│ └── package.json
└── README.md
POST /api/users/signup- User registrationPOST /api/users/login- User loginPOST /api/users/logout- User logout
GET /api/users/user- Get current user infoPOST /api/users/update-user- Update user (Admin only)
GET /api/tickets- Get all tickets (filtered by role)GET /api/tickets/:id- Get specific ticketPOST /api/tickets- Create new ticket
POST /api/inngest- Inngest webhook endpoint
- Create and view their own tickets
- Update personal profile
- View all tickets
- Access detailed ticket information including AI analysis
- Receive ticket assignments based on skills
- Full system access
- User management capabilities
- Role and skill assignment
- View all tickets and users
The system uses Google's Gemini AI to automatically analyze tickets and provide:
- Priority Assessment: Automatically categorizes tickets as Low, Medium, or High priority
- Skill Identification: Determines required technical skills for resolution
- Solution Guidance: Provides helpful notes and potential solutions
- Resource Links: Suggests relevant documentation and resources
Automated email notifications for:
- Welcome emails for new user registrations
- Assignment notifications when tickets are assigned to moderators
- Status updates for ticket progress (configurable)
Server:
npm run dev- Start development server with nodemonnpm run inngest-dev- Start Inngest development server
Client:
npm run dev- Start Vite development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
User Model:
{
email: String (required, unique),
password: String (required, hashed),
role: String (enum: ["user", "moderator", "admin"]),
skills: [String],
createdAt: Date
}Ticket Model:
{
title: String,
description: String,
status: String (default: "TODO"),
createdBy: ObjectId (ref: User),
assignedTo: ObjectId (ref: User),
priority: String,
deadline: Date,
helpfulNotes: String,
relatedSkills: [String],
createdAt: Date
}- Environment Variables: Update production URLs and API keys
- Database: Configure production MongoDB instance
- Email Service: Set up production email service (replace Mailtrap)
- Build: Run
npm run buildin client directory - Server: Deploy server with PM2 or similar process manager
- Frontend: Vercel, Netlify, or similar static hosting
- Backend: Railway, Render, or AWS EC2
- Database: MongoDB Atlas
- Email: SendGrid, AWS SES, or similar production email service
- 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 ISC License.
Created by Rishi Shanbhag
If you encounter any issues or have questions:
- Check the Issues section
- Create a new issue with detailed information
- Contact the maintainer
⭐ Star this repository if you find it helpful!