How mby444/ticketing-system works
This is a Next.js support-ticket application: users register or sign in, create and follow tickets, add attachments and comments, while staff triage, assign, update, and filter tickets. Ticket actions are the central server-side workflow boundary; authentication/authorization and persistence support those operations, and asynchronous jobs deliver ticket emails. Source excerpts show the dashboard, ticket-detail, auth, and email-worker flows. Other links below rely on SOURCE INDEX references; unsampled implementation details and wiring are not inferred.
Main entry points: ticket.actions.ts Ticket actions · page.tsx Staff dashboard · authorization.ts Access guards · auth.actions.ts Auth actions
Components 25
Identity and access
- Sign-in forms
app/(auth)/login/login-form.tsx - Registration form
app/(auth)/register/register-form.tsx - Auth actions
actions/auth.actions.ts - Token and cookies
lib/auth.ts - Access guards
lib/authorization.ts - Current user
lib/current-user.ts - Role definitions
lib/roles.ts
Ticket workflow
- Ticket list
app/tickets/page.tsx - Ticket creation form
app/tickets/new/ticket-form.tsx - Ticket details
app/tickets/[id]/page.tsx - Ticket actions
actions/ticket.actions.ts - Comments
app/tickets/[id]/comment-thread.tsx - Application database
lib/prisma.ts - Priority rules
lib/priority.ts
Staff triage
- Staff dashboard
app/dashboard/page.tsx - Ticket table
components/dashboard/TicketTable.tsx - Dashboard filters
lib/dashboard-filters.ts - Dashboard sorting
lib/dashboard-sort.ts
Attachments and email
- Attachment storage
lib/cloudinary.ts - Email job publisher
lib/qstash.ts - Email job worker
app/api/jobs/send-email/route.ts - Email dispatch
lib/email.ts - Email templates
emails
Other components
- User
- QStash
Connections 33
- User → Sign-in forms: signs in
app/(auth)/login/login-form.tsx - User → Registration form: registers
app/(auth)/register/register-form.tsx - Sign-in forms → Auth actions: submits credentials
app/(auth)/login/login-form.tsx - Registration form → Auth actions: submits registration
app/(auth)/register/register-form.tsx - Auth actions → Application database: reads and creates users
actions/auth.actions.ts - Auth actions → Token and cookies: signs session token
actions/auth.actions.ts - Access guards → Current user: resolves session
lib/authorization.ts - Current user → Token and cookies: verifies cookie token
lib/current-user.ts - Access guards → Role definitions: checks roles
lib/authorization.ts - User → Ticket list: views tickets
app/tickets/page.tsx - Ticket list → Access guards: requires user
app/tickets/page.tsx - Ticket list → Ticket actions: fetches tickets
app/tickets/page.tsx - User → Ticket creation form: creates ticket
app/tickets/new/ticket-form.tsx - Ticket creation form → Ticket actions: submits ticket
app/tickets/new/ticket-form.tsx - Ticket details → Ticket actions: loads ticket
app/tickets/[id]/page.tsx - Ticket details → Access guards: requires user
app/tickets/[id]/page.tsx - Ticket details → Comments: renders conversation
app/tickets/[id]/page.tsx - Ticket actions → Application database: reads and updates records
actions/ticket.actions.ts - Ticket actions → Current user: checks identity
actions/ticket.actions.ts - Ticket actions → Attachment storage: uploads attachments
actions/ticket.actions.ts - Ticket actions → Email job publisher: publishes email jobs
actions/ticket.actions.ts - Ticket actions → Priority rules: uses priority rules
actions/ticket.actions.ts - Staff dashboard → Access guards: requires staff role
app/dashboard/page.tsx - Staff dashboard → Ticket actions: loads tickets and agents
app/dashboard/page.tsx - Staff dashboard → Dashboard filters: filters ticket set
app/dashboard/page.tsx - Staff dashboard → Dashboard sorting: sorts ticket set
app/dashboard/page.tsx - Staff dashboard → Ticket table: renders results
app/dashboard/page.tsx - Ticket table → Dashboard sorting: builds sort links
components/dashboard/TicketTable.tsx - Ticket table → Ticket actions: submits inline changes
components/dashboard/TicketTable.tsx - Email job publisher → QStash: enqueues jobs
lib/qstash.ts - QStash → Email job worker: delivers job
- Email job worker → Email dispatch: dispatches email
app/api/jobs/send-email/route.ts - Email dispatch → Email templates: renders messages