A comprehensive, enterprise-grade ticket management system designed for professional IT teams and customer service operations. This self-hosted solution provides advanced email integration, automated workflows, intelligent template management, and powerful analyticsโall with a modern, intuitive interface.
๐ Quick Links: Demo โข Installation โข Features โข API Docs โข Contributing
- ๐จ Revolutionary Email Template System - No-code section builder with drag & drop
- ๐ Intelligent Email Processing - Multi-account IMAP sync with smart reply detection
- ๐ฏ Advanced Workflow Automation - Due dates, SLA tracking, and auto-escalation
- ๐ Dynamic Theme Engine - 10+ preset themes + custom color picker
- ๐ฑ Mobile-First Experience - Fully responsive with touch-optimized interactions
- ๐ Enterprise Security - Role-based access, audit trails, and session management
- ๐ Features
- ๐ ๏ธ Technology Stack
- โก Quick Start
- ๐ธ Screenshots
- ๐ง Configuration
- ๐ง Email Integration
- ๐จ Email Template System
- ๐ฅ User Management
- ๐ Deployment
- ๐ป Development
- ๐ API & Integrations
- ๐ค Contributing
- ๐ License
- ๐ซ Intelligent Ticket System - Auto-generated ticket numbers, custom workflows, queue-based routing
- ๐ฌ Unified Communication - Internal/external comments with full email thread preservation
- ๐ฅ Advanced Participant Management - CC/BCC tracking, external user involvement, notification preferences
- ๐ Smart Search & Filtering - Multi-criteria filters, saved presets, fuzzy search with Fuse.js
- ๐ Comprehensive File Handling - Drag & drop uploads, MIME validation, UUID-based storage
- โฐ Workflow Automation - Due dates, reminders, SLA tracking, auto-close functionality
- ๐ Multi-Account IMAP Sync - Unlimited email accounts with individual sync intervals
- ๐ง Smart Reply Detection - Advanced regex patterns for automatic ticket threading
- ๐ก๏ธ Duplicate Prevention - Content-based and timing algorithms prevent duplicate tickets
- ๐จ Intelligent Email Processing - Automatic participant extraction, attachment handling
- ๐ฏ Advanced Filtering - Subject/sender regex filters, folder monitoring, action rules
- ๐ฏ Visual Section Builder - Drag & drop email content creation without HTML knowledge
- ๐ Pre-Built Templates - 8 professional section templates (Ticket Info, Status Changes, Comments, etc.)
- ๐ง Smart Configuration - Checkbox-based options, variable dropdowns, live preview
- ๐๏ธ Template Management - One-click reset to defaults, template duplication, style variants
- ๐ Backward Compatibility - Seamless migration from HTML-based to visual sections
- ๐ฑ Responsive Design - Mobile-optimized templates with automatic formatting
- ๐จ Dynamic Theme System - 10+ predefined themes, custom color picker with live preview
- ๐ฑ Mobile-First Design - Touch-optimized interactions, responsive breakpoints
- โก Performance Optimized - Server components, lazy loading, optimistic UI updates
- ๐ญ Smooth Animations - Framer Motion integration with micro-interactions
- ๐ Real-Time Notifications - In-app notification center with read status tracking
- ๐ Accessibility First - ARIA compliance, keyboard navigation, screen reader support
- ๐ Role-Based Security - Admin/Supporter roles with granular permissions
- ๐ Advanced Analytics - Ticket volume charts, performance metrics, trend analysis
- ๐ท๏ธ Custom Workflows - Dynamic status/priority systems with icons and colors
- ๐ Queue Management - Departmental routing, workload balancing, user assignments
- โ๏ธ Deep Customization - Logo uploads, brand colors, app naming, automation rules
- ๐ Background Services - Automated cron jobs, health monitoring, service recovery
- ๐๏ธ Modern Architecture - Next.js 15 App Router, React 19, TypeScript 5.8
- ๐๏ธ Optimized Database - SQLite with strategic indexing and query optimization
- ๐ง Developer Experience - Comprehensive type safety, extensive documentation
- ๐ Performance Monitoring - Built-in analytics, error tracking, health checks
- ๐ Scalable Design - Microservice-ready architecture with clean separation
- Frontend: Next.js 15.4.1 with App Router and React Server Components
- Language: TypeScript 5.8.3 with strict mode and comprehensive type safety
- Database: SQLite with Prisma ORM for optimized performance
- Authentication: NextAuth.js 4.24.11 with JWT and session management
- Styling: TailwindCSS 3.4.1 with dynamic CSS variables and theme system
- Components: ShadCN/UI + Radix UI primitives for accessibility
- Icons: Lucide React with 1000+ icons and custom icon system
- Animations: Framer Motion for smooth micro-interactions
- IMAP Processing: ImapFlow 1.0.191 for robust email server connections
- Email Parsing: MailParser 3.7.4 for advanced content extraction
- Template Engine: Custom HTML/text templates with variable substitution
- Visual Builder: No-code section builder for email customization
- File Handling: Multer 2.0.2 with UUID-based storage and MIME validation
- Rich Text Editor: Lexical 0.33.1 for advanced comment editing
- Search: Fuse.js 7.1.0 for intelligent fuzzy search
- Date Processing: date-fns 4.1.0 for comprehensive date manipulation
- Performance: Built-in caching, lazy loading, and optimized queries
System Requirements:
- Node.js: 18.x or higher (Download)
- npm: 9.x+ (included with Node.js) or yarn/pnpm
- Email Server: IMAP/SMTP access for email integration (optional but recommended)
Recommended Environment:
- RAM: 4GB+ available memory
- Storage: 2GB+ free space (more for file attachments)
- OS: Linux (Ubuntu 20.04+), macOS (10.15+), or Windows 10+ with WSL2
-
Clone and install dependencies:
git clone https://github.com/jonax1337/Ticket-System.git cd Ticket-System npm install
-
Configure environment variables:
cp .env.example .env
Edit
.env
with your configuration:# Database (SQLite by default) DATABASE_URL="file:./dev.db" # NextAuth Configuration NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-strong-secret-key-here" # Optional: Email Automation ENABLE_EMAIL_CRON=true TICKET_AUTOMATION_ENABLED=true
-
Setup database:
npx prisma generate npx prisma db push
-
Start the application:
npm run dev
-
Complete setup: Visit
http://localhost:3000
and follow the setup wizard to create your admin account and configure basic settings.
After installation, configure these essential features:
- Admin Account: Create your first administrator account through the setup wizard
- Email Integration: Add IMAP/SMTP accounts in Admin โ Email Settings
- Customization: Upload logo, set theme colors, and customize branding
- User Management: Create supporter accounts and assign queues
- Workflow Configuration: Set up custom statuses, priorities, and automation rules
Modern, clean interface with powerful ticket management:
- Smart Ticket List - Sortable columns, advanced filtering, bulk operations
- Real-Time Search - Instant results with multi-criteria filtering
- Status Indicators - Visual priority and status badges with custom colors
- Quick Actions - One-click ticket assignment, status updates, and commenting
Fully responsive design optimized for mobile workflows:
- Touch-Optimized Interface - Gesture-friendly interactions and navigation
- Responsive Tables - Adaptive layouts for different screen sizes
- Mobile Notifications - Native-like notification experience
- Offline Capability - Basic functionality when connectivity is limited
Comprehensive administration with intuitive controls:
- User Management - Role assignment, queue allocation, permission control
- System Configuration - Branding, themes, automation settings
- Email Template Designer - Visual email builder with live preview
- Analytics Dashboard - Performance metrics and trend analysis
Advanced theming system with real-time preview:
- 10+ Preset Themes - Professional color schemes (Default, Blue, Green, Purple, Red, etc.)
- Custom Color Picker - Unlimited color possibilities with HSL support
- Logo Management - Upload and preview custom logos
- Brand Consistency - Automatic color derivation for UI components
No-code email template creation:
- Visual Section Builder - Drag & drop email content without HTML knowledge
- Template Gallery - 8 pre-built professional templates
- Smart Configuration - Checkbox options, variable dropdowns, style variants
- Live Preview - Real-time email preview with sample data
- Mobile Preview - See how emails look on different devices
Variable | Description | Default | Example |
---|---|---|---|
DATABASE_URL |
SQLite database file path | file:./dev.db |
file:./production.db |
NEXTAUTH_URL |
Application base URL | http://localhost:3000 |
https://yourdomain.com |
NEXTAUTH_SECRET |
Session encryption key | (required) | your-super-secret-jwt-key |
SKIP_SETUP |
Skip initial setup wizard | false |
true |
ENABLE_EMAIL_CRON |
Enable automatic email sync | true |
false |
CRON_SECRET |
External cron endpoint secret | (optional) | cron-webhook-secret |
TICKET_AUTOMATION_ENABLED |
Enable ticket automation | true |
false |
TICKET_AUTOMATION_WARNING_DAYS |
Days before warning | 7 |
5 |
TICKET_AUTOMATION_CLOSE_DAYS |
Days before auto-close | 14 |
30 |
Configure these settings through the admin panel:
- App Name: Customize the application name and title
- Logo Upload: Upload custom logos (PNG, JPG, SVG supported)
- Theme Selection: Choose from preset themes or create custom colors
- Color Customization: Advanced color picker with HSL support
- Typography: Custom font selection and scaling
- Ticket Numbering: Sequential or random number generation
- Custom Statuses: Create status workflows with icons and colors
- Priority Levels: Define priority hierarchies with visual indicators
- Queue System: Departmental routing and workload balancing
- Automation Rules: Due date tracking, escalation, and auto-close
- IMAP Accounts: Configure multiple email accounts for ticket creation
- SMTP Settings: Outbound email configuration for notifications
- Sync Intervals: Individual account sync scheduling
- Email Filters: Subject and sender regex filtering
- Template Management: Visual email template designer
The system features a sophisticated IMAP-based email-to-ticket conversion system with enterprise-level capabilities:
- Unlimited Accounts: Configure multiple email accounts with independent settings
- Smart Sync Intervals: Individual sync schedules per account (default: 5 minutes)
- Folder Monitoring: Monitor specific IMAP folders or entire mailboxes
- Connection Health: Automatic connection monitoring and recovery
- Smart Reply Detection: Advanced regex patterns automatically thread email replies
- Duplicate Prevention: Content-based and timing algorithms prevent duplicate tickets
- Participant Management: Automatic extraction of all email participants (FROM, TO, CC, BCC)
- Attachment Processing: Seamless file upload integration with UUID-based storage
- HTML/Text Processing: Intelligent content extraction and formatting preservation
// Email Account Configuration
{
host: "imap.gmail.com",
port: 993,
username: "[email protected]",
password: "app-password",
useSSL: true,
folder: "INBOX",
syncInterval: 300, // seconds
processOnlyUnread: true,
subjectFilter: "\\[SUPPORT\\].*",
fromFilter: ".*@company\\.com",
emailAction: "mark_read", // or "delete", "move"
moveToFolder: "Processed",
defaultPriority: "Medium",
defaultStatus: "Open",
defaultAssigneeId: "user-id"
}
- Subject Filtering: Regex patterns for selective email processing
- Sender Filtering: Allow/block specific email addresses or domains
- Content Analysis: Spam detection and content validation
- Post-Processing Actions: Mark as read, delete, or move to folders
- Server-Side Cron Manager: Handles multiple account syncing
- Configuration Change Detection: Automatic service restart on settings updates
- External Cron Support: REST API endpoints for external scheduling systems
- Health Monitoring: Email sync status tracking and error reporting
- Error Recovery: Graceful error handling with automatic retry mechanisms
- Rate Limiting: Prevents email server overload
- Connection Pooling: Efficient IMAP connection management
- Memory Optimization: Large email handling without memory leaks
The new visual email template system eliminates the need for HTML knowledge while providing powerful customization options:
- Drag & Drop Interface: Intuitive section management with reordering
- Pre-Built Templates: 8 professional section templates for common use cases
- Smart Configuration: Checkbox-based options instead of HTML editing
- Variable Assistance: Dropdown menus for available template variables
- Live Preview: Real-time email preview with realistic sample data
Template | Description | Use Case |
---|---|---|
๐ซ Ticket Information | Automatic ticket details display | Show ticket number, subject, status, priority |
๐ Status Change | Status update notifications | Display previous/new status with reasons |
๐ฌ Comment Display | New comment presentation | Show comment content with author and timestamp |
๐ Custom Text | Flexible text content | Add custom messages with variable support |
๐ Action Instructions | Step-by-step guidance | Provide bulleted action lists for customers |
Important alerts | Display warnings and urgent information | |
๐ Contact Information | Support contact details | Show support email and contact options |
๐ฅ Participant Info | Participant notifications | Display participant addition details |
- Style Variants: Info, Success, Warning, Error, Default styling options
- Conditional Content: Smart content display based on available data
- Variable Substitution: 25+ available variables for dynamic content
- Mobile Optimization: Responsive email design for all devices
- Reset Functionality: One-click return to default templates
// Ticket Information
{{ticketNumber}} // T-123456
{{ticketSubject}} // Ticket title
{{ticketStatus}} // Current status
{{ticketPriority}} // Priority level
{{ticketCreatedAt}} // Creation date
// User Information
{{customerName}} // Customer name
{{customerEmail}} // Customer email
{{assignedToName}} // Assigned agent
{{actorName}} // Action performer
// System Information
{{systemName}} // Application name
{{supportEmail}} // Support contact
{{currentDate}} // Current date
{{currentTime}} // Current time
// Status Changes
{{previousStatus}} // Old status
{{newStatus}} // New status
{{statusChangeReason}} // Change reason
// Comments
{{commentContent}} // Comment HTML
{{commentAuthor}} // Comment author
{{commentCreatedAt}} // Comment date
// Participants
{{participantName}} // Participant name
{{participantType}} // Participant role
- Visual Editor: Point-and-click section configuration
- Template Gallery: Browse and select from pre-built templates
- Duplication: Copy existing sections for quick customization
- Bulk Operations: Enable/disable multiple sections
- Export/Import: Share templates between installations
Each email type supports complete customization:
- Welcome message and ticket confirmation
- Ticket details section with configurable fields
- Contact information and next steps
- Custom branding and styling
- Status change notification with previous/new status
- Change reason and actor information
- Updated ticket details
- Action instructions for customer
- New comment notification
- Full comment content with formatting
- Author information and timestamp
- Ticket context and details
- Participant welcome notification
- Role and permission information
- Ticket context and access details
- Contact information
- Inactivity warning with urgency indicators
- Clear action instructions
- Deadline information
- Contact options for assistance
- Closure notification with summary
- Ticket resolution information
- Reopen instructions
- Satisfaction survey (optional)
- Seamless Migration: Existing HTML templates automatically converted
- Hybrid Support: Both visual and HTML editing available
- Data Preservation: No loss of existing template customizations
- Gradual Adoption: Switch to visual builder at your own pace
Full System Access:
- โ Complete user management (create, edit, delete, role assignment)
- โ System configuration (themes, branding, automation settings)
- โ Email account management and template configuration
- โ Analytics and reporting access
- โ Queue management and workflow configuration
- โ All ticket management capabilities
- โ Security settings and audit log access
Ticket-Focused Access:
- โ View and manage all tickets within assigned queues
- โ Create internal comments and customer communications
- โ Update ticket status, priority, and assignments
- โ File attachment handling and management
- โ Personal "My Tickets" dashboard
- โ Basic profile and password management
- โ No user management or system configuration access
- โ Limited to assigned queues and tickets
- Profile Information: Name, email, contact details
- Avatar Upload: Custom profile pictures with image optimization
- Password Management: Secure password changes with strength validation
- Notification Preferences: Email and in-app notification settings
- Theme Preferences: Personal theme selection and customization
- Language Settings: Multi-language support (when available)
- Password Hashing: bcrypt with configurable salt rounds
- Session Management: JWT-based secure session handling
- Two-Factor Authentication: TOTP support (when configured)
- Login Audit: Track login attempts and security events
- Permission Verification: Real-time permission checking
- Session Timeout: Configurable session expiration
- Departmental Organization: Organize tickets by department or category
- User Assignment: Assign users to specific queues
- Workload Balancing: Automatic ticket distribution
- Priority Routing: High-priority tickets to experienced agents
- Escalation Rules: Automatic escalation based on time or complexity
- Performance Metrics: Tickets resolved, response times, satisfaction scores
- Workload Analysis: Current assignment load and capacity
- Activity Tracking: Login history, ticket interactions, system usage
- Team Performance: Comparative analysis and team statistics
# Dockerfile
FROM node:18-alpine
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci --only=production
# Copy application code
COPY . .
# Generate Prisma client and build
RUN npx prisma generate
RUN npm run build
# Create data directory for SQLite
RUN mkdir -p /app/data
EXPOSE 3000
CMD ["npm", "start"]
# Build and run
docker build -t ticket-system .
docker run -p 3000:3000 \
-v ticket-data:/app/data \
--env-file .env \
ticket-system
# docker-compose.yml
version: '3.8'
services:
ticket-system:
build: .
ports:
- "3000:3000"
volumes:
- ./data:/app/data
- ./uploads:/app/uploads
environment:
- DATABASE_URL=file:/app/data/production.db
- NEXTAUTH_URL=http://localhost:3000
- NEXTAUTH_SECRET=your-production-secret
restart: unless-stopped
- Connect Repository: Import from GitHub/GitLab
- Environment Variables: Configure in Vercel dashboard
- Database Setup: Use Vercel Postgres or external SQLite hosting
- Deploy: Automatic deployment on push
# Vercel CLI deployment
npm i -g vercel
vercel
vercel --prod
# Railway deployment
npm i -g @railway/cli
railway login
railway init
railway up
# Heroku deployment
heroku create your-app-name
heroku config:set NEXTAUTH_SECRET=your-secret
git push heroku main
# 1. Server preparation (Ubuntu/Debian)
sudo apt update && sudo apt upgrade -y
sudo apt install -y nodejs npm nginx certbot
# 2. Application setup
git clone https://github.com/jonax1337/Ticket-System.git
cd Ticket-System
npm install
npm run build
# 3. Process management with PM2
npm install -g pm2
pm2 start npm --name "ticket-system" -- start
pm2 startup
pm2 save
# 4. Nginx reverse proxy
sudo nano /etc/nginx/sites-available/ticket-system
# Configure nginx (see below)
sudo ln -s /etc/nginx/sites-available/ticket-system /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
# 5. SSL certificate
sudo certbot --nginx -d yourdomain.com
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
- Database Optimization: Regular VACUUM operations for SQLite
- File Storage: Consider object storage for attachments (S3, CloudFlare R2)
- CDN Setup: Static asset delivery optimization
- Caching: Redis for session storage and caching
- Monitoring: Application performance monitoring (APM)
- Environment Variables: Secure secret management
- HTTPS: Always use SSL/TLS in production
- Firewall: Restrict access to necessary ports only
- Updates: Regular security updates and patches
- Backups: Automated database and file backups
- Load Balancing: Multiple application instances
- Database Scaling: Consider PostgreSQL for high traffic
- File Storage: Distributed file storage systems
- Email Processing: Separate email processing workers
- Monitoring: Comprehensive monitoring and alerting
# Development
npm run dev # Start development server with hot reload
npm run build # Build optimized production bundle
npm run start # Start production server
npm run lint # Run ESLint code quality checks
npm run typecheck # Run TypeScript type checking
# Database Management
npx prisma generate # Generate Prisma client after schema changes
npx prisma db push # Push schema changes to database
npx prisma migrate dev # Create and apply migration (recommended)
npx prisma migrate deploy # Apply migrations in production
npx prisma studio # Open visual database browser
npx prisma db seed # Run database seeder (if configured)
# Email Testing
npm run email:test # Test email configuration
npm run email:sync # Manual email sync trigger
# 1. Clone and setup
git clone https://github.com/jonax1337/Ticket-System.git
cd Ticket-System
npm install
# 2. Environment configuration
cp .env.example .env
# Edit .env with your settings
# 3. Database setup
npx prisma generate
npx prisma db push
# 4. Start development
npm run dev
Recommended VS Code Extensions:
- Prisma: Database schema IntelliSense
- TypeScript Hero: Advanced TypeScript support
- Tailwind CSS IntelliSense: CSS class autocompletion
- ESLint: Code quality and formatting
- Prettier: Code formatting
- GitLens: Git integration and history
Development Dependencies:
{
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"autoprefixer": "^10.4.17",
"eslint": "^9",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"typescript": "5.8.3"
}
- TypeScript: Strict mode enabled, comprehensive type coverage
- ESLint: Enforced code quality rules and best practices
- Prettier: Consistent code formatting across the project
- Component Structure: Organized in logical feature-based folders
- API Routes: RESTful conventions with proper error handling
# Schema changes workflow
1. Edit prisma/schema.prisma
2. npx prisma migrate dev --name describe_change
3. npx prisma generate
4. Test changes locally
5. Commit migration files
# Reset database (development only)
npx prisma migrate reset
- Component Testing: Test React components in isolation
- API Testing: Test API endpoints with various scenarios
- Integration Testing: Test complete user workflows
- E2E Testing: Full application testing with Playwright
- Email Testing: Mock email providers for development
- React Server Components: Minimize client-side JavaScript
- Image Optimization: Next.js image optimization for uploads
- Database Queries: Use Prisma query optimization
- Caching: Implement strategic caching for frequently accessed data
- Bundle Analysis: Regular bundle size analysis and optimization
- Design Phase: Plan feature architecture and database changes
- Database Schema: Update Prisma schema if needed
- API Development: Create necessary API endpoints
- Frontend Development: Build user interface components
- Integration: Connect frontend with backend APIs
- Testing: Comprehensive testing of new functionality
- Documentation: Update documentation and README
// Adding new section template
export const NEW_TEMPLATE: SectionTemplate = {
id: 'custom_template',
name: 'Custom Template',
description: 'Description of the template',
category: 'custom',
icon: '๐ฏ',
preview: 'Preview text',
fields: [
{
id: 'field1',
type: 'text',
label: 'Field Label',
required: true
}
],
generateHtml: (fieldValues) => {
return `<p>Generated HTML content</p>`
}
}
- Database Sync Issues: Run
npx prisma migrate reset
andnpx prisma db push
- Type Errors: Ensure
npx prisma generate
after schema changes - Build Errors: Check TypeScript errors with
npm run typecheck
- Email Sync Issues: Verify IMAP credentials and connection settings
- Authentication Issues: Check NextAuth configuration and secrets
- Prisma Studio: Visual database browser and editor
- React DevTools: Component state and props inspection
- Network Tab: API request/response debugging
- Console Logs: Structured logging for debugging
- Error Tracking: Comprehensive error reporting and tracking
The system provides a comprehensive REST API for external integrations and custom development:
// API Authentication
Headers: {
'Authorization': 'Bearer JWT_TOKEN',
'Content-Type': 'application/json'
}
// Session-based authentication for web interface
// JWT tokens for API access
// Role-based access control (RBAC)
Ticket Management:
GET /api/tickets // List tickets with filtering
POST /api/tickets // Create new ticket
GET /api/tickets/:id // Get ticket details
PUT /api/tickets/:id // Update ticket
DELETE /api/tickets/:id // Delete ticket
POST /api/tickets/:id/comments // Add comment
GET /api/tickets/:id/participants // Get participants
POST /api/tickets/:id/participants // Add participant
User Management:
GET /api/users // List users
POST /api/users // Create user
GET /api/users/:id // Get user details
PUT /api/users/:id // Update user
DELETE /api/users/:id // Delete user
POST /api/users/:id/avatar // Upload avatar
Email Integration:
GET /api/admin/email // List email accounts
POST /api/admin/email // Create email account
PUT /api/admin/email/:id // Update email account
POST /api/admin/email/:id/test // Test email connection
POST /api/admin/email/:id/sync // Manual sync trigger
GET /api/admin/email/sync-status // Get sync status
Email Templates:
GET /api/admin/email-templates/types // List email types
GET /api/admin/email-templates/types/:type // Get type config
PUT /api/admin/email-templates/types/:type // Update type config
POST /api/admin/email-templates/types/:type/reset // Reset to default
POST /api/admin/email-templates/base/preview // Preview template
// Incoming webhooks for external integrations
POST /api/webhooks/tickets // Create ticket via webhook
POST /api/webhooks/status // Update ticket status
POST /api/webhooks/comment // Add comment via webhook
// Outgoing webhooks (configurable)
- Ticket created/updated events
- Comment added events
- Status change events
- User assignment events
// Send ticket notifications to Slack
const slackNotification = {
channel: '#support',
text: `New ticket created: ${ticket.subject}`,
attachments: [{
color: 'good',
fields: [
{ title: 'Ticket ID', value: ticket.ticketNumber, short: true },
{ title: 'Priority', value: ticket.priority, short: true },
{ title: 'Status', value: ticket.status, short: true }
]
}]
}
await fetch(SLACK_WEBHOOK_URL, {
method: 'POST',
body: JSON.stringify(slackNotification)
})
// Sync tickets with external CRM
const crmData = {
external_id: ticket.id,
title: ticket.subject,
description: ticket.description,
status: ticket.status,
contact_email: ticket.fromEmail,
created_at: ticket.createdAt
}
await fetch('https://api.crm.com/tickets', {
method: 'POST',
headers: {
'Authorization': 'Bearer CRM_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify(crmData)
})
// External email processing service
POST /api/cron/email-sync
Headers: {
'X-Cron-Secret': process.env.CRON_SECRET
}
// Response includes processing statistics
{
"success": true,
"accounts_processed": 3,
"total_imported": 15,
"total_skipped": 2,
"total_errors": 0,
"processing_time": "2.3s"
}
// Ticket analytics
GET /api/analytics/tickets/volume // Ticket volume over time
GET /api/analytics/tickets/status // Status distribution
GET /api/analytics/tickets/priority // Priority breakdown
GET /api/analytics/performance // Agent performance metrics
GET /api/analytics/resolution-time // Average resolution times
// System health
GET /api/system/health // Overall system health
GET /api/system/email-status // Email sync status
GET /api/system/performance // Performance metrics
import { TicketSystemClient } from '@ticket-system/sdk'
const client = new TicketSystemClient({
baseURL: 'https://your-instance.com',
apiKey: 'your-api-key'
})
// Create ticket
const ticket = await client.tickets.create({
subject: 'API Integration Issue',
description: 'Having trouble with API integration',
priority: 'High',
fromEmail: '[email protected]'
})
// Add comment
await client.tickets.addComment(ticket.id, {
content: 'Working on the integration issue',
isInternal: false
})
from ticket_system import TicketSystemClient
client = TicketSystemClient(
base_url='https://your-instance.com',
api_key='your-api-key'
)
# Create ticket
ticket = client.tickets.create(
subject='Python Integration',
description='Testing Python client library',
priority='Medium',
from_email='[email protected]'
)
# List tickets
tickets = client.tickets.list(
status='Open',
priority='High',
limit=50
)
- JWT Tokens: Stateless API authentication
- API Keys: Simple authentication for service integrations
- Session Cookies: Web application authentication
- OAuth 2.0: Third-party application authentication (planned)
// Rate limiting configuration
{
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // 100 requests per window
message: 'Too many requests, please try again later'
}
// Per-endpoint rate limiting
{
'/api/tickets': { max: 50 },
'/api/users': { max: 20 },
'/api/admin/*': { max: 10 }
}
- Input Sanitization: All inputs validated and sanitized
- Schema Validation: Zod-based request/response validation
- Type Safety: Full TypeScript coverage for API contracts
- Error Handling: Consistent error responses with proper HTTP status codes
We welcome contributions from the community! Here's how to get involved:
-
Fork the Repository
# Fork on GitHub, then clone locally git clone https://github.com/YOUR_USERNAME/Ticket-System.git cd Ticket-System
-
Setup Development Environment
npm install cp .env.example .env npx prisma generate npx prisma db push npm run dev
-
Create Feature Branch
git checkout -b feature/amazing-new-feature
- TypeScript: Use strict typing, avoid
any
types - ESLint: Follow established linting rules
- Prettier: Maintain consistent code formatting
- Comments: Document complex logic and API changes
- Naming: Use descriptive, self-documenting names
# Commit message format
type(scope): description
# Examples
feat(email): add visual template builder
fix(auth): resolve session timeout issue
docs(readme): update installation instructions
refactor(api): optimize ticket query performance
- Unit Tests: Test individual functions and components
- Integration Tests: Test API endpoints and workflows
- UI Tests: Test user interface interactions
- Email Tests: Mock email providers for testing
Before Submitting:
- Search existing issues to avoid duplicates
- Test with the latest version
- Gather detailed reproduction steps
Bug Report Template:
## Bug Description
Brief description of the issue
## Steps to Reproduce
1. Step one
2. Step two
3. Step three
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Environment
- OS: [e.g., Ubuntu 20.04]
- Node.js: [e.g., 18.17.0]
- Browser: [e.g., Chrome 115]
- Version: [e.g., 0.1.0]
## Additional Context
Screenshots, logs, or other relevant information
Feature Request Template:
## Feature Description
Clear description of the proposed feature
## Use Case
Why this feature would be valuable
## Proposed Implementation
How you think it should work
## Alternatives Considered
Other approaches you've thought about
## Additional Context
Mockups, examples, or related features
- ๐ Internationalization: Multi-language support implementation
- ๐ฑ Mobile App: React Native companion app
- ๐ Integrations: Slack, Teams, Discord, Zendesk connectors
- ๐ Advanced Analytics: Custom dashboards and reporting
- ๐ SSO Integration: SAML, LDAP, Active Directory support
- API Documentation: OpenAPI 3.0 specification
- Tutorial Content: Step-by-step guides and tutorials
- Video Guides: Screen recordings for complex features
- Translation: Documentation in multiple languages
- Database Optimization: Query performance improvements
- Caching Strategy: Redis integration and caching layers
- Bundle Optimization: JavaScript bundle size reduction
- Image Processing: Advanced image optimization and compression
- Issue Discussion: Discuss major changes in issues first
- Development: Implement changes following guidelines
- Testing: Ensure all tests pass and add new tests
- Documentation: Update relevant documentation
- Pull Request: Submit PR with clear description
- Code Review: Address feedback and iterate
- Merge: Maintainers merge approved PRs
Contributors are recognized in:
- README Contributors Section: Public recognition
- Release Notes: Feature attribution in releases
- Hall of Fame: Special recognition for significant contributions
- Beta Access: Early access to new features and releases
- GitHub Discussions: General questions and community discussion
- Discord Server: Real-time chat and collaboration (coming soon)
- Monthly Calls: Virtual meetups for contributors (planned)
- Documentation Wiki: Community-maintained documentation
This project is open source and available under the MIT License.
MIT License
Copyright (c) 2024 Ticket System Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- โ Commercial Use: Use in commercial projects
- โ Modification: Modify source code freely
- โ Distribution: Distribute copies and modifications
- โ Private Use: Use for private/internal projects
- โ Patent Grant: Protection against patent claims
- ๐ License Notice: Include license in distributions
- ๐ Copyright Notice: Preserve copyright notices
- ๐ Attribution: Credit original authors
- Bug Reports: Create Bug Report
- Feature Requests: Request Feature
- Security Issues: Security Advisory
- GitHub Discussions: Join Discussions
- Issues Tracker: Browse Issues
- Pull Requests: View PRs
- ๐ Webhook Integrations - Slack, Teams, Discord, and custom endpoints
- ๐ API Documentation - Complete OpenAPI 3.0 specification with Swagger UI
- ๐ Advanced Analytics - Custom dashboards, SLA tracking, and performance metrics
- ๐ Bulk Operations - Mass ticket updates, batch assignments, multi-select actions
- ๐๏ธ Custom Fields - Dynamic ticket metadata with validation and conditional logic
- ๐ Multi-language Support - Full i18n with RTL support and locale formatting
- ๐ฑ Mobile Applications - Native iOS and Android apps with offline capability
- ๐ SSO Integration - SAML, LDAP, Active Directory, and OAuth providers
- ๐ Knowledge Base - Integrated documentation system with search and suggestions
- ๐ค AI Assistant - Intelligent ticket categorization and response suggestions
- ๐ข Multi-tenant Support - Support for multiple organizations in single instance
- ๐ Advanced Reporting - Custom report builder with scheduled exports
- โ Visual Email Template Builder - No-code section creation with drag & drop
- โ Enhanced Email Processing - Multi-account sync with smart reply detection
- โ Advanced Theme System - Custom color picker with 10+ preset themes
- โ Modern Architecture - Next.js 15, React 19, TypeScript 5.8 upgrade
- โ Database Migration - Seamless MySQL to SQLite migration support
- โ Security Enhancements - Improved authentication and authorization
- โ Performance Optimization - Server components and optimized queries
- โ Mobile Responsiveness - Complete mobile-first design overhaul
- ๐ GitHub Stars: Growing community of users and contributors
- ๐ง Active Development: Regular updates and feature releases
- ๐ Issue Resolution: Fast response times and community support
- ๐ Documentation: Comprehensive guides and API documentation
- ๐ก๏ธ Security: Regular security audits and vulnerability assessments
- Production-Tested: Battle-tested architecture with comprehensive security
- Scalable Design: Grows with your organization from startup to enterprise
- Modern Technology: Built with the latest frameworks and best practices
- Self-Hosted: Complete control over your data and infrastructure
- Cost-Effective: No per-agent fees or monthly subscriptions
- Visual Email Builder: Revolutionary no-code template system
- Theme System: Unlimited visual customization options
- Workflow Flexibility: Adapt to any support process or methodology
- API-First: Integrate with any existing tools or systems
- Open Source: Modify anything to fit your exact needs
- Modern Stack: Next.js 15, React 19, TypeScript 5.8
- Clean Architecture: Well-documented, maintainable codebase
- Comprehensive APIs: RESTful APIs for all functionality
- Active Community: Growing ecosystem of contributors and users
- Extensive Documentation: Detailed guides for every aspect
- Regular Updates: Continuous improvement and new features
- Community-Driven: Roadmap influenced by real user needs
- Standards-Based: Built on web standards and best practices
- Migration-Friendly: Easy to migrate data in and out
- Vendor-Independence: Never locked into proprietary systems
๐ Built with โค๏ธ for IT Support Teams and Customer Service Excellence
Transform your support operations with a modern, intelligent, and completely customizable ticket management system.