Build Your Own Helpdesk
Ticket system with inbox, status management, and assignment.
⚠️ Email threading is the hard part. For production, consider Freshdesk free tier.
The Prompt
Copy this prompt into Cursor, Claude, or your AI tool:
Build me a simple helpdesk/ticket system with the following specifications:
## Tech Stack
- Next.js 14 with App Router
- Prisma with PostgreSQL
- Tailwind CSS + shadcn/ui
- Resend for email
## Core Features
### 1. Ticket Management
- List all tickets with status filters (Open, Pending, Resolved, Closed)
- Ticket fields: subject, description, status, priority, assignee, customer email
- Create tickets via form or email (basic)
- Ticket detail view with full history
### 2. Conversation Thread
- Reply to tickets
- Internal notes (not visible to customer)
- Show full conversation history
- Rich text editor for responses
### 3. Assignment & Workflow
- Assign tickets to team members
- Change status and priority
- Add tags/categories
- Due date setting
### 4. Customer Portal (optional)
- Public ticket submission form
- Customer can view their tickets
- Customer can reply to tickets
### 5. Dashboard
- Open tickets count
- Average response time
- Tickets by status chart
- Recent activity
### 6. Notifications
- Email to customer when reply sent
- Email to agent when new ticket
- Email on assignment
## Database Schema
```prisma
model Ticket {
id String @id @default(cuid())
subject String
status String @default("open")
priority String @default("medium")
customerEmail String
customerName String?
assigneeId String?
assignee User? @relation(fields: [assigneeId], references: [id])
messages Message[]
tags String[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Message {
id String @id @default(cuid())
ticketId String
ticket Ticket @relation(fields: [ticketId], references: [id])
content String
authorId String?
author User? @relation(fields: [authorId], references: [id])
isInternal Boolean @default(false)
createdAt DateTime @default(now())
}
```
Please generate all files for a working helpdesk system.
What You'll Get
✅ Included
- Ticket inbox
- Conversation threads
- Status management
- Assignment
- Basic notifications
- Dashboard
❌ Not Included
- Email parsing
- Live chat
- Knowledge base
- SLA tracking
- Phone/social channels
- AI responses