Skip to content

Repository files navigation

TechHelpDesk 🎫

A comprehensive full-stack ticket management system for IT support, built with NestJS, Angular, and PostgreSQL.

TechHelpDesk License

πŸ“‹ Overview

TechHelpDesk is a modern ticket management system designed for IT support teams. It provides role-based access control, real-time ticket tracking, and a comprehensive dashboard for administrators, technicians, and clients.

Key Features

  • πŸ” JWT Authentication - Secure authentication with role-based access control
  • πŸ‘₯ Three User Roles - Admin, Technician, and Client with specific permissions
  • 🎫 Ticket Management - Complete CRUD operations for support tickets
  • πŸ“Š Dashboard - Role-specific dashboards with real-time data
  • πŸ”„ Workflow Management - Ticket status transitions with validation
  • πŸ“š API Documentation - Interactive Swagger/OpenAPI documentation
  • πŸ§ͺ Test Coverage - Unit tests with coverage reports
  • 🎨 Modern UI - Responsive Angular frontend with clean design

πŸ—οΈ Architecture

TechHelpDesk/
β”œβ”€β”€ Backend/          # NestJS REST API
β”œβ”€β”€ Frontend/         # Angular SPA
└── docker-compose.yml # PostgreSQL database

Tech Stack

Backend

  • Framework: NestJS 10.x
  • Database: PostgreSQL 15
  • ORM: TypeORM
  • Authentication: JWT (Passport.js)
  • Validation: class-validator
  • Documentation: Swagger/OpenAPI
  • Testing: Jest

Frontend

  • Framework: Angular 18.x
  • HTTP Client: HttpClient with RxJS
  • Routing: Angular Router
  • State Management: Services with Observables
  • Styling: CSS Variables with custom design system

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Docker and Docker Compose (for PostgreSQL)
  • Git

Installation & Deployment

The easiest way to run the entire application (Frontend, Backend, and Database) is using Docker Compose.

  1. Clone the repository
git clone <repository-url>
cd TechHelpDesk
  1. Run with Docker Compose
docker-compose up --build

This command will:

  • Build the Backend image
  • Build the Frontend image (served via Nginx)
  • Start the PostgreSQL database
  • Connect everything automatically

Manual Installation (Development)

If you prefer to run services individually for development:

  1. Start Database
docker-compose up postgres -d
  1. Setup Backend
cd Backend
npm install
cp .env.example .env
npm run start:dev
  1. Setup Frontend
cd Frontend
npm install
npm start

Access the Application

Demo Credentials

Role Email Password
Admin admin@techhelpdesk.com admin123
Technician tech@techhelpdesk.com tech123
Client client@techhelpdesk.com client123

πŸ“š Documentation

Backend API

  • Swagger UI: Interactive API documentation at /api
  • Test Coverage: HTML reports at /coverage
  • See Backend README for detailed documentation

Frontend

  • Architecture: Component-based Angular application
  • Services: Authentication, Tickets, Users, Categories
  • See Frontend README for detailed documentation

🎯 User Roles & Permissions

πŸ‘‘ Administrator

  • Full CRUD access to all resources
  • User management (create, list, view)
  • Category management
  • Ticket oversight across all users
  • System configuration

πŸ”§ Technician

  • View available open tickets
  • Self-assign tickets (via "Start Working")
  • Update ticket status (in_progress β†’ resolved β†’ closed)
  • View assigned tickets
  • Maximum 5 concurrent tickets in progress

πŸ“ Client

  • Create new tickets
  • View own ticket history
  • See assigned technician details
  • Track ticket status

πŸ”„ Ticket Workflow

OPEN β†’ IN_PROGRESS β†’ RESOLVED β†’ CLOSED
  1. Client creates ticket β†’ Status: OPEN
  2. Technician takes ticket β†’ Status: IN_PROGRESS + Auto-assigned
  3. Technician resolves β†’ Status: RESOLVED
  4. Admin/Technician closes β†’ Status: CLOSED

πŸ—„οΈ Database Schema

Entities

  • User - Base user entity with authentication
  • Client - Client profile (1:1 with User)
  • Technician - Technician profile (1:1 with User)
  • Category - Ticket categories
  • Ticket - Support tickets with relationships

Key Relationships

  • User ↔ Client (One-to-One)
  • User ↔ Technician (One-to-One)
  • Client β†’ Ticket (One-to-Many)
  • Technician β†’ Ticket (One-to-Many, nullable)
  • Category β†’ Ticket (One-to-Many)

πŸ§ͺ Testing

Backend Tests

cd Backend
npm test                 # Run all tests
npm run test:watch      # Watch mode
npm run test:cov        # With coverage report

Test Coverage

View detailed coverage reports at: http://localhost:3000/coverage

πŸ› οΈ Development

Environment Variables

Create .env file in Backend directory:

# Database
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=password
DB_NAME=techhelpdesk

# JWT
JWT_SECRET=your-secret-key-here

# Application
PORT=3000

Database Commands

# Start PostgreSQL
docker-compose up -d

# Stop PostgreSQL
docker-compose down

# View logs
docker-compose logs -f postgres

# Reset database (⚠️ destroys data)
docker-compose down -v
docker-compose up -d

πŸ“¦ Project Structure

TechHelpDesk/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ auth/              # Authentication module
β”‚   β”‚   β”œβ”€β”€ users/             # Users, Clients, Technicians
β”‚   β”‚   β”œβ”€β”€ tickets/           # Ticket management
β”‚   β”‚   β”œβ”€β”€ categories/        # Category management
β”‚   β”‚   β”œβ”€β”€ common/            # Shared filters, interceptors
β”‚   β”‚   └── main.ts            # Application entry point
β”‚   β”œβ”€β”€ test/                  # E2E tests
β”‚   └── package.json
β”‚
β”œβ”€β”€ Frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ services/      # HTTP services
β”‚   β”‚   β”‚   └── guards/        # Route guards
β”‚   β”‚   └── main.ts
β”‚   └── package.json
β”‚
β”œβ”€β”€ docker-compose.yml         # PostgreSQL configuration
└── README.md                  # This file

πŸ” Security Features

  • βœ… JWT-based authentication
  • βœ… Password hashing with bcrypt
  • βœ… Role-based access control (RBAC)
  • βœ… Route guards (frontend & backend)
  • βœ… Input validation with class-validator
  • βœ… CORS configuration
  • βœ… SQL injection protection (TypeORM)

🎨 UI Features

  • βœ… Responsive design
  • βœ… Role-specific dashboards
  • βœ… Color-coded role badges
  • βœ… Status indicators with colors
  • βœ… Real-time ticket updates
  • βœ… Development tools panel (Swagger, Test Reports)
  • βœ… Clean and modern interface

πŸ“ˆ Future Enhancements

  • Real-time notifications (WebSockets)
  • File attachments for tickets
  • Email notifications
  • Ticket comments/threading
  • Advanced search and filters
  • Analytics dashboard
  • Technician availability calendar
  • SLA tracking

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

  • Development Team

πŸ™ Acknowledgments

  • NestJS Framework
  • Angular Team
  • TypeORM Contributors
  • All open-source contributors

Built with ❀️ using NestJS and Angular

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages