IT Helpdesk / Ticketing System - Full stack application for managing internal support tickets.
- 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)
- 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)
- Containerization: Docker + Docker Compose
- Orchestration: 3 services (db, backend, frontend)
- Login / Logout with JWT access tokens
- Session management with
meendpoint - Account activation status check
- Role-based access control (ADMIN, TECHNICIAN, EMPLOYEE)
- 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 logging for all ticket actions
- Category & Parent Category management
- Department management
- Location management
- SLA policy configuration
- Ticket statistics and charts
- Real-time status overview
- Activity tracking
- Automated notifications for ticket creation, comments, status changes
- Notification targeting based on user roles
- Attachment support with storage in database
- MIME type and size validation
βββββββββββββββββββ 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)
- Docker and Docker Compose
# 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)| Service | Ports | Description |
|---|---|---|
db |
5433:5432 | PostgreSQL database |
backend |
4213:4213 | Node.js Express API |
frontend |
5173:80 | React app served via Nginx |
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).
ticketing_system_pgdata- PostgreSQL data persistence
- Node.js 20+
- PostgreSQL 16+
- yarn or npm
# 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# 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# Backend
cd backend
npm run build
npm run start
# Frontend
cd frontend
npm run build
# Output goes to dist/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:pushPOST /api/auth/login- Authenticate userPOST /api/auth/logout- Revoke tokenGET /api/auth/me- Get current user profile
GET /api/users- List users (admin only)
| 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 |
GET /api/categories- List categoriesGET /api/parent-categories- List parent categoriesGET /api/departments- List departmentsGET /api/locations- List locationsGET /api/sla- SLA policies
GET /api/dashboard/statistics- Get stats
GET /api/notifications- List user notificationsGET /api/audit-logs- Audit trail (admin only)








