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 Ai_agent
-
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 # 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
-
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!