A Laravel-based ticket management system with AI-powered ticket classification using OpenAI's GPT API.
-
🎫 Ticket Management
- Create and manage support tickets
- View ticket history and status
- Server-side pagination and search
- Category-based filtering
- Sortable columns
-
🤖 AI-Powered Classification
- Automatic ticket categorization using OpenAI's GPT
- Categories: Billing, Bug, Feature Request, General
- Confidence scoring for classifications
- Fallback to random classification if AI is disabled
- Bulk classification using job queues
-
🎨 Modern UI
- Clean and responsive design
- Real-time search with debouncing
- Interactive filters and sorting
- Status indicators and category badges
- PHP 8.1 or higher
- Composer
- Node.js and NPM
- MySQL or PostgreSQL
- OpenAI API key (for AI classification)
- Clone the repository:
git clone https://github.com/yourusername/smart-ticket-triage.git
cd smart-ticket-triage- Install PHP dependencies:
composer install- Install JavaScript dependencies:
npm install- Copy the environment file:
cp .env.example .env- Generate application key:
php artisan key:generate- Configure your database in
.env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=smart_ticket_triage
DB_USERNAME=your_username
DB_PASSWORD=your_password
- Configure OpenAI API (optional):
OPENAI_API_KEY=your_openai_api_key
OPENAI_ENABLED=true
- Run migrations and seeders:
php artisan migrate --seed- Start the development server:
php artisan serve- In a separate terminal, start Vite:
npm run dev- Access the application at
http://localhost:8000 - Create a new ticket using the "New Ticket" button
- View and manage tickets in the ticket list
- Use the search and filter options to find specific tickets
- Click "Classify" on unclassified tickets to use AI classification
The application includes a command-line tool for bulk classification of tickets using job queues. This is useful for processing large numbers of tickets efficiently.
To use bulk classification:
- Start the queue worker:
php artisan queue:work- Run the bulk classification command:
# Basic usage (process up to 100 tickets)
php artisan tickets:bulk-classify
# Process a specific number of tickets
php artisan tickets:bulk-classify --limit=50
# Process tickets with a specific status
php artisan tickets:bulk-classify --status=open
# Customize chunk size for better performance
php artisan tickets:bulk-classify --chunk=20
# Combine options
php artisan tickets:bulk-classify --status=open --limit=200 --chunk=25Command Options:
--status: Filter tickets by status (default: open)--limit: Maximum number of tickets to process (default: 100)--chunk: Number of tickets to process in each chunk (default: 10)
GET /api/tickets- List tickets with pagination, search, and filtersPOST /api/tickets- Create a new ticketGET /api/tickets/{id}- Get ticket detailsPOST /api/tickets/{id}/classify- Classify a ticket using AI
php artisan testnpm run build- Fork the repository
- Create your feature branch (
git checkout -b feature/feature-name) - Commit your changes (
git commit -m 'Add some new feature') - Push to the branch (
git push origin feature/feature-name) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.