# dinhtrongphuc/solution-center-for-it-helpdesk architecture

> Architecture diagram of the GitHub repository dinhtrongphuc/solution-center-for-it-helpdesk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dinhtrongphuc/solution-center-for-it-helpdesk
- Repository: https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk

## Overview

The product is an IT service-desk solution center: users manage technical notes, ask AI questions grounded in those notes, scan Outlook support conversations, and run lead-payment allocation. The React client calls an Express backend whose controllers dispatch to application use cases; note persistence and external integrations are replaceable adapters. The README documents RAG, provider switching, and Outlook conversation grouping, while sampled source confirms application wiring and the main controller flows. Some use-case and adapter internals were not sampled, so uncertain internal calls are omitted.

Main entry points: [`Server/src/app.ts`](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/app.ts) (Server bootstrap), [`client/src/api/client.ts`](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/api/client.ts) (API client), [`client/src/App.tsx`](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/App.tsx) (React application), [`Server/src/ports/outbound/repositories/NoteRepository.ts`](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/repositories/NoteRepository.ts) (Note repository port)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["React application<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_noteform["Note form<br/>[NoteForm.tsx]"]
  node_outlookpage["Outlook scan page"]
  node_allocationpage["Allocation page<br/>[AllocationPage.tsx]"]
  node_apiclient["API client<br/>[client.ts]"]
end

subgraph group_backend["HTTP backend"]
  node_server["Server bootstrap<br/>[app.ts]"]
  node_notecontroller["Note controller<br/>[NoteController.ts]"]
  node_aicontroller["AI controller<br/>[AIController.ts]"]
  node_supportcontroller["Support controller"]
  node_allocationcontroller["Allocation controller"]
  node_noteroutes["Note routes<br/>[NoteRoutes.ts]"]
  node_airoutes["AI routes<br/>[AIRoutes.ts]"]
  node_supportroutes["Support routes"]
  node_allocationroutes["Allocation routes"]
end

subgraph group_notes["Note knowledge"]
  node_noteusecases["Note use cases"]
  node_noterepository["Note repository port<br/>[NoteRepository.ts]"]
  node_knowledgesource["Note knowledge source"]
  node_jsonrepo[("JSON note store")]
  node_mongorepo[("Mongo note store")]
  node_memoryrepo[("Memory note store")]
end

subgraph group_integrations["External workflows"]
  node_groq["Groq adapter<br/>[GroqAdapter.ts]"]
  node_gemini["Gemini adapter<br/>[GeminiAdapter.ts]"]
  node_graphadapter["Microsoft Graph adapter"]
end

subgraph group_domain["Application core"]
  node_askusecase["Ask AI use case<br/>[AskAIUseCase.ts]"]
  node_aiport["AI agent port<br/>[AIAgentPort.ts]"]
  node_scanusecase["Ticket scan use case"]
  node_autoscan["Automatic scanner<br/>[AutoScanService.ts]"]
  node_emailport["Email scanner port"]
  node_allocateusecase["Lead allocation use case"]
  node_crmport["CRM port<br/>[ExternalCrmPort.ts]"]
end

node_user(("Service desk user"))
node_aiservice{{"AI provider"}}
node_outlook{{"Outlook mail"}}

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"routes to"| node_noteform
node_webapp -->|"routes to"| node_outlookpage
node_webapp -->|"routes to"| node_allocationpage
node_dashboard -->|"requests notes and AI"| node_apiclient
node_noteform -->|"sends note changes"| node_apiclient
node_outlookpage -->|"requests scans"| node_apiclient
node_allocationpage -->|"requests allocation"| node_apiclient
node_apiclient -->|"HTTP requests"| node_noteroutes
node_apiclient -->|"HTTP requests"| node_airoutes
node_apiclient -->|"HTTP requests"| node_supportroutes
node_apiclient -->|"HTTP requests"| node_allocationroutes
node_server -->|"registers"| node_noteroutes
node_server -->|"registers"| node_airoutes
node_server -->|"registers"| node_supportroutes
node_server -->|"registers"| node_allocationroutes
node_server -->|"selects by config"| node_jsonrepo
node_server -->|"selects by config"| node_mongorepo
node_server -->|"selects by config"| node_memoryrepo
node_server -->|"selects by config"| node_groq
node_server -->|"selects by config"| node_gemini
node_noteroutes -->|"dispatches"| node_notecontroller
node_airoutes -->|"dispatches"| node_aicontroller
node_supportroutes -->|"dispatches"| node_supportcontroller
node_allocationroutes -->|"dispatches"| node_allocationcontroller
node_notecontroller -->|"executes"| node_noteusecases
node_noteusecases -->|"reads and writes"| node_noterepository
node_noterepository -->|"implemented by"| node_jsonrepo
node_noterepository -->|"implemented by"| node_mongorepo
node_noterepository -->|"implemented by"| node_memoryrepo
node_aicontroller -->|"executes"| node_askusecase
node_askusecase -->|"retrieves context"| node_knowledgesource
node_knowledgesource -->|"reads notes"| node_noterepository
node_askusecase -->|"requests generation"| node_aiport
node_aiport -->|"implemented by"| node_groq
node_aiport -->|"implemented by"| node_gemini
node_groq -->|"generates answer"| node_aiservice
node_gemini -->|"generates answer"| node_aiservice
node_supportcontroller -->|"executes scan"| node_scanusecase
node_supportcontroller -->|"controls schedule"| node_autoscan
node_autoscan -->|"runs periodically"| node_scanusecase
node_scanusecase -->|"requests messages"| node_emailport
node_emailport -->|"implemented by"| node_graphadapter
node_graphadapter -->|"searches conversations"| node_outlook
node_allocationcontroller -->|"executes"| node_allocateusecase
node_allocateusecase -->|"requests CRM operations"| node_crmport

click node_webapp "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/App.tsx"
click node_dashboard "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/Dashboard.tsx"
click node_noteform "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/NoteForm.tsx"
click node_outlookpage "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/OutlookScanPage.tsx"
click node_allocationpage "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/AllocationPage.tsx"
click node_apiclient "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/api/client.ts"
click node_server "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/app.ts"
click node_notecontroller "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/NoteController.ts"
click node_aicontroller "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/ai/AIController.ts"
click node_supportcontroller "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/SupportTicketController.ts"
click node_allocationcontroller "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/AllocationController.ts"
click node_noteroutes "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/NoteRoutes.ts"
click node_airoutes "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/routes/AIRoutes.ts"
click node_supportroutes "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/routes/SupportTicketRoutes.ts"
click node_allocationroutes "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/routes/AllocationRoutes.ts"
click node_noteusecases "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/tree/Base-Hexagonal-Arch/Server/src/application/usecases"
click node_noterepository "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/repositories/NoteRepository.ts"
click node_knowledgesource "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/knowledge/NoteKnowledgeSource.ts"
click node_jsonrepo "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/persistence/JsonNoteRepository.ts"
click node_mongorepo "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/persistence/MongGoDBRepository.ts"
click node_memoryrepo "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/persistence/InMemoryNoteRepository.ts"
click node_askusecase "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/usecases/ai/AskAIUseCase.ts"
click node_aiport "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/ai/AIAgentPort.ts"
click node_groq "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/ai/GroqAdapter.ts"
click node_gemini "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/ai/GeminiAdapter.ts"
click node_scanusecase "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/usecases/ScanSupportTicketsUseCase.ts"
click node_autoscan "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/services/AutoScanService.ts"
click node_emailport "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/IEmailScannerPort.ts"
click node_graphadapter "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/external/GraphEmailAdapter.ts"
click node_allocateusecase "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/usecases/AllocateLeadPayments.ts"
click node_crmport "https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/repositories/ExternalCrmPort.ts"

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_webapp,node_dashboard,node_noteform,node_outlookpage,node_allocationpage,node_apiclient,node_user toneBlue
class node_server,node_notecontroller,node_aicontroller,node_supportcontroller,node_allocationcontroller,node_noteroutes,node_airoutes,node_supportroutes,node_allocationroutes toneAmber
class node_noteusecases,node_noterepository,node_knowledgesource,node_jsonrepo,node_mongorepo,node_memoryrepo toneMint
class node_groq,node_gemini,node_graphadapter toneRose
class node_askusecase,node_aiport,node_scanusecase,node_autoscan,node_emailport,node_allocateusecase,node_crmport,node_aiservice,node_outlook toneIndigo
```

## Components

### Web client

- [React application](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/App.tsx): `client/src/App.tsx`
- [Dashboard](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/Dashboard.tsx): `client/src/pages/Dashboard.tsx`
- [Note form](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/NoteForm.tsx): `client/src/pages/NoteForm.tsx`
- [Outlook scan page](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/OutlookScanPage.tsx): `client/src/pages/OutlookScanPage.tsx`
- [Allocation page](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/pages/AllocationPage.tsx): `client/src/pages/AllocationPage.tsx`
- [API client](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/client/src/api/client.ts): `client/src/api/client.ts`

### HTTP backend

- [Server bootstrap](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/app.ts): `Server/src/app.ts`
- [Note controller](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/NoteController.ts): `Server/src/adapters/primary/controllers/http/NoteController.ts`
- [AI controller](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/ai/AIController.ts): `Server/src/adapters/primary/controllers/http/ai/AIController.ts`
- [Support controller](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/SupportTicketController.ts): `Server/src/adapters/primary/controllers/http/SupportTicketController.ts`
- [Allocation controller](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/AllocationController.ts): `Server/src/adapters/primary/controllers/http/AllocationController.ts`
- [Note routes](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/controllers/http/NoteRoutes.ts): `Server/src/adapters/primary/controllers/http/NoteRoutes.ts`
- [AI routes](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/routes/AIRoutes.ts): `Server/src/adapters/primary/routes/AIRoutes.ts`
- [Support routes](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/routes/SupportTicketRoutes.ts): `Server/src/adapters/primary/routes/SupportTicketRoutes.ts`
- [Allocation routes](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/primary/routes/AllocationRoutes.ts): `Server/src/adapters/primary/routes/AllocationRoutes.ts`

### Note knowledge

- [Note use cases](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/tree/Base-Hexagonal-Arch/Server/src/application/usecases): `Server/src/application/usecases`
- [Note repository port](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/repositories/NoteRepository.ts): `Server/src/ports/outbound/repositories/NoteRepository.ts`
- [Note knowledge source](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/knowledge/NoteKnowledgeSource.ts): `Server/src/adapters/secondary/knowledge/NoteKnowledgeSource.ts`
- [JSON note store](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/persistence/JsonNoteRepository.ts): `Server/src/adapters/secondary/persistence/JsonNoteRepository.ts`
- [Mongo note store](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/persistence/MongGoDBRepository.ts): `Server/src/adapters/secondary/persistence/MongGoDBRepository.ts`
- [Memory note store](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/persistence/InMemoryNoteRepository.ts): `Server/src/adapters/secondary/persistence/InMemoryNoteRepository.ts`

### External workflows

- [Groq adapter](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/ai/GroqAdapter.ts): `Server/src/adapters/secondary/ai/GroqAdapter.ts`
- [Gemini adapter](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/ai/GeminiAdapter.ts): `Server/src/adapters/secondary/ai/GeminiAdapter.ts`
- [Microsoft Graph adapter](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/adapters/secondary/external/GraphEmailAdapter.ts): `Server/src/adapters/secondary/external/GraphEmailAdapter.ts`

### Application core

- [Ask AI use case](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/usecases/ai/AskAIUseCase.ts): `Server/src/application/usecases/ai/AskAIUseCase.ts`
- [AI agent port](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/ai/AIAgentPort.ts): `Server/src/ports/outbound/ai/AIAgentPort.ts`
- [Ticket scan use case](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/usecases/ScanSupportTicketsUseCase.ts): `Server/src/application/usecases/ScanSupportTicketsUseCase.ts`
- [Automatic scanner](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/services/AutoScanService.ts): `Server/src/application/services/AutoScanService.ts`
- [Email scanner port](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/IEmailScannerPort.ts): `Server/src/ports/outbound/IEmailScannerPort.ts`
- [Lead allocation use case](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/application/usecases/AllocateLeadPayments.ts): `Server/src/application/usecases/AllocateLeadPayments.ts`
- [CRM port](https://github.com/dinhtrongphuc/solution-center-for-it-helpdesk/blob/Base-Hexagonal-Arch/Server/src/ports/outbound/repositories/ExternalCrmPort.ts): `Server/src/ports/outbound/repositories/ExternalCrmPort.ts`

### Other components

- **Service desk user**
- **AI provider**
- **Outlook mail**

## Connections

- Service desk user → React application: uses
- React application → Dashboard: routes to
- React application → Note form: routes to
- React application → Outlook scan page: routes to
- React application → Allocation page: routes to
- Dashboard → API client: requests notes and AI
- Note form → API client: sends note changes
- Outlook scan page → API client: requests scans
- Allocation page → API client: requests allocation
- API client → Note routes: HTTP requests
- API client → AI routes: HTTP requests
- API client → Support routes: HTTP requests
- API client → Allocation routes: HTTP requests
- Server bootstrap → Note routes: registers
- Server bootstrap → AI routes: registers
- Server bootstrap → Support routes: registers
- Server bootstrap → Allocation routes: registers
- Server bootstrap → JSON note store: selects by config
- Server bootstrap → Mongo note store: selects by config
- Server bootstrap → Memory note store: selects by config
- Server bootstrap → Groq adapter: selects by config
- Server bootstrap → Gemini adapter: selects by config
- Note routes → Note controller: dispatches
- AI routes → AI controller: dispatches
- Support routes → Support controller: dispatches
- Allocation routes → Allocation controller: dispatches
- Note controller → Note use cases: executes
- Note use cases → Note repository port: reads and writes
- Note repository port → JSON note store: implemented by
- Note repository port → Mongo note store: implemented by
- Note repository port → Memory note store: implemented by
- AI controller → Ask AI use case: executes
- Ask AI use case → Note knowledge source: retrieves context
- Note knowledge source → Note repository port: reads notes
- Ask AI use case → AI agent port: requests generation
- AI agent port → Groq adapter: implemented by
- AI agent port → Gemini adapter: implemented by
- Groq adapter → AI provider: generates answer
- Gemini adapter → AI provider: generates answer
- Support controller → Ticket scan use case: executes scan
- Support controller → Automatic scanner: controls schedule
- Automatic scanner → Ticket scan use case: runs periodically
- Ticket scan use case → Email scanner port: requests messages
- Email scanner port → Microsoft Graph adapter: implemented by
- Microsoft Graph adapter → Outlook mail: searches conversations
- Allocation controller → Lead allocation use case: executes
- Lead allocation use case → CRM port: requests CRM operations
