# jimmyht98/is-115-ticketsystem architecture

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

- Interactive diagram: https://gitdiagram.com/jimmyht98/is-115-ticketsystem
- Repository: https://github.com/jimmyht98/is-115-ticketsystem

## Overview

Saklig is a local PHP/MySQL customer-support ticket system. Customers register or sign in, submit a ticket with an optional attachment, then follow replies and status in their ticket list; support staff take unassigned tickets, reply, and update status. The graph preserves account recovery, search/filter/sort, last-visited shortcuts, notifications, and attachment access. Several page-to-service relationships are documented as product behavior but their handler code was not excerpted, so those links are dashed; other links are limited to shown calls or indexed references.

Main entry points: [`src/ticket-service.php`](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-service.php) (Ticket service), [`mine-saker.php`](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/mine-saker.php) (My tickets), [`admin.php`](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/admin.php) (Admin overview), [`src/user-repository.php`](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/user-repository.php) (User repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_ticket_form["Submit ticket<br/>[index.php]"]
  node_customer_list["My tickets<br/>[mine-saker.php]"]
  node_admin_list["Admin overview<br/>[admin.php]"]
  node_ticket_detail["Ticket details"]
  node_attachments_web["Attachment access<br/>[vedlegg.php]"]
end

subgraph group_identity["Accounts and access"]
  node_registration["Registration<br/>[register.php]"]
  node_login["Sign in<br/>[login.php]"]
  node_password_recovery["Password recovery"]
  node_password_reset["Password reset<br/>[reset-password.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_user_repository["User repository"]
end

subgraph group_tickets["Ticket domain"]
  node_ticket_service["Ticket service<br/>[ticket-service.php]"]
  node_ticket_validator["Ticket validation"]
  node_ticket_list["List search and sort<br/>[ticket-list.php]"]
  node_last_visited["Last visited ticket"]
  node_attachment_handler["Attachment handling<br/>[vedlegg.php]"]
end

subgraph group_storage["Storage and messaging"]
  node_ticket_repository["Ticket repository"]
  node_database[("MySQL database<br/>[db_connection.php]")]
  node_notifications["Ticket notifications"]
  node_mailer["Email sender<br/>[mailer.php]"]
end

subgraph group_shared["Shared web layer"]
  node_bootstrap["Request bootstrap<br/>[bootstrap.php]"]
  node_security["Security utilities<br/>[sikkerhet.php]"]
  node_ticket_filters["Ticket filters<br/>[ticket-filters.php]"]
  node_last_visited_view["Last-ticket shortcut"]
  node_auth_panel["Authentication panel<br/>[auth-panel.php]"]
  node_header["Site header<br/>[header.php]"]
end

node_customer(("Customer"))
node_support(("Support staff"))
node_mailpit["Mailpit inbox"]

node_customer -->|"creates account"| node_registration
node_registration -->|"registers account"| node_user_repository
node_user_repository -->|"reads and writes"| node_database
node_customer -->|"signs in"| node_login
node_login -->|"authenticates"| node_auth
node_auth -->|"looks up account"| node_user_repository
node_customer -->|"requests reset"| node_password_recovery
node_password_recovery -.->|"requests reset link"| node_user_repository
node_user_repository -->|"sends reset email"| node_mailer
node_customer -->|"submits ticket"| node_ticket_form
node_ticket_form -->|"loads"| node_bootstrap
node_ticket_form -.->|"creates ticket"| node_ticket_service
node_ticket_service -->|"validates fields"| node_ticket_validator
node_ticket_service -->|"reads attachment"| node_attachment_handler
node_ticket_service -->|"creates and saves"| node_ticket_repository
node_ticket_repository -->|"reads and writes"| node_database
node_ticket_service -->|"dispatches alerts"| node_notifications
node_notifications -->|"sends messages"| node_mailer
node_mailer -.->|"delivers email"| node_mailpit
node_customer -->|"views own tickets"| node_customer_list
node_support -->|"views all tickets"| node_admin_list
node_customer_list -.->|"loads tickets"| node_ticket_service
node_admin_list -.->|"loads tickets"| node_ticket_service
node_customer_list -.->|"filters and sorts"| node_ticket_list
node_admin_list -.->|"filters and sorts"| node_ticket_list
node_customer_list -->|"renders filters"| node_ticket_filters
node_admin_list -->|"renders filters"| node_ticket_filters
node_customer_list -.->|"shows shortcut"| node_last_visited
node_admin_list -.->|"shows shortcut"| node_last_visited
node_customer_list -->|"renders shortcut"| node_last_visited_view
node_admin_list -->|"renders shortcut"| node_last_visited_view
node_customer -->|"reads replies"| node_ticket_detail
node_support -->|"takes and updates"| node_ticket_detail
node_ticket_detail -.->|"reads and updates"| node_ticket_service
node_customer -->|"uploads or downloads"| node_attachments_web
node_support -->|"downloads attachments"| node_attachments_web
node_attachments_web -.->|"handles file access"| node_attachment_handler
node_bootstrap -->|"initializes"| node_auth
node_bootstrap -->|"starts session"| node_security
node_registration -->|"renders"| node_auth_panel
node_ticket_form -->|"renders"| node_header

click node_ticket_form "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/index.php"
click node_customer_list "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/mine-saker.php"
click node_admin_list "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/admin.php"
click node_ticket_detail "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/ticket-detaljer.php"
click node_attachments_web "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/vedlegg.php"
click node_registration "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/registration/register.php"
click node_login "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/login.php"
click node_password_recovery "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/registration/forgot-password.php"
click node_password_reset "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/registration/reset-password.php"
click node_auth "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/auth.php"
click node_user_repository "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/user-repository.php"
click node_ticket_service "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-service.php"
click node_ticket_validator "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-validator.php"
click node_ticket_list "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-list.php"
click node_last_visited "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/last-visited-ticket.php"
click node_attachment_handler "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/vedlegg.php"
click node_ticket_repository "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-repository.php"
click node_database "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/database/db_connection.php"
click node_notifications "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-notifications.php"
click node_mailer "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/mailer.php"
click node_bootstrap "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/bootstrap.php"
click node_security "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/sikkerhet.php"
click node_ticket_filters "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/ticket-filters.php"
click node_last_visited_view "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/last-visited-ticket.php"
click node_auth_panel "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/auth-panel.php"
click node_header "https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/header.php"

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_ticket_form,node_customer_list,node_admin_list,node_ticket_detail,node_attachments_web toneBlue
class node_registration,node_login,node_password_recovery,node_password_reset,node_auth,node_user_repository toneAmber
class node_ticket_service,node_ticket_validator,node_ticket_list,node_last_visited,node_attachment_handler toneMint
class node_ticket_repository,node_database,node_notifications,node_mailer toneRose
class node_bootstrap,node_security,node_ticket_filters,node_last_visited_view,node_auth_panel,node_header,node_customer,node_support,node_mailpit toneIndigo
```

## Components

### Web workflows

- [Submit ticket](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/index.php): `index.php`
- [My tickets](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/mine-saker.php): `mine-saker.php`
- [Admin overview](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/admin.php): `admin.php`
- [Ticket details](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/ticket-detaljer.php): `ticket-detaljer.php`
- [Attachment access](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/vedlegg.php): `vedlegg.php`

### Accounts and access

- [Registration](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/registration/register.php): `registration/register.php`
- [Sign in](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/login.php): `login.php`
- [Password recovery](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/registration/forgot-password.php): `registration/forgot-password.php`
- [Password reset](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/registration/reset-password.php): `registration/reset-password.php`
- [Authentication](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/auth.php): `src/auth.php`
- [User repository](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/user-repository.php): `src/user-repository.php`

### Ticket domain

- [Ticket service](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-service.php): `src/ticket-service.php`
- [Ticket validation](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-validator.php): `src/ticket-validator.php`
- [List search and sort](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-list.php): `src/ticket-list.php`
- [Last visited ticket](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/last-visited-ticket.php): `src/last-visited-ticket.php`
- [Attachment handling](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/vedlegg.php): `src/vedlegg.php`

### Storage and messaging

- [Ticket repository](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-repository.php): `src/ticket-repository.php`
- [MySQL database](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/database/db_connection.php): `database/db_connection.php`
- [Ticket notifications](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/ticket-notifications.php): `src/ticket-notifications.php`
- [Email sender](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/mailer.php): `src/mailer.php`

### Shared web layer

- [Request bootstrap](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/bootstrap.php): `includes/bootstrap.php`
- [Security utilities](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/src/sikkerhet.php): `src/sikkerhet.php`
- [Ticket filters](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/ticket-filters.php): `includes/ticket-filters.php`
- [Last-ticket shortcut](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/last-visited-ticket.php): `includes/last-visited-ticket.php`
- [Authentication panel](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/auth-panel.php): `includes/auth-panel.php`
- [Site header](https://github.com/jimmyht98/is-115-ticketsystem/blob/main/includes/header.php): `includes/header.php`

### Other components

- **Customer**
- **Support staff**
- **Mailpit inbox**

## Connections

- Customer → Registration: creates account (evidence: `README.md`)
- Registration → User repository: registers account (evidence: `registration/register.php`)
- User repository → MySQL database: reads and writes (evidence: `src/user-repository.php`)
- Customer → Sign in: signs in (evidence: `README.md`)
- Sign in → Authentication: authenticates (evidence: `README.md`)
- Authentication → User repository: looks up account (evidence: `src/auth.php`)
- Customer → Password recovery: requests reset (evidence: `README.md`)
- Password recovery → User repository: requests reset link
- User repository → Email sender: sends reset email (evidence: `src/user-repository.php`)
- Customer → Submit ticket: submits ticket (evidence: `README.md`)
- Submit ticket → Request bootstrap: loads (evidence: `index.php`)
- Submit ticket → Ticket service: creates ticket
- Ticket service → Ticket validation: validates fields (evidence: `src/ticket-service.php`)
- Ticket service → Attachment handling: reads attachment (evidence: `src/ticket-service.php`)
- Ticket service → Ticket repository: creates and saves (evidence: `src/ticket-service.php`)
- Ticket repository → MySQL database: reads and writes (evidence: `src/ticket-repository.php`)
- Ticket service → Ticket notifications: dispatches alerts (evidence: `src/ticket-service.php`)
- Ticket notifications → Email sender: sends messages (evidence: `src/ticket-notifications.php`)
- Email sender → Mailpit inbox: delivers email (evidence: `README.md`)
- Customer → My tickets: views own tickets (evidence: `README.md`)
- Support staff → Admin overview: views all tickets (evidence: `README.md`)
- My tickets → Ticket service: loads tickets
- Admin overview → Ticket service: loads tickets
- My tickets → List search and sort: filters and sorts (evidence: `README.md`)
- Admin overview → List search and sort: filters and sorts (evidence: `README.md`)
- My tickets → Ticket filters: renders filters (evidence: `mine-saker.php`)
- Admin overview → Ticket filters: renders filters (evidence: `admin.php`)
- My tickets → Last visited ticket: shows shortcut (evidence: `README.md`)
- Admin overview → Last visited ticket: shows shortcut (evidence: `README.md`)
- My tickets → Last-ticket shortcut: renders shortcut (evidence: `mine-saker.php`)
- Admin overview → Last-ticket shortcut: renders shortcut (evidence: `admin.php`)
- Customer → Ticket details: reads replies (evidence: `README.md`)
- Support staff → Ticket details: takes and updates (evidence: `README.md`)
- Ticket details → Ticket service: reads and updates
- Customer → Attachment access: uploads or downloads (evidence: `README.md`)
- Support staff → Attachment access: downloads attachments (evidence: `README.md`)
- Attachment access → Attachment handling: handles file access
- Request bootstrap → Authentication: initializes (evidence: `includes/bootstrap.php`)
- Request bootstrap → Security utilities: starts session (evidence: `includes/bootstrap.php`)
- Registration → Authentication panel: renders (evidence: `registration/register.php`)
- Submit ticket → Site header: renders (evidence: `index.php`)
