Help Desk Template for Next.js

An open-source help desk and support ticketing system for small support teams of 2 to 20 agents, built with Next.js 16, TypeScript and PostgreSQL. It includes a shared inbox with saved views and keyboard shortcuts, tickets with internal notes, canned replies, merging and SLA timers, a public help centre with a knowledge base and customer portal, and reports.

by Light CloudHelpdesk and support

Build a help desk with Next.js and PostgreSQL

Help desk inbox: open tickets sorted by SLA deadline with status, priority, time left and assignee
Help desk inbox: open tickets sorted by SLA deadline with status, priority, time left and assignee, on a phone

Features

  • Inbox views for Mine, Unassigned, Urgent, Waiting on customer, All open and Solved, sorted by nearest SLA deadline
  • Internal notes sit in the ticket thread beside replies and are filtered out of the customer portal and every email
  • Canned replies with {{customer.first_name}}, {{agent.first_name}} and {{ticket.number}} placeholders
  • Merge duplicates: messages move across in order, the duplicate closes and links to the kept ticket, both get history
  • First reply and resolution targets per priority, set in Settings, with time left or time overdue on every ticket
  • Keyboard shortcuts: j and k to move, r to reply, n for a note, a to assign to yourself, ? for the full list
  • Knowledge base in Markdown with PostgreSQL full-text search and FAQPage, Article and BreadcrumbList JSON-LD
  • Reports on tickets created and solved per week, median time to first reply, SLA hit rate and a table per agent

Tech stack

What you need

  • A paid plan: deploying creates a PostgreSQL database, which the Free plan does not include
  • To run it locally: Node.js 22.12 or newer, npm, and Docker for a local PostgreSQL
  • No API keys: it starts with nothing to configure
  • Optional: RESEND_API_KEY and EMAIL_FROM to email customers and agents; without them emails go to the server log
  • Optional: GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, or the GOOGLE_ pair, for team sign-in with GitHub or Google

About

Ticket logic lives in src/lib/helpdesk/ (tickets, SLA, knowledge base, portal and reports) rather than in pages, and every server action checks the owner, admin or agent role and validates input with zod. Portal links are random tokens stored only as a SHA-256 hash, so a customer follows a request without a password and a leaked database does not leak working links. The first things to set are the help desk name, contact details, support hours and SLA targets under Settings > Help desk, which also feed the structured data and /llms.txt. npm start applies the migrations under a PostgreSQL advisory lock and the demo help desk is seeded once on first start; on Light Cloud each push to your copy redeploys.

FAQ

Is there a free open-source help desk template for Next.js?

Yes. This help desk is MIT licensed and built with Next.js 16, PostgreSQL, Drizzle ORM and Better Auth. It runs with no third-party keys and starts with a demo help desk you remove under Settings > Help desk.

Does this help desk receive email like a support@ inbox?

No, not out of the box. Customers write through the help centre form or reply through their private link, and agents log phone and email requests with New ticket. To take email in, point an inbound email webhook at a route that calls createTicket and addCustomerReply in src/lib/helpdesk/tickets.ts.

How are SLA times calculated in the help desk?

In calendar time from when the ticket came in, against first reply and resolution targets per priority. Changing the priority re-times the ticket, and pending tickets show Waiting on customer instead of a clock. For business hours, change slaClock in src/lib/helpdesk/sla.ts.

How do customers reply to a support ticket without an account?

Each request gets a private link, shown after the form is sent and emailed when Resend is set up, and links last 7 days. A customer's reply reopens the ticket.

Can I host this help desk without Light Cloud?

Yes. It is a standard Next.js app with no Light Cloud code: any host with Node.js 22.12 and PostgreSQL runs it with npm ci && npm run build and npm start, once DATABASE_URL and AUTH_SECRET are set.

Price
Free
Framework
Next.js · JavaScript
Updated

Variables

  • AUTH_SECRETGenerated