ticketing

MSP Ticketing

Private-label MSP helpdesk software built with Next.js, Prisma, PostgreSQL, NextAuth, Tailwind, and Microsoft Graph foundations. The project is structured as a Zoho Desk / Freshdesk style support workspace with multi-client ticketing, agent dashboards, reporting, portal views, SLA policies, automations, knowledge base, and admin controls.

What’s in this repo

Stack

Quick start

  1. Install dependencies:
npm install
  1. Create .env.local from .env.example and set at minimum:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/msp_ticketing?schema=public"
NEXTAUTH_SECRET="replace-with-a-long-random-secret"
NEXTAUTH_URL="http://localhost:3000"
  1. Generate the Prisma client and sync the schema:
npx prisma generate
npm run db:push
  1. Seed the workspace:
npm run db:seed
  1. Start the app:
npm run dev
  1. Open http://localhost:3000

Demo credentials:

Environment

Key environment variables:

Microsoft Graph setup

Create one Microsoft Entra app registration and grant delegated or application permissions as needed for your rollout:

Local auth callback:

Recommended mailbox rollout flow:

  1. Register the app in Entra.
  2. Add the redirect URI above.
  3. Generate a client secret.
  4. Grant Graph permissions and admin consent.
  5. Populate the Azure AD and Graph values in .env.local.
  6. Add mailbox records through the admin UI or seed/update data directly.

Important routes

Workspace pages:

Core API routes:

Seeded sample data

The seed script creates:

Notes

Useful commands

npx prisma generate
npm run db:push
npm run db:seed
npm run dev
npm run build