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.
npm install
.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"
npx prisma generate
npm run db:push
npm run db:seed
npm run dev
http://localhost:3000Demo credentials:
admin@msp.local / AdminPassword123!agent1@msp.local / AgentPassword123!Key environment variables:
DATABASE_URL: PostgreSQL connection string.NEXTAUTH_SECRET: required for session signing.NEXTAUTH_URL: local or production app URL.AZURE_AD_CLIENT_IDAZURE_AD_TENANT_IDAZURE_AD_CLIENT_SECRETMICROSOFT_GRAPH_CLIENT_IDMICROSOFT_GRAPH_CLIENT_SECRETMICROSOFT_GRAPH_TENANT_IDCreate one Microsoft Entra app registration and grant delegated or application permissions as needed for your rollout:
Mail.ReadMail.ReadWriteMail.SendUser.ReadLocal auth callback:
http://localhost:3000/api/auth/callback/azure-adRecommended mailbox rollout flow:
.env.local.This app deploys as a Cloudflare Worker through OpenNext. It is not a static Pages export.
Use:
npx opennextjs-cloudflare build
That command should generate .open-next/worker.js. For local Worker preview and deploy:
npm run preview
npm run deploy
Important production values:
NEXTAUTH_URL: set this to your deployed HTTPS app URL.NEXTAUTH_SECRET: keep this stable across deploys.DATABASE_URL: use a production PostgreSQL connection string.MICROSOFT_GRAPH_CLIENT_IDMICROSOFT_GRAPH_CLIENT_SECRETMICROSOFT_GRAPH_TENANT_IDWorkspace pages:
/dashboard/tickets/tickets/new/clients/contacts/kb/reports/eod-report/automations/portal/admin/settingsCore API routes:
GET/POST /api/v1/ticketsGET/PATCH /api/v1/tickets/[id]GET/POST /api/v1/tickets/[id]/repliesGET/POST /api/v1/tickets/[id]/notesGET /api/v1/dashboardGET /api/v1/reportsGET /api/v1/settingsThe seed script creates:
npm run build and npx opennextjs-cloudflare build have been verified successfully in this workspace.npx prisma generate
npm run db:push
npm run db:seed
npm run dev
npm run build