Skip to content

bconti123/incident-tracking-system

Repository files navigation

Incident Tracking System

Features

  • Auth + RBAC (ADMIN / SUPPORT / USER)
  • Ticket CRUD (create, view, update status/priority/assignee)
  • Comments
    • Add comment
    • Edit (author/admin only)
    • Soft delete
  • Audit logging for key actions (ticket + comment + assign/priority)
  • Unified ticket timeline
    • Merge comments + status history + audits
    • Day grouping (Today/Yesterday)
    • "Show system events" toggle
  • Filters + dashboard
    • Status / Priority / Assignee / Unassigned filters (URL-driven)
    • Dashboard metrics + recent activity
  • Server-side validation (Zod) and transactions (Prisma)
  • Error code reference (link common error codes to tickets with note+ audit trail)

Screenshot

Ticket Dashboard

  • Status and priority counts, unassigned and "assigned to me" views, and recent updated tickets
Dashboard

Ticket List

  • Search, filters, pagination, and role-aware visibility
TicketList

Ticket Detail (Admin / Support Control)

  • Status, priority, and assignment management with RBAC enforcement

Ticket Timeline

  • Comments, status history, and audit events in a unified timeline
TicketTimeLine+Detail

Error Code Classification

  • Link error codes with notes and suggested recommendations
Error+Comment

Tech Stack

  • Next.js
  • Auth.js / NextAuth (Credentials)
  • Prisma + PostgreSQL
  • Zod validation
  • Docker (Postgres)
  • Jest + React Testing Library
  • Playwright E2E

Roles and Permissions

  • ADMIN: manage everything
  • SUPPORT: view all tickets, update status/priority/assignee
  • USER: create tickets, view own tickets, comment on own tickets

Architecture notes

  • Object-level authorization via canViewTicket(user, ticket) to prevent ID guessing
  • Server actions for mutations (no thin API routes)
  • Prisma transactions for "write + audit log" consistency
  • Soft delete for comments to preserve history
  • Timeline view model: normalized TimelineItem[] for rendering

Getting started

Prerequisites

  • Node.js
  • PostgreSQL
  • If you use Docker, you'll need:
    • Docker
    • Docker Compose

Environment setup

cp .example_env .env

Local setup (with Docker)

npm install
docker compose up -d
npx prisma migrate deploy
npm run seed
npm run dev

Seed users (example):

Local setup (without Docker)

npm install
npx prisma migrate deploy
npm run seed
npm run dev

Seed users (example):

Testing

The project includes both unit/integration coverage with Jest and end-to-end coverage with Playwright.

npm test

For full Jest and Playwright setup, runbook, and E2E coverage details, see TESTING.md.

Next steps

  • Improve the UI and expand feature coverage
  • Dockerize the application for consistent local and deployment environments
  • Add a CI/CD pipeline for automated testing and deployments
  • Expand the Playwright E2E suite for timeline and broader regression coverage

Releases

No releases published

Packages

 
 
 

Contributors