# lazyoroz/supportflow architecture

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

- Interactive diagram: https://gitdiagram.com/lazyoroz/supportflow
- Repository: https://github.com/lazyoroz/supportflow
- Video tour (about a minute): https://gitdiagram.com/lazyoroz/supportflow/video

## Overview

SupportFlow is a role-based helpdesk: customers register, create and track tickets; agents handle assigned tickets and communicate with customers; administrators oversee tickets, agents, and user moderation. The React application routes users to role-specific pages and the ASP.NET API enforces authorization and ticket rules. The graph highlights ticket lifecycle, comments, authentication, administration, and persistence. Some frontend-to-API links are documented only at a feature level; source excerpts for several controllers and pages were not provided.

Main entry points: [`frontend/src/services/api.js`](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/services/api.js) (HTTP API client), [`frontend/src/App.jsx`](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/App.jsx) (Role-based routes), [`backend/SupportFlow.Infrastructure/Persistence/SupportFlowDbContext.cs`](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Persistence/SupportFlowDbContext.cs) (MySQL persistence), [`backend/SupportFlow.Infrastructure/Services/AuthService.cs`](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Services/AuthService.cs) (Registration and login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React application"]
  node_web["Role-based routes<br/>[App.jsx]"]
  node_authpages["Login and registration<br/>[LoginPage.jsx]"]
  node_customerpages["Customer ticket pages"]
  node_agentpage["Agent dashboard"]
  node_adminpages["Admin workspaces"]
  node_detailpage["Ticket details"]
  node_api_client["HTTP API client<br/>[api.js]"]
end

subgraph group_api["API and application services"]
  node_auth_api["Authentication endpoints<br/>[AuthController.cs]"]
  node_ticket_api["Ticket endpoints"]
  node_comment_api["Comment endpoints"]
  node_admin_api["Administration endpoints<br/>[AdminController.cs]"]
  node_audit["Audit records and moderation<br/>[AdminController.cs]"]
  node_jwt_contract["Token generator contract"]
  node_ticket_contract["Ticket service contract<br/>[ITicketService.cs]"]
end

subgraph group_domain["Helpdesk domain"]
  node_ticket_model["Ticket status and metadata<br/>[Ticket.cs]"]
  node_comment_model["Comment visibility<br/>[Comment.cs]"]
  node_user_model["Users and roles<br/>[User.cs]"]
end

subgraph group_infra["Infrastructure"]
  node_auth_service["Registration and login<br/>[AuthService.cs]"]
  node_jwt["JWT generation"]
  node_ticket_service["Ticket lifecycle and assignment<br/>[TicketService.cs]"]
  node_comment_service["Public replies and notes<br/>[CommentService.cs]"]
  node_db[("MySQL persistence")]
end

node_users(("Customers and staff"))

node_users -->|"uses"| node_web
node_web -->|"routes to"| node_authpages
node_web -->|"routes to"| node_customerpages
node_web -->|"routes to"| node_agentpage
node_web -->|"routes to"| node_adminpages
node_web -->|"routes to"| node_detailpage
node_authpages -.->|"requests API"| node_api_client
node_customerpages -.->|"requests API"| node_api_client
node_agentpage -.->|"requests API"| node_api_client
node_adminpages -.->|"requests API"| node_api_client
node_detailpage -.->|"requests API"| node_api_client
node_api_client -.->|"calls"| node_auth_api
node_api_client -.->|"calls"| node_ticket_api
node_api_client -.->|"calls"| node_comment_api
node_auth_api -->|"delegates to"| node_auth_service
node_ticket_api -->|"calls"| node_ticket_contract
node_ticket_contract -->|"implemented by"| node_ticket_service
node_comment_api -->|"delegates to"| node_comment_service
node_admin_api -->|"reads and writes"| node_db
node_auth_service -->|"reads and writes"| node_db
node_auth_service -->|"requests token"| node_jwt_contract
node_jwt_contract -->|"implemented by"| node_jwt
node_ticket_service -->|"reads and writes"| node_db
node_comment_service -->|"reads and writes"| node_db
node_ticket_service -->|"creates and updates"| node_ticket_model
node_comment_service -->|"creates and filters"| node_comment_model

click node_web "https://github.com/lazyoroz/supportflow/blob/main/frontend/src/App.jsx"
click node_authpages "https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/LoginPage.jsx"
click node_customerpages "https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/CreateTicketPage.jsx"
click node_agentpage "https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/AgentDashboardPage.jsx"
click node_adminpages "https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/AdminTicketsPage.jsx"
click node_detailpage "https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/TicketDetailsPage.jsx"
click node_api_client "https://github.com/lazyoroz/supportflow/blob/main/frontend/src/services/api.js"
click node_auth_api "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/AuthController.cs"
click node_ticket_api "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/TicketsController.cs"
click node_comment_api "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/CommentsController.cs"
click node_admin_api "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/AdminController.cs"
click node_auth_service "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Services/AuthService.cs"
click node_jwt "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Authentication/JwtTokenGenerator.cs"
click node_ticket_service "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Services/TicketService.cs"
click node_comment_service "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Services/CommentService.cs"
click node_audit "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/AdminController.cs"
click node_ticket_model "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Domain/Entities/Ticket.cs"
click node_comment_model "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Domain/Entities/Comment.cs"
click node_user_model "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Domain/Entities/User.cs"
click node_db "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Persistence/SupportFlowDbContext.cs"
click node_jwt_contract "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Application/Auth/Interfaces/IJwtTokenGenerator.cs"
click node_ticket_contract "https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Application/Tickets/Interfaces/ITicketService.cs"

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_web,node_authpages,node_customerpages,node_agentpage,node_adminpages,node_detailpage,node_api_client toneBlue
class node_auth_api,node_ticket_api,node_comment_api,node_admin_api,node_audit,node_jwt_contract,node_ticket_contract toneAmber
class node_ticket_model,node_comment_model,node_user_model toneMint
class node_auth_service,node_jwt,node_ticket_service,node_comment_service,node_db toneRose
class node_users toneIndigo
```

## Components

### React application

- [Role-based routes](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login and registration](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/LoginPage.jsx): `frontend/src/pages/LoginPage.jsx`
- [Customer ticket pages](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/CreateTicketPage.jsx): `frontend/src/pages/CreateTicketPage.jsx`
- [Agent dashboard](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/AgentDashboardPage.jsx): `frontend/src/pages/AgentDashboardPage.jsx`
- [Admin workspaces](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/AdminTicketsPage.jsx): `frontend/src/pages/AdminTicketsPage.jsx`
- [Ticket details](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/pages/TicketDetailsPage.jsx): `frontend/src/pages/TicketDetailsPage.jsx`
- [HTTP API client](https://github.com/lazyoroz/supportflow/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and application services

- [Authentication endpoints](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/AuthController.cs): `backend/SupportFlow.Api/Controllers/AuthController.cs`
- [Ticket endpoints](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/TicketsController.cs): `backend/SupportFlow.Api/Controllers/TicketsController.cs`
- [Comment endpoints](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/CommentsController.cs): `backend/SupportFlow.Api/Controllers/CommentsController.cs`
- [Administration endpoints](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/AdminController.cs): `backend/SupportFlow.Api/Controllers/AdminController.cs`
- [Audit records and moderation](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Api/Controllers/AdminController.cs): `backend/SupportFlow.Api/Controllers/AdminController.cs`
- [Token generator contract](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Application/Auth/Interfaces/IJwtTokenGenerator.cs): `backend/SupportFlow.Application/Auth/Interfaces/IJwtTokenGenerator.cs`
- [Ticket service contract](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Application/Tickets/Interfaces/ITicketService.cs): `backend/SupportFlow.Application/Tickets/Interfaces/ITicketService.cs`

### Helpdesk domain

- [Ticket status and metadata](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Domain/Entities/Ticket.cs): `backend/SupportFlow.Domain/Entities/Ticket.cs`
- [Comment visibility](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Domain/Entities/Comment.cs): `backend/SupportFlow.Domain/Entities/Comment.cs`
- [Users and roles](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Domain/Entities/User.cs): `backend/SupportFlow.Domain/Entities/User.cs`

### Infrastructure

- [Registration and login](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Services/AuthService.cs): `backend/SupportFlow.Infrastructure/Services/AuthService.cs`
- [JWT generation](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Authentication/JwtTokenGenerator.cs): `backend/SupportFlow.Infrastructure/Authentication/JwtTokenGenerator.cs`
- [Ticket lifecycle and assignment](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Services/TicketService.cs): `backend/SupportFlow.Infrastructure/Services/TicketService.cs`
- [Public replies and notes](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Services/CommentService.cs): `backend/SupportFlow.Infrastructure/Services/CommentService.cs`
- [MySQL persistence](https://github.com/lazyoroz/supportflow/blob/main/backend/SupportFlow.Infrastructure/Persistence/SupportFlowDbContext.cs): `backend/SupportFlow.Infrastructure/Persistence/SupportFlowDbContext.cs`

### Other components

- **Customers and staff**

## Connections

- Customers and staff → Role-based routes: uses (evidence: `README.md`)
- Role-based routes → Login and registration: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Customer ticket pages: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Agent dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Admin workspaces: routes to (evidence: `frontend/src/App.jsx`)
- Role-based routes → Ticket details: routes to (evidence: `frontend/src/App.jsx`)
- Login and registration → HTTP API client: requests API
- Customer ticket pages → HTTP API client: requests API
- Agent dashboard → HTTP API client: requests API
- Admin workspaces → HTTP API client: requests API
- Ticket details → HTTP API client: requests API
- HTTP API client → Authentication endpoints: calls
- HTTP API client → Ticket endpoints: calls
- HTTP API client → Comment endpoints: calls
- Authentication endpoints → Registration and login: delegates to (evidence: `backend/SupportFlow.Api/Controllers/AuthController.cs`)
- Ticket endpoints → Ticket service contract: calls (evidence: `backend/SupportFlow.Api/Controllers/TicketsController.cs`)
- Ticket service contract → Ticket lifecycle and assignment: implemented by (evidence: `backend/SupportFlow.Infrastructure/Services/TicketService.cs`)
- Comment endpoints → Public replies and notes: delegates to (evidence: `backend/SupportFlow.Api/Controllers/CommentsController.cs`)
- Administration endpoints → MySQL persistence: reads and writes (evidence: `backend/SupportFlow.Api/Controllers/AdminController.cs`)
- Registration and login → MySQL persistence: reads and writes (evidence: `backend/SupportFlow.Infrastructure/Services/AuthService.cs`)
- Registration and login → Token generator contract: requests token (evidence: `backend/SupportFlow.Infrastructure/Services/AuthService.cs`)
- Token generator contract → JWT generation: implemented by (evidence: `backend/SupportFlow.Api/Program.cs`)
- Ticket lifecycle and assignment → MySQL persistence: reads and writes (evidence: `backend/SupportFlow.Infrastructure/Services/TicketService.cs`)
- Public replies and notes → MySQL persistence: reads and writes (evidence: `backend/SupportFlow.Infrastructure/Services/CommentService.cs`)
- Ticket lifecycle and assignment → Ticket status and metadata: creates and updates (evidence: `backend/SupportFlow.Infrastructure/Services/TicketService.cs`)
- Public replies and notes → Comment visibility: creates and filters (evidence: `backend/SupportFlow.Infrastructure/Services/CommentService.cs`)
