Skip to content

Internal ticketing system (Spring Boot + JPA + Security)

Notifications You must be signed in to change notification settings

Zhiqi-Yu/ticket-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticketing System (Gateway + Ticket Service)

Simple role-based ticket workflow with email + PDF notifications.

  1. Overview / Workflow
  • Roles

    • USER: creates tickets, uploads attachment, can close/reopen.
    • MANAGER: reviews tickets, approves/rejects.
    • ADMIN: resolves approved tickets.
    • System log: Each operation is written to TicketHistory.
  • Flow

    • USER creates a ticket (+ optional attachment).
    • MANAGER approves/rejects.
    • ADMIN resolves approved ticket.
    • Email & PDF: on create → notify user & manager; on resolve → send PDF to user (optional cc admin).
    • “List OPEN” shows OPEN + REOPENED tickets.
  • Modules:

  • ticket-system/

    • gateway-web/ # UI (Thymeleaf + fetch), runs on :8080
    • ticket-service/ # API + Security + DB + AOP notifications, runs on :8081
  • Project Structure:

  • ticket-service/

  • ├─ controller/ # TicketController, DashboardController

  • ├─ entity/ # Ticket, TicketHistory, Employee, Role

  • ├─ repository/ # TicketRepo, TicketHistoryRepo, ...

  • ├─ security/ # SecurityConfig, DbUserDetailsService, AuthController

  • ├─ service/ # TicketService, FileStorageService, BootstrapData

  • ├─ notify/ # NotificationAspect, EmailService, PdfService

  • └─ resources/

    • └─ application.yml
  • gateway-web/

  • └─ resources/templates

    • ├─ index.html # After logging in, the front end jumps by role
    • ├─ dash-user.html
    • ├─ dash-manager.html
    • └─ dash-admin.html
  1. Spring Security
  • Form login at ticket-service (/login), BCrypt password encoder.
  • SecurityFilterChain: allow /login, protect /api/**, enable CORS to :8080.
  • Login redirect: After successful login, the backend redirects to http://localhost:8080/.
  • Role-based UI routing: The gateway homepage script calls http://localhost:8081/api/me to determine the role and redirect to /user / /manager / /admin.
  • Role frontend routing is performed by the gateway.
  1. Notification
  • EmailService.sendText(to, subject, text): Sends a plain text email (when creating).
  • PdfService.ticketSummary(...): byte[]: Generates a PDF byte array (when resolving).
  • EmailService.sendWithAttachment(to, subject, text, pdfBytes, filename): Sends an email with a PDF attachment.
  • NotificationAspect (AOP) hooks after TicketService.create(...) and after TicketService.resolve(...)。
  1. Frontend <---> Backend
  • gateway-web: Thymeleaf + native fetch (cross-origin cookies).
  • ticket-service: Spring Boot (Web, Security, Data JPA), MySQL, AOP, JavaMail, iText PDF.

About

Internal ticketing system (Spring Boot + JPA + Security)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published