# chadisk/ticketflow architecture

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

- Interactive diagram: https://gitdiagram.com/chadisk/ticketflow
- Repository: https://github.com/chadisk/ticketflow

## Overview

TicketFlow is a helpdesk ticket dashboard: users create and inspect requests, search/filter/sort the queue, and move tickets between workflow statuses. The React dashboard manages ticket state through an API hook and client, while Express routes delegate validation and business rules to a service that accesses PostgreSQL through a model and connection pool. The README also documents Swagger API docs and database migrations. Edges reflect explicit README or source-index references and excerpts; unsampled implementation details are omitted.

Main entry points: [`frontend/src/pages/Dashboard.jsx`](https://github.com/chadisk/ticketflow/blob/main/frontend/src/pages/Dashboard.jsx) (Dashboard), [`frontend/src/components/TicketForm.jsx`](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketForm.jsx) (Ticket form), [`frontend/src/components/TicketDetailModal.jsx`](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketDetailModal.jsx) (Ticket details), [`frontend/src/components/Card.jsx`](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/Card.jsx) (Card primitives)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Ticket Dashboard"]
  node_app["React app<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_ticket_hook["Ticket state<br/>[useTickets.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_kanban["Kanban board<br/>[TicketKanban.jsx]"]
  node_ticket_card["Ticket cards<br/>[TicketCard.jsx]"]
  node_ticket_form["Ticket form<br/>[TicketForm.jsx]"]
  node_detail_modal["Ticket details"]
  node_card_ui["Card primitives<br/>[Card.jsx]"]
  node_button_ui["Button primitive<br/>[Button.jsx]"]
  node_input_ui["Input primitive<br/>[Input.jsx]"]
  node_translations["Translations<br/>[i18n.js]"]
end

subgraph group_api["Ticket API"]
  node_express_app["Express app<br/>[app.js]"]
  node_ticket_routes["Ticket routes<br/>[tickets.js]"]
  node_ticket_service["Ticket rules<br/>[ticketService.js]"]
  node_swagger["Swagger docs<br/>[app.js]"]
end

subgraph group_data["Ticket Data"]
  node_ticket_model["Ticket queries<br/>[ticketModel.js]"]
  node_db_pool["Postgres pool<br/>[db.js]"]
  node_migration["Ticket schema"]
end

node_user(("Support user"))
node_http_user(("Browser"))
node_postgres[("PostgreSQL")]

node_user -->|"uses"| node_dashboard
node_app -->|"renders"| node_dashboard
node_app -->|"loads language"| node_translations
node_dashboard -->|"loads ticket state"| node_ticket_hook
node_dashboard -->|"renders board"| node_kanban
node_dashboard -->|"renders form"| node_ticket_form
node_dashboard -->|"renders details"| node_detail_modal
node_ticket_hook -->|"calls API"| node_api_client
node_ticket_hook -->|"requests tickets"| node_express_app
node_kanban -->|"renders cards"| node_ticket_card
node_ticket_card -->|"uses card"| node_card_ui
node_kanban -->|"uses card"| node_card_ui
node_ticket_form -->|"uses button"| node_button_ui
node_ticket_form -->|"uses card"| node_card_ui
node_ticket_form -->|"uses input"| node_input_ui
node_detail_modal -->|"uses card"| node_card_ui
node_detail_modal -->|"uses button"| node_button_ui
node_detail_modal -->|"uses badge"| node_ticket_card
node_ticket_routes -->|"delegates"| node_ticket_service
node_express_app -->|"mounts routes"| node_ticket_routes
node_express_app -->|"mounts docs"| node_swagger
node_ticket_service -->|"calls queries"| node_ticket_model
node_ticket_model -->|"uses pool"| node_db_pool
node_db_pool -.->|"connects"| node_postgres
node_migration -->|"defines schema"| node_postgres

click node_app "https://github.com/chadisk/ticketflow/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/chadisk/ticketflow/blob/main/frontend/src/pages/Dashboard.jsx"
click node_ticket_hook "https://github.com/chadisk/ticketflow/blob/main/frontend/src/hooks/useTickets.js"
click node_api_client "https://github.com/chadisk/ticketflow/blob/main/frontend/src/services/api.js"
click node_kanban "https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketKanban.jsx"
click node_ticket_card "https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketCard.jsx"
click node_ticket_form "https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketForm.jsx"
click node_detail_modal "https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketDetailModal.jsx"
click node_card_ui "https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/Card.jsx"
click node_button_ui "https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/Button.jsx"
click node_input_ui "https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/Input.jsx"
click node_translations "https://github.com/chadisk/ticketflow/blob/main/frontend/src/i18n.js"
click node_express_app "https://github.com/chadisk/ticketflow/blob/main/backend/src/app.js"
click node_ticket_routes "https://github.com/chadisk/ticketflow/blob/main/backend/src/routes/tickets.js"
click node_ticket_service "https://github.com/chadisk/ticketflow/blob/main/backend/src/services/ticketService.js"
click node_swagger "https://github.com/chadisk/ticketflow/blob/main/backend/src/app.js"
click node_ticket_model "https://github.com/chadisk/ticketflow/blob/main/backend/src/models/ticketModel.js"
click node_db_pool "https://github.com/chadisk/ticketflow/blob/main/backend/src/db.js"
click node_migration "https://github.com/chadisk/ticketflow/blob/main/backend/database/migrations/001_create_tickets.sql"

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_dashboard,node_ticket_hook,node_api_client,node_kanban,node_ticket_card,node_ticket_form,node_detail_modal,node_card_ui,node_button_ui,node_input_ui,node_translations,node_user,node_http_user toneBlue
class node_express_app,node_ticket_routes,node_ticket_service,node_swagger,node_postgres toneAmber
class node_ticket_model,node_db_pool,node_migration toneMint
```

## Components

### Ticket Dashboard

- [React app](https://github.com/chadisk/ticketflow/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/chadisk/ticketflow/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Ticket state](https://github.com/chadisk/ticketflow/blob/main/frontend/src/hooks/useTickets.js): `frontend/src/hooks/useTickets.js`
- [API client](https://github.com/chadisk/ticketflow/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Kanban board](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketKanban.jsx): `frontend/src/components/TicketKanban.jsx`
- [Ticket cards](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketCard.jsx): `frontend/src/components/TicketCard.jsx`
- [Ticket form](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketForm.jsx): `frontend/src/components/TicketForm.jsx`
- [Ticket details](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/TicketDetailModal.jsx): `frontend/src/components/TicketDetailModal.jsx`
- [Card primitives](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/Card.jsx): `frontend/src/components/Card.jsx`
- [Button primitive](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/Button.jsx): `frontend/src/components/Button.jsx`
- [Input primitive](https://github.com/chadisk/ticketflow/blob/main/frontend/src/components/Input.jsx): `frontend/src/components/Input.jsx`
- [Translations](https://github.com/chadisk/ticketflow/blob/main/frontend/src/i18n.js): `frontend/src/i18n.js`

### Ticket API

- [Express app](https://github.com/chadisk/ticketflow/blob/main/backend/src/app.js): `backend/src/app.js`
- [Ticket routes](https://github.com/chadisk/ticketflow/blob/main/backend/src/routes/tickets.js): `backend/src/routes/tickets.js`
- [Ticket rules](https://github.com/chadisk/ticketflow/blob/main/backend/src/services/ticketService.js): `backend/src/services/ticketService.js`
- [Swagger docs](https://github.com/chadisk/ticketflow/blob/main/backend/src/app.js): `backend/src/app.js`

### Ticket Data

- [Ticket queries](https://github.com/chadisk/ticketflow/blob/main/backend/src/models/ticketModel.js): `backend/src/models/ticketModel.js`
- [Postgres pool](https://github.com/chadisk/ticketflow/blob/main/backend/src/db.js): `backend/src/db.js`
- [Ticket schema](https://github.com/chadisk/ticketflow/blob/main/backend/database/migrations/001_create_tickets.sql): `backend/database/migrations/001_create_tickets.sql`

### Other components

- **Support user**
- **Browser**
- **PostgreSQL**

## Connections

- Support user → Dashboard: uses (evidence: `README.md`)
- React app → Dashboard: renders (evidence: `frontend/src/App.jsx`)
- React app → Translations: loads language (evidence: `frontend/src/App.jsx`)
- Dashboard → Ticket state: loads ticket state (evidence: `frontend/src/pages/Dashboard.jsx`)
- Dashboard → Kanban board: renders board (evidence: `frontend/src/pages/Dashboard.jsx`)
- Dashboard → Ticket form: renders form (evidence: `frontend/src/pages/Dashboard.jsx`)
- Dashboard → Ticket details: renders details (evidence: `frontend/src/pages/Dashboard.jsx`)
- Ticket state → API client: calls API (evidence: `frontend/src/hooks/useTickets.js`)
- Ticket state → Express app: requests tickets (evidence: `README.md`)
- Kanban board → Ticket cards: renders cards (evidence: `frontend/src/components/TicketKanban.jsx`)
- Ticket cards → Card primitives: uses card (evidence: `frontend/src/components/TicketCard.jsx`)
- Kanban board → Card primitives: uses card (evidence: `frontend/src/components/TicketKanban.jsx`)
- Ticket form → Button primitive: uses button (evidence: `frontend/src/components/TicketForm.jsx`)
- Ticket form → Card primitives: uses card (evidence: `frontend/src/components/TicketForm.jsx`)
- Ticket form → Input primitive: uses input (evidence: `frontend/src/components/TicketForm.jsx`)
- Ticket details → Card primitives: uses card (evidence: `frontend/src/components/TicketDetailModal.jsx`)
- Ticket details → Button primitive: uses button (evidence: `frontend/src/components/TicketDetailModal.jsx`)
- Ticket details → Ticket cards: uses badge (evidence: `frontend/src/components/TicketDetailModal.jsx`)
- Ticket routes → Ticket rules: delegates (evidence: `backend/src/routes/tickets.js`)
- Express app → Ticket routes: mounts routes (evidence: `backend/src/app.js`)
- Express app → Swagger docs: mounts docs (evidence: `README.md`)
- Ticket rules → Ticket queries: calls queries (evidence: `backend/src/services/ticketService.js`)
- Ticket queries → Postgres pool: uses pool (evidence: `backend/src/models/ticketModel.js`)
- Postgres pool → PostgreSQL: connects
- Ticket schema → PostgreSQL: defines schema (evidence: `README.md`)
