Skip to content

About

Web application for manage requests for assistance, issues, and IT service needs within an organization.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ticketing System

IT Helpdesk / Ticketing System - Full stack application for managing internal support tickets.


πŸ“¦ Tech Stack

Backend

  • Runtime: Node.js 20 (Alpine)
  • Framework: Express.js
  • Language: TypeScript
  • ORM: Drizzle ORM
  • Database: PostgreSQL
  • Authentication: JSON Web Tokens (jwt), Bcryptjs
  • Security: Helmet, CORS, Rate Limiting
  • Utilities: Multer (file uploads), Winston (logging), Zod (validation)

Frontend

  • Framework: React 19 + Vite
  • Language: TypeScript
  • UI Library: Material UI (MUI) v7
  • Charts: ApexCharts + react-apexcharts
  • Routing: React Router DOM
  • State: Context API (Auth theme provider)

DevOps

  • Containerization: Docker + Docker Compose
  • Orchestration: 3 services (db, backend, frontend)

✨ Features

Authentication

Auth

  • Login / Logout with JWT access tokens
  • Session management with me endpoint
  • Account activation status check
  • Role-based access control (ADMIN, TECHNICIAN, EMPLOYEE)

Ticket Management

Ticket

  • Create tickets with auto-generated ticket numbers
  • SLA response/deadline calculation based on priority
  • Status workflow with valid transitions (NEW β†’ OPEN β†’ IN_PROGRESS β†’ PENDING β†’ RESOLVED β†’ CLOSED)
  • Priority levels: LOW, MEDIUM, HIGH, CRITICAL
  • Search and filter by status, priority, category, department, location
  • Pagination support
  • Ticket comments (internal/external)
  • File attachments (up to 10 files per ticket)
  • Ticket assignment to technicians (admin/technician only)
  • Status change with transition validation

Audit

  • Audit logging for all ticket actions

Reference Data

Category Department Location Parent Category

  • Category & Parent Category management
  • Department management
  • Location management
  • SLA policy configuration

SLA

Dashboard & Reporting

Dashboard

  • Ticket statistics and charts
  • Real-time status overview
  • Activity tracking

Notifications

  • Automated notifications for ticket creation, comments, status changes
  • Notification targeting based on user roles

File Uploads

  • Attachment support with storage in database
  • MIME type and size validation

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      HTTPS      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚ ──────────────▢ β”‚   Backend API      β”‚
β”‚   (React + Vite)β”‚              β”‚   (Express + TS)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                                       β”‚
                                       β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚   PostgreSQL    β”‚
                              β”‚   (Docker volume)β”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Client-Server architecture with RESTful API
  • Express routes organized by feature (/api/*)
  • Middleware stack: request logger β†’ helmet β†’ CORS β†’ rate limit β†’ route handlers
  • Auth middleware: JWT verification + role authorization
  • Drizzle ORM for type-safe database queries
  • Docker Compose for local development (db + backend + frontend)

🐳 Installation with Docker

Prerequisites

  • Docker and Docker Compose

Steps

# 1. Clone the repository
git clone <repository-url>
cd ticketing_system

# 2. Start all services
docker-compose up -d

# 3. Wait for the database to be ready
# The backend will automatically run migrations on first start

# 4. Access the application
# - Frontend: http://localhost:5173 (via nginx on port 80)
# - Backend API: http://localhost:4213/api/*
# - Health check: http://localhost:4213/api/health
# - PostgreSQL: localhost:5433 (mapped from container 5432)

Docker Services

Service Ports Description
db 5433:5432 PostgreSQL database
backend 4213:4213 Node.js Express API
frontend 5173:80 React app served via Nginx

Environment Variables

The backend reads from ./backend/.env. A sample is provided:

cp backend/.env.example backend/.env
# Edit values as needed (DATABASE_URL, JWT_SECRET, etc.)

The frontend reads VITE_API_URL from frontend/.env.example (defaults to /api).

Volumes

  • ticketing_system_pgdata - PostgreSQL data persistence

πŸ”§ Installation without Docker

Prerequisites

  • Node.js 20+
  • PostgreSQL 16+
  • yarn or npm

Backend Setup

# 1. Install dependencies
cd backend
npm install

# 2. Configure environment
cp .env.example .env
# Edit .env with your PostgreSQL connection details

# 3. Run database migrations
npm run db:migrate
# Or generate schema if needed:
npm run db:generate

# 4. Seed initial data (optional)
npm run db:seed

# 5. Start the development server
npm run dev
# Server runs on http://localhost:4213

Frontend Setup

# 1. Install dependencies
cd frontend
npm install

# 2. Configure API endpoint
# VITE_API_URL in .env.example defaults to /api
# The dev server proxies to http://localhost:4213/api

# 3. Start the development server
npm run dev
# App runs on http://localhost:5173

Production Build

# Backend
cd backend
npm run build
npm run start

# Frontend
cd frontend
npm run build
# Output goes to dist/

πŸ—„οΈ Database Migrations

The project uses Drizzle Kit for migrations:

# Generate migration from schema changes
npm run db:generate

# Apply migrations to database
npm run db:migrate

# Push schema without migration tracking
npm run db:push

🌐 API Endpoints (Summary)

Auth

  • POST /api/auth/login - Authenticate user
  • POST /api/auth/logout - Revoke token
  • GET /api/auth/me - Get current user profile

Users

  • GET /api/users - List users (admin only)

Tickets (main feature)

Endpoint Description
GET /api/tickets List tickets with filters & pagination
POST /api/tickets Create new ticket
GET /api/tickets/:id Get ticket by ID
PATCH /api/tickets/:id Update ticket
DELETE /api/tickets/:id Delete ticket (admin/new owner)
POST /api/tickets/:id/comments Add comment
POST /api/tickets/:id/assign Assign to technician
POST /api/tickets/:id/status Change status
POST /api/tickets/:id/attachments Upload files

Reference Data

  • GET /api/categories - List categories
  • GET /api/parent-categories - List parent categories
  • GET /api/departments - List departments
  • GET /api/locations - List locations
  • GET /api/sla - SLA policies

Dashboard

  • GET /api/dashboard/statistics - Get stats

Notifications & Audit

  • GET /api/notifications - List user notifications
  • GET /api/audit-logs - Audit trail (admin only)

About

Web application for manage requests for assistance, issues, and IT service needs within an organization.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages