# prashantkumar1992/ticket-system architecture

> Architecture diagram of the GitHub repository prashantkumar1992/ticket-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prashantkumar1992/ticket-system
- Repository: https://github.com/prashantkumar1992/ticket-system

## Overview

Resolve is a support-ticket workspace: users create, search, filter, and update tickets, manage comments and ticket status, or ask AI questions about ticket history. The UI calls a Spring REST API; ticket services persist domain records and publish events that drive RAG ingestion. AI Q&A retrieves ticket context before generating a grounded response. The README also describes sentiment analysis and summarization. Source excerpts show the core service and RAG links; some controller, UI, and AI implementation details are supported only by the source index or README.

Main entry points: [`src/main/java/support_ticket_system/rag/TicketIngestionService.java`](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/TicketIngestionService.java) (Embedding ingestion), [`frontend/src/services/api.ts`](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/services/api.ts) (API client), [`frontend/src/App.tsx`](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/App.tsx) (Workspace shell), [`src/main/java/support_ticket_system/service/TicketService.java`](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/service/TicketService.java) (Ticket operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Workspace UI"]
  node_app["Workspace shell<br/>[App.tsx]"]
  node_ticket_views["Ticket views<br/>[TicketList.tsx]"]
  node_ticket_detail["Ticket detail<br/>[TicketDetail.tsx]"]
  node_ticket_create["Ticket creation<br/>[CreateTicket.tsx]"]
  node_ai_hub["AI workspace<br/>[AiHub.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Ticket API"]
  node_ticket_api["Ticket endpoints"]
  node_comment_api["Comment endpoints"]
  node_ai_api["AI endpoints<br/>[AiController.java]"]
end

subgraph group_domain["Ticket domain"]
  node_ticket_service["Ticket operations<br/>[TicketService.java]"]
  node_comment_service["Comment operations"]
  node_state_machine["Status transitions<br/>[StateMachine.java]"]
  node_ticket_model["Ticket records<br/>[Ticket.java]"]
  node_comment_model["Comment records<br/>[Comment.java]"]
end

subgraph group_rag["AI and retrieval"]
  node_ai_service["AI responses<br/>[AiService.java]"]
  node_retrieval["Context retrieval"]
  node_chunkizer["Ticket chunking"]
  node_ingestion["Embedding ingestion"]
  node_sentiment["Sentiment analysis<br/>[AiService.java]"]
  node_summarization["Text summarization<br/>[AiService.java]"]
end

subgraph group_storage["Persistence"]
  node_ticket_repo[("Ticket repository")]
  node_comment_repo[("Comment repository")]
  node_embedding_meta[("Embedding metadata")]
  node_vector_store[("Vector store")]
end

node_user(("Support user"))
node_ollama{{"Ollama models"}}

node_user -->|"uses"| node_app
node_app -->|"shows"| node_ticket_views
node_app -->|"shows"| node_ticket_detail
node_app -->|"shows"| node_ticket_create
node_app -->|"shows"| node_ai_hub
node_ticket_views -->|"requests"| node_api_client
node_ticket_detail -->|"requests"| node_api_client
node_ticket_create -.->|"requests"| node_api_client
node_ai_hub -->|"requests"| node_api_client
node_api_client -->|"calls"| node_ticket_api
node_api_client -->|"calls"| node_comment_api
node_api_client -->|"calls"| node_ai_api
node_ticket_api -->|"delegates"| node_ticket_service
node_comment_api -->|"delegates"| node_comment_service
node_ai_api -->|"delegates"| node_ai_service
node_ticket_service -->|"reads and writes"| node_ticket_repo
node_ticket_service -->|"validates"| node_state_machine
node_ticket_service -->|"publishes ticket events"| node_ingestion
node_comment_service -->|"loads ticket"| node_ticket_repo
node_comment_service -->|"reads and writes"| node_comment_repo
node_comment_service -->|"publishes comment event"| node_ingestion
node_ticket_service -->|"creates and updates"| node_ticket_model
node_comment_service -->|"creates"| node_comment_model
node_ingestion -->|"loads ticket"| node_ticket_repo
node_ingestion -->|"chunks"| node_chunkizer
node_ingestion -->|"stores embeddings"| node_vector_store
node_ingestion -->|"clears metadata"| node_embedding_meta
node_retrieval -->|"searches"| node_vector_store
node_retrieval -->|"loads status matches"| node_ticket_repo
node_retrieval -->|"chunks matches"| node_chunkizer
node_ai_service -->|"retrieves context"| node_retrieval
node_ai_service -.->|"generates answers"| node_ollama
node_ingestion -.->|"embeds chunks"| node_ollama
node_sentiment -.->|"analyzes text"| node_ollama
node_summarization -.->|"summarizes text"| node_ollama
node_ticket_repo -->|"persists"| node_ticket_model
node_comment_repo -->|"persists"| node_comment_model

click node_app "https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/App.tsx"
click node_ticket_views "https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/TicketList.tsx"
click node_ticket_detail "https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/TicketDetail.tsx"
click node_ticket_create "https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/CreateTicket.tsx"
click node_ai_hub "https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/AiHub.tsx"
click node_api_client "https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/services/api.ts"
click node_ticket_api "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/controller/TicketController.java"
click node_comment_api "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/controller/CommentController.java"
click node_ai_api "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/controller/AiController.java"
click node_ticket_service "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/service/TicketService.java"
click node_comment_service "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/service/CommentService.java"
click node_state_machine "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/service/StateMachine.java"
click node_ticket_model "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/entity/Ticket.java"
click node_comment_model "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/entity/Comment.java"
click node_ai_service "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/AiService.java"
click node_retrieval "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/RetrievalService.java"
click node_chunkizer "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/TicketChunkizer.java"
click node_ingestion "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/TicketIngestionService.java"
click node_ticket_repo "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/repository/TicketRepository.java"
click node_comment_repo "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/repository/CommentRepository.java"
click node_embedding_meta "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/repository/TicketEmbeddingMetadataRepository.java"
click node_sentiment "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/AiService.java"
click node_summarization "https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/AiService.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_ticket_views,node_ticket_detail,node_ticket_create,node_ai_hub,node_api_client,node_user toneBlue
class node_ticket_api,node_comment_api,node_ai_api toneAmber
class node_ticket_service,node_comment_service,node_state_machine,node_ticket_model,node_comment_model toneMint
class node_ai_service,node_retrieval,node_chunkizer,node_ingestion,node_sentiment,node_summarization toneRose
class node_ticket_repo,node_comment_repo,node_embedding_meta,node_vector_store,node_ollama toneIndigo
```

## Components

### Workspace UI

- [Workspace shell](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Ticket views](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/TicketList.tsx): `frontend/src/components/TicketList.tsx`
- [Ticket detail](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/TicketDetail.tsx): `frontend/src/components/TicketDetail.tsx`
- [Ticket creation](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/CreateTicket.tsx): `frontend/src/components/CreateTicket.tsx`
- [AI workspace](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/components/AiHub.tsx): `frontend/src/components/AiHub.tsx`
- [API client](https://github.com/prashantkumar1992/ticket-system/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Ticket API

- [Ticket endpoints](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/controller/TicketController.java): `src/main/java/support_ticket_system/controller/TicketController.java`
- [Comment endpoints](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/controller/CommentController.java): `src/main/java/support_ticket_system/controller/CommentController.java`
- [AI endpoints](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/controller/AiController.java): `src/main/java/support_ticket_system/controller/AiController.java`

### Ticket domain

- [Ticket operations](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/service/TicketService.java): `src/main/java/support_ticket_system/service/TicketService.java`
- [Comment operations](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/service/CommentService.java): `src/main/java/support_ticket_system/service/CommentService.java`
- [Status transitions](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/service/StateMachine.java): `src/main/java/support_ticket_system/service/StateMachine.java`
- [Ticket records](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/entity/Ticket.java): `src/main/java/support_ticket_system/entity/Ticket.java`
- [Comment records](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/entity/Comment.java): `src/main/java/support_ticket_system/entity/Comment.java`

### AI and retrieval

- [AI responses](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/AiService.java): `src/main/java/support_ticket_system/rag/AiService.java`
- [Context retrieval](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/RetrievalService.java): `src/main/java/support_ticket_system/rag/RetrievalService.java`
- [Ticket chunking](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/TicketChunkizer.java): `src/main/java/support_ticket_system/rag/TicketChunkizer.java`
- [Embedding ingestion](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/TicketIngestionService.java): `src/main/java/support_ticket_system/rag/TicketIngestionService.java`
- [Sentiment analysis](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/AiService.java): `src/main/java/support_ticket_system/rag/AiService.java`
- [Text summarization](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/rag/AiService.java): `src/main/java/support_ticket_system/rag/AiService.java`

### Persistence

- [Ticket repository](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/repository/TicketRepository.java): `src/main/java/support_ticket_system/repository/TicketRepository.java`
- [Comment repository](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/repository/CommentRepository.java): `src/main/java/support_ticket_system/repository/CommentRepository.java`
- [Embedding metadata](https://github.com/prashantkumar1992/ticket-system/blob/main/src/main/java/support_ticket_system/repository/TicketEmbeddingMetadataRepository.java): `src/main/java/support_ticket_system/repository/TicketEmbeddingMetadataRepository.java`
- **Vector store**

### Other components

- **Support user**
- **Ollama models**

## Connections

- Support user → Workspace shell: uses (evidence: `frontend/src/App.tsx`)
- Workspace shell → Ticket views: shows (evidence: `frontend/src/App.tsx`)
- Workspace shell → Ticket detail: shows (evidence: `frontend/src/App.tsx`)
- Workspace shell → Ticket creation: shows (evidence: `frontend/src/App.tsx`)
- Workspace shell → AI workspace: shows (evidence: `frontend/src/App.tsx`)
- Ticket views → API client: requests (evidence: `frontend/src/components/TicketList.tsx`)
- Ticket detail → API client: requests (evidence: `frontend/src/components/TicketDetail.tsx`)
- Ticket creation → API client: requests (evidence: `frontend/src/components/CreateTicket.tsx`)
- AI workspace → API client: requests (evidence: `frontend/src/components/AiHub.tsx`)
- API client → Ticket endpoints: calls (evidence: `frontend/src/services/api.ts`)
- API client → Comment endpoints: calls (evidence: `frontend/src/services/api.ts`)
- API client → AI endpoints: calls (evidence: `frontend/src/services/api.ts`)
- Ticket endpoints → Ticket operations: delegates (evidence: `src/main/java/support_ticket_system/controller/TicketController.java`)
- Comment endpoints → Comment operations: delegates (evidence: `src/main/java/support_ticket_system/controller/CommentController.java`)
- AI endpoints → AI responses: delegates (evidence: `src/main/java/support_ticket_system/controller/AiController.java`)
- Ticket operations → Ticket repository: reads and writes (evidence: `src/main/java/support_ticket_system/service/TicketService.java`)
- Ticket operations → Status transitions: validates (evidence: `src/main/java/support_ticket_system/service/TicketService.java`)
- Ticket operations → Embedding ingestion: publishes ticket events (evidence: `src/main/java/support_ticket_system/service/TicketService.java`)
- Comment operations → Ticket repository: loads ticket (evidence: `src/main/java/support_ticket_system/service/CommentService.java`)
- Comment operations → Comment repository: reads and writes (evidence: `src/main/java/support_ticket_system/service/CommentService.java`)
- Comment operations → Embedding ingestion: publishes comment event (evidence: `src/main/java/support_ticket_system/service/CommentService.java`)
- Ticket operations → Ticket records: creates and updates (evidence: `src/main/java/support_ticket_system/service/TicketService.java`)
- Comment operations → Comment records: creates (evidence: `src/main/java/support_ticket_system/service/CommentService.java`)
- Embedding ingestion → Ticket repository: loads ticket (evidence: `src/main/java/support_ticket_system/rag/TicketIngestionService.java`)
- Embedding ingestion → Ticket chunking: chunks (evidence: `src/main/java/support_ticket_system/rag/TicketIngestionService.java`)
- Embedding ingestion → Vector store: stores embeddings (evidence: `src/main/java/support_ticket_system/rag/TicketIngestionService.java`)
- Embedding ingestion → Embedding metadata: clears metadata (evidence: `src/main/java/support_ticket_system/rag/TicketIngestionService.java`)
- Context retrieval → Vector store: searches (evidence: `src/main/java/support_ticket_system/rag/RetrievalService.java`)
- Context retrieval → Ticket repository: loads status matches (evidence: `src/main/java/support_ticket_system/rag/RetrievalService.java`)
- Context retrieval → Ticket chunking: chunks matches (evidence: `src/main/java/support_ticket_system/rag/RetrievalService.java`)
- AI responses → Context retrieval: retrieves context (evidence: `src/main/java/support_ticket_system/rag/AiService.java`)
- AI responses → Ollama models: generates answers (evidence: `README.md`)
- Embedding ingestion → Ollama models: embeds chunks (evidence: `README.md`)
- Sentiment analysis → Ollama models: analyzes text (evidence: `README.md`)
- Text summarization → Ollama models: summarizes text (evidence: `README.md`)
- Ticket repository → Ticket records: persists (evidence: `src/main/java/support_ticket_system/repository/TicketRepository.java`)
- Comment repository → Comment records: persists (evidence: `src/main/java/support_ticket_system/repository/CommentRepository.java`)
