# armconic/servicema architecture

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

- Interactive diagram: https://gitdiagram.com/armconic/servicema
- Repository: https://github.com/armconic/servicema

## Overview

SERVICE-MA is a PHP/PostgreSQL maintenance-ticket application. Its main workflow is for staff to log in and create a repair ticket; technicians then work tickets and may upload before/during/after photos, while supervisors and managers review work and print reports. The tree also includes project and user administration and Excel-based data import. Edges reflect shown calls, imports, and database use; where a user-facing entry path is not explicit in the excerpts, actor links are marked unverified. The README is empty, and unsampled modules are represented only where the tree and SOURCE INDEX support them.

Main entry points: [`src/db_connect.php`](https://github.com/armconic/servicema/blob/main/src/db_connect.php) (PDO connection), [`src/supervisor_dashboard.php`](https://github.com/armconic/servicema/blob/main/src/supervisor_dashboard.php) (Supervisor dashboard), [`src/edit_ticket.php`](https://github.com/armconic/servicema/blob/main/src/edit_ticket.php) (Edit ticket), [`src/manager_dashboard.php`](https://github.com/armconic/servicema/blob/main/src/manager_dashboard.php) (Manager dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Sign in<br/>[login.php]"]
  node_navigation["Role navigation<br/>[navbar.php]"]
end

subgraph group_tickets["Ticket operations"]
  node_ticket_create["Create ticket<br/>[create_ticket.php]"]
  node_ticket_edit["Edit ticket<br/>[edit_ticket.php]"]
  node_tech_work["Technician work<br/>[tech_dashboard.php]"]
  node_sub_cabinets["Cabinet lookup"]
end

subgraph group_oversight["Administration and reporting"]
  node_supervisor_view["Supervisor dashboard"]
  node_manager_view["Manager dashboard"]
  node_print_report["Print report<br/>[print_report.php]"]
  node_project_admin["Project management"]
  node_user_admin["User management"]
end

subgraph group_data["Data services"]
  node_excel_import["Excel import<br/>[import_excel.php]"]
  node_db_connection["PDO connection<br/>[db_connect.php]"]
  node_postgres[("PostgreSQL")]
end

node_staff(("Staff"))

node_staff -.->|"signs in"| node_login
node_staff -.->|"opens ticket"| node_ticket_create
node_staff -.->|"works tickets"| node_tech_work
node_staff -.->|"reviews work"| node_supervisor_view
node_login -->|"loads connection"| node_db_connection
node_ticket_create -->|"uses database"| node_db_connection
node_ticket_edit -->|"uses database"| node_db_connection
node_tech_work -->|"uses database"| node_db_connection
node_tech_work -.->|"links editing"| node_ticket_edit
node_supervisor_view -->|"uses database"| node_db_connection
node_manager_view -->|"uses database"| node_db_connection
node_manager_view -->|"links editing"| node_ticket_edit
node_manager_view -->|"links report"| node_print_report
node_supervisor_view -->|"links editing"| node_ticket_edit
node_supervisor_view -->|"links report"| node_print_report
node_print_report -->|"uses database"| node_db_connection
node_project_admin -->|"uses database"| node_db_connection
node_user_admin -->|"uses database"| node_db_connection
node_excel_import -->|"uses database"| node_db_connection
node_sub_cabinets -->|"uses database"| node_db_connection
node_navigation -->|"uses database"| node_db_connection
node_db_connection -->|"connects PDO"| node_postgres

click node_login "https://github.com/armconic/servicema/blob/main/src/login.php"
click node_navigation "https://github.com/armconic/servicema/blob/main/src/navbar.php"
click node_ticket_create "https://github.com/armconic/servicema/blob/main/src/create_ticket.php"
click node_ticket_edit "https://github.com/armconic/servicema/blob/main/src/edit_ticket.php"
click node_tech_work "https://github.com/armconic/servicema/blob/main/src/tech_dashboard.php"
click node_sub_cabinets "https://github.com/armconic/servicema/blob/main/src/get_sub_cabinets.php"
click node_supervisor_view "https://github.com/armconic/servicema/blob/main/src/supervisor_dashboard.php"
click node_manager_view "https://github.com/armconic/servicema/blob/main/src/manager_dashboard.php"
click node_print_report "https://github.com/armconic/servicema/blob/main/src/print_report.php"
click node_project_admin "https://github.com/armconic/servicema/blob/main/src/manage_projects.php"
click node_user_admin "https://github.com/armconic/servicema/blob/main/src/user_management.php"
click node_excel_import "https://github.com/armconic/servicema/blob/main/src/import_excel.php"
click node_db_connection "https://github.com/armconic/servicema/blob/main/src/db_connect.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_login,node_navigation toneBlue
class node_ticket_create,node_ticket_edit,node_tech_work,node_sub_cabinets toneAmber
class node_supervisor_view,node_manager_view,node_print_report,node_project_admin,node_user_admin toneMint
class node_excel_import,node_db_connection,node_postgres toneRose
class node_staff toneIndigo
```

## Components

### Access and navigation

- [Sign in](https://github.com/armconic/servicema/blob/main/src/login.php): `src/login.php`
- [Role navigation](https://github.com/armconic/servicema/blob/main/src/navbar.php): `src/navbar.php`

### Ticket operations

- [Create ticket](https://github.com/armconic/servicema/blob/main/src/create_ticket.php): `src/create_ticket.php`
- [Edit ticket](https://github.com/armconic/servicema/blob/main/src/edit_ticket.php): `src/edit_ticket.php`
- [Technician work](https://github.com/armconic/servicema/blob/main/src/tech_dashboard.php): `src/tech_dashboard.php`
- [Cabinet lookup](https://github.com/armconic/servicema/blob/main/src/get_sub_cabinets.php): `src/get_sub_cabinets.php`

### Administration and reporting

- [Supervisor dashboard](https://github.com/armconic/servicema/blob/main/src/supervisor_dashboard.php): `src/supervisor_dashboard.php`
- [Manager dashboard](https://github.com/armconic/servicema/blob/main/src/manager_dashboard.php): `src/manager_dashboard.php`
- [Print report](https://github.com/armconic/servicema/blob/main/src/print_report.php): `src/print_report.php`
- [Project management](https://github.com/armconic/servicema/blob/main/src/manage_projects.php): `src/manage_projects.php`
- [User management](https://github.com/armconic/servicema/blob/main/src/user_management.php): `src/user_management.php`

### Data services

- [Excel import](https://github.com/armconic/servicema/blob/main/src/import_excel.php): `src/import_excel.php`
- [PDO connection](https://github.com/armconic/servicema/blob/main/src/db_connect.php): `src/db_connect.php`
- **PostgreSQL**

### Other components

- **Staff**

## Connections

- Staff → Sign in: signs in
- Staff → Create ticket: opens ticket
- Staff → Technician work: works tickets
- Staff → Supervisor dashboard: reviews work
- Sign in → PDO connection: loads connection (evidence: `src/login.php`)
- Create ticket → PDO connection: uses database (evidence: `src/create_ticket.php`)
- Edit ticket → PDO connection: uses database (evidence: `src/edit_ticket.php`)
- Technician work → PDO connection: uses database (evidence: `src/tech_dashboard.php`)
- Technician work → Edit ticket: links editing
- Supervisor dashboard → PDO connection: uses database (evidence: `src/supervisor_dashboard.php`)
- Manager dashboard → PDO connection: uses database (evidence: `src/manager_dashboard.php`)
- Manager dashboard → Edit ticket: links editing (evidence: `src/manager_dashboard.php`)
- Manager dashboard → Print report: links report (evidence: `src/manager_dashboard.php`)
- Supervisor dashboard → Edit ticket: links editing (evidence: `src/supervisor_dashboard.php`)
- Supervisor dashboard → Print report: links report (evidence: `src/supervisor_dashboard.php`)
- Print report → PDO connection: uses database (evidence: `src/print_report.php`)
- Project management → PDO connection: uses database (evidence: `src/manage_projects.php`)
- User management → PDO connection: uses database (evidence: `src/user_management.php`)
- Excel import → PDO connection: uses database (evidence: `src/import_excel.php`)
- Cabinet lookup → PDO connection: uses database (evidence: `src/get_sub_cabinets.php`)
- Role navigation → PDO connection: uses database (evidence: `src/navbar.php`)
- PDO connection → PostgreSQL: connects PDO (evidence: `src/db_connect.php`)
