# osizk/toktickit architecture

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

- Interactive diagram: https://gitdiagram.com/osizk/toktickit
- Repository: https://github.com/osizk/toktickit

## Overview

TokTickIT is a web-based IT service desk. Requesters authenticate, create and manage tickets and attachments; IT staff handle a searchable ticket queue and ticket operations; administrators manage users. The React client presents these workflows through a shared API client, while Express routes enforce session and role checks and delegate to domain services backed by Prisma/PostgreSQL. The graph follows the documented capabilities and available source references; several service internals and route-to-service details were not sampled, so those links are omitted rather than inferred.

Main entry points: [`server/src/app.ts`](https://github.com/osizk/toktickit/blob/main/server/src/app.ts) (HTTP routes), [`server/src/prisma.ts`](https://github.com/osizk/toktickit/blob/main/server/src/prisma.ts) (Prisma client), [`client/src/api.ts`](https://github.com/osizk/toktickit/blob/main/client/src/api.ts) (API client), [`client/src/App.tsx`](https://github.com/osizk/toktickit/blob/main/client/src/App.tsx) (App and routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App and routing<br/>[App.tsx]"]
  node_newticket["Create ticket<br/>[CreateTicket.tsx]"]
  node_mytickets["My tickets<br/>[MyTickets.tsx]"]
  node_ticketdetail["Requester ticket detail<br/>[TicketDetail.tsx]"]
  node_staffqueueui["Staff queue"]
  node_staffdetailui["Staff ticket detail"]
  node_usersui["User management"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_api["API and identity"]
  node_express["HTTP routes<br/>[app.ts]"]
  node_auth["Authentication and sessions<br/>[auth-service.ts]"]
  node_authvalidation["Identity validation<br/>[auth-validation.ts]"]
end

subgraph group_domain["Service desk domain"]
  node_ticketcreate["Ticket creation<br/>[ticket-service.ts]"]
  node_ticketlist["Requester ticket list"]
  node_ticketdetailservice["Ticket detail and attachments"]
  node_staffqueue["Staff queue and operations"]
  node_comments["Ticket comments<br/>[comment-service.ts]"]
  node_notes["Internal notes<br/>[note-service.ts]"]
  node_userservice["User administration"]
  node_attachmentvalidation["Attachment validation"]
  node_ticketvalidation["Ticket validation"]
end

subgraph group_data["Persistence"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_database[("PostgreSQL data<br/>[schema.prisma]")]
end

node_requester(("Requester"))
node_staff(("IT staff"))
node_admin(("Administrator"))

node_requester -->|"uses"| node_app
node_staff -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"calls"| node_clientapi
node_app -->|"renders"| node_ticketdetail
node_app -->|"renders"| node_staffqueueui
node_newticket -->|"requests"| node_clientapi
node_mytickets -->|"requests"| node_clientapi
node_ticketdetail -->|"requests"| node_clientapi
node_staffqueueui -->|"requests"| node_clientapi
node_staffdetailui -->|"requests"| node_clientapi
node_usersui -->|"requests"| node_clientapi
node_clientapi -.->|"HTTP requests"| node_express
node_express -->|"authenticates"| node_auth
node_express -->|"routes to"| node_ticketcreate
node_express -->|"routes to"| node_ticketlist
node_express -->|"routes to"| node_ticketdetailservice
node_express -->|"routes to"| node_staffqueue
node_express -->|"routes to"| node_comments
node_express -->|"routes to"| node_notes
node_express -->|"routes to"| node_userservice
node_auth -->|"reads and writes"| node_prisma
node_userservice -->|"validates with"| node_authvalidation
node_userservice -->|"uses"| node_auth
node_ticketcreate -->|"validates with"| node_ticketvalidation
node_ticketcreate -.->|"uses"| node_attachmentvalidation
node_ticketcreate -->|"writes through"| node_prisma
node_ticketlist -->|"queries through"| node_prisma
node_ticketdetailservice -->|"queries through"| node_prisma
node_staffqueue -->|"queries through"| node_prisma
node_userservice -->|"reads and writes"| node_prisma
node_comments -->|"reads and writes"| node_prisma
node_notes -->|"reads and writes"| node_prisma
node_prisma -.->|"accesses"| node_database

click node_app "https://github.com/osizk/toktickit/blob/main/client/src/App.tsx"
click node_newticket "https://github.com/osizk/toktickit/blob/main/client/src/CreateTicket.tsx"
click node_mytickets "https://github.com/osizk/toktickit/blob/main/client/src/MyTickets.tsx"
click node_ticketdetail "https://github.com/osizk/toktickit/blob/main/client/src/TicketDetail.tsx"
click node_staffqueueui "https://github.com/osizk/toktickit/blob/main/client/src/StaffTicketQueue.tsx"
click node_staffdetailui "https://github.com/osizk/toktickit/blob/main/client/src/StaffTicketDetail.tsx"
click node_usersui "https://github.com/osizk/toktickit/blob/main/client/src/AdminUserManagement.tsx"
click node_clientapi "https://github.com/osizk/toktickit/blob/main/client/src/api.ts"
click node_express "https://github.com/osizk/toktickit/blob/main/server/src/app.ts"
click node_auth "https://github.com/osizk/toktickit/blob/main/server/src/auth-service.ts"
click node_authvalidation "https://github.com/osizk/toktickit/blob/main/server/src/auth-validation.ts"
click node_ticketcreate "https://github.com/osizk/toktickit/blob/main/server/src/ticket-service.ts"
click node_ticketlist "https://github.com/osizk/toktickit/blob/main/server/src/ticket-list-service.ts"
click node_ticketdetailservice "https://github.com/osizk/toktickit/blob/main/server/src/ticket-detail-service.ts"
click node_staffqueue "https://github.com/osizk/toktickit/blob/main/server/src/staff-queue-service.ts"
click node_comments "https://github.com/osizk/toktickit/blob/main/server/src/comment-service.ts"
click node_notes "https://github.com/osizk/toktickit/blob/main/server/src/note-service.ts"
click node_userservice "https://github.com/osizk/toktickit/blob/main/server/src/user-management-service.ts"
click node_attachmentvalidation "https://github.com/osizk/toktickit/blob/main/server/src/attachment-validation.ts"
click node_ticketvalidation "https://github.com/osizk/toktickit/blob/main/server/src/ticket-validation.ts"
click node_prisma "https://github.com/osizk/toktickit/blob/main/server/src/prisma.ts"
click node_database "https://github.com/osizk/toktickit/blob/main/server/prisma/schema.prisma"

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_newticket,node_mytickets,node_ticketdetail,node_staffqueueui,node_staffdetailui,node_usersui,node_clientapi toneBlue
class node_express,node_auth,node_authvalidation toneAmber
class node_ticketcreate,node_ticketlist,node_ticketdetailservice,node_staffqueue,node_comments,node_notes,node_userservice,node_attachmentvalidation,node_ticketvalidation,node_requester toneMint
class node_prisma,node_database toneRose
class node_staff,node_admin toneIndigo
```

## Components

### Web client

- [App and routing](https://github.com/osizk/toktickit/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Create ticket](https://github.com/osizk/toktickit/blob/main/client/src/CreateTicket.tsx): `client/src/CreateTicket.tsx`
- [My tickets](https://github.com/osizk/toktickit/blob/main/client/src/MyTickets.tsx): `client/src/MyTickets.tsx`
- [Requester ticket detail](https://github.com/osizk/toktickit/blob/main/client/src/TicketDetail.tsx): `client/src/TicketDetail.tsx`
- [Staff queue](https://github.com/osizk/toktickit/blob/main/client/src/StaffTicketQueue.tsx): `client/src/StaffTicketQueue.tsx`
- [Staff ticket detail](https://github.com/osizk/toktickit/blob/main/client/src/StaffTicketDetail.tsx): `client/src/StaffTicketDetail.tsx`
- [User management](https://github.com/osizk/toktickit/blob/main/client/src/AdminUserManagement.tsx): `client/src/AdminUserManagement.tsx`
- [API client](https://github.com/osizk/toktickit/blob/main/client/src/api.ts): `client/src/api.ts`

### API and identity

- [HTTP routes](https://github.com/osizk/toktickit/blob/main/server/src/app.ts): `server/src/app.ts`
- [Authentication and sessions](https://github.com/osizk/toktickit/blob/main/server/src/auth-service.ts): `server/src/auth-service.ts`
- [Identity validation](https://github.com/osizk/toktickit/blob/main/server/src/auth-validation.ts): `server/src/auth-validation.ts`

### Service desk domain

- [Ticket creation](https://github.com/osizk/toktickit/blob/main/server/src/ticket-service.ts): `server/src/ticket-service.ts`
- [Requester ticket list](https://github.com/osizk/toktickit/blob/main/server/src/ticket-list-service.ts): `server/src/ticket-list-service.ts`
- [Ticket detail and attachments](https://github.com/osizk/toktickit/blob/main/server/src/ticket-detail-service.ts): `server/src/ticket-detail-service.ts`
- [Staff queue and operations](https://github.com/osizk/toktickit/blob/main/server/src/staff-queue-service.ts): `server/src/staff-queue-service.ts`
- [Ticket comments](https://github.com/osizk/toktickit/blob/main/server/src/comment-service.ts): `server/src/comment-service.ts`
- [Internal notes](https://github.com/osizk/toktickit/blob/main/server/src/note-service.ts): `server/src/note-service.ts`
- [User administration](https://github.com/osizk/toktickit/blob/main/server/src/user-management-service.ts): `server/src/user-management-service.ts`
- [Attachment validation](https://github.com/osizk/toktickit/blob/main/server/src/attachment-validation.ts): `server/src/attachment-validation.ts`
- [Ticket validation](https://github.com/osizk/toktickit/blob/main/server/src/ticket-validation.ts): `server/src/ticket-validation.ts`

### Persistence

- [Prisma client](https://github.com/osizk/toktickit/blob/main/server/src/prisma.ts): `server/src/prisma.ts`
- [PostgreSQL data](https://github.com/osizk/toktickit/blob/main/server/prisma/schema.prisma): `server/prisma/schema.prisma`

### Other components

- **Requester**
- **IT staff**
- **Administrator**

## Connections

- Requester → App and routing: uses (evidence: `README.md`)
- IT staff → App and routing: uses (evidence: `README.md`)
- Administrator → App and routing: uses (evidence: `README.md`)
- App and routing → API client: calls (evidence: `client/src/App.tsx`)
- App and routing → Requester ticket detail: renders (evidence: `client/src/App.tsx`)
- App and routing → Staff queue: renders (evidence: `client/src/App.tsx`)
- Create ticket → API client: requests (evidence: `client/src/CreateTicket.tsx`)
- My tickets → API client: requests (evidence: `client/src/MyTickets.tsx`)
- Requester ticket detail → API client: requests (evidence: `client/src/TicketDetail.tsx`)
- Staff queue → API client: requests (evidence: `client/src/StaffTicketQueue.tsx`)
- Staff ticket detail → API client: requests (evidence: `client/src/StaffTicketDetail.tsx`)
- User management → API client: requests (evidence: `client/src/AdminUserManagement.tsx`)
- API client → HTTP routes: HTTP requests
- HTTP routes → Authentication and sessions: authenticates (evidence: `server/src/app.ts`)
- HTTP routes → Ticket creation: routes to (evidence: `server/src/app.ts`)
- HTTP routes → Requester ticket list: routes to (evidence: `server/src/app.ts`)
- HTTP routes → Ticket detail and attachments: routes to (evidence: `server/src/app.ts`)
- HTTP routes → Staff queue and operations: routes to (evidence: `server/src/app.ts`)
- HTTP routes → Ticket comments: routes to (evidence: `server/src/app.ts`)
- HTTP routes → Internal notes: routes to (evidence: `server/src/app.ts`)
- HTTP routes → User administration: routes to (evidence: `server/src/app.ts`)
- Authentication and sessions → Prisma client: reads and writes (evidence: `server/src/auth-service.ts`)
- User administration → Identity validation: validates with (evidence: `server/src/user-management-service.ts`)
- User administration → Authentication and sessions: uses (evidence: `server/src/user-management-service.ts`)
- Ticket creation → Ticket validation: validates with (evidence: `server/src/ticket-service.ts`)
- Ticket creation → Attachment validation: uses (evidence: `server/src/ticket-service.ts`)
- Ticket creation → Prisma client: writes through (evidence: `server/src/ticket-service.ts`)
- Requester ticket list → Prisma client: queries through (evidence: `server/src/ticket-list-service.ts`)
- Ticket detail and attachments → Prisma client: queries through (evidence: `server/src/ticket-detail-service.ts`)
- Staff queue and operations → Prisma client: queries through (evidence: `server/src/staff-queue-service.ts`)
- User administration → Prisma client: reads and writes (evidence: `server/src/user-management-service.ts`)
- Ticket comments → Prisma client: reads and writes (evidence: `server/src/comment-service.ts`)
- Internal notes → Prisma client: reads and writes (evidence: `server/src/note-service.ts`)
- Prisma client → PostgreSQL data: accesses
