# kplariza/id_generator architecture

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

- Interactive diagram: https://gitdiagram.com/kplariza/id_generator
- Repository: https://github.com/kplariza/id_generator

## Overview

This Laravel/Filament admin application generates and manages employee ID cards, including large and small formats. Administrators maintain offices and employee records, configure card templates and overlays, preview cards, then print individual or bulk cards; print-status history and analytics support follow-up. Profile-image background removal is an asynchronous, optionally configured capability. The source excerpts establish the print-data and background-removal paths; several other capabilities are represented by their tree paths and README description, so their internal connections are omitted where not evidenced.

Main entry points: [`app/Models/EmployeeId.php`](https://github.com/kplariza/id_generator/blob/main/app/Models/EmployeeId.php) (Employee record), [`app/Support/EmployeeIdPrintViewData.php`](https://github.com/kplariza/id_generator/blob/main/app/Support/EmployeeIdPrintViewData.php) (Print view data), [`app/Services/RembgBackgroundRemovalService.php`](https://github.com/kplariza/id_generator/blob/main/app/Services/RembgBackgroundRemovalService.php) (Removal service), [`resources/views/filament/pages/partials/id-card-preview.blade.php`](https://github.com/kplariza/id_generator/blob/main/resources/views/filament/pages/partials/id-card-preview.blade.php) (Card preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin workflows"]
  node_panel["Filament admin"]
  node_offices["Office management<br/>[OfficeResource.php]"]
  node_employees["Employee ID records"]
  node_smallrecords["Small ID records"]
  node_users["User administration<br/>[UserResource.php]"]
  node_printstatus["Print tracking"]
  node_analytics["Generation analytics"]
end

subgraph group_card["Card production"]
  node_creation["ID creation"]
  node_smallcreation["Small ID creation"]
  node_templates["Card templates"]
  node_smalltemplates["Small templates"]
  node_overlay["Overlay editing"]
  node_preview["Card preview"]
  node_printdata["Print view data"]
  node_printcontroller["Print controller"]
  node_printviews["Print views"]
  node_qr["QR generation"]
end

subgraph group_rembg["Image processing"]
  node_rembgui["Background removal UI"]
  node_dispatcher["Removal dispatcher"]
  node_job["Removal job"]
  node_service["Removal service"]
  node_preparer["Image preparation"]
  node_result["Process result"]
end

subgraph group_data["Application data"]
  node_employee[("Employee record<br/>[EmployeeId.php]")]
  node_office[("Office record<br/>[Office.php]")]
  node_setting[("Settings<br/>[Setting.php]")]
  node_user[("User account<br/>[User.php]")]
  node_history[("Print history")]
end

node_admin(("Administrator"))
node_externalrembg{{"rembg executable"}}

node_admin -->|"uses"| node_panel
node_panel -.->|"administers"| node_employees
node_employees -.->|"manages"| node_employee
node_offices -.->|"manages"| node_office
node_smallrecords -.->|"manages"| node_employee
node_users -.->|"manages"| node_user
node_creation -.->|"previews"| node_preview
node_smallcreation -.->|"previews"| node_preview
node_templates -.->|"configures"| node_setting
node_smalltemplates -.->|"configures"| node_setting
node_overlay -.->|"updates"| node_preview
node_preview -->|"reads"| node_employee
node_printcontroller -->|"loads"| node_employee
node_printcontroller -->|"builds"| node_printdata
node_printdata -->|"reads"| node_employee
node_printdata -->|"reads"| node_setting
node_printdata -->|"uses"| node_qr
node_printcontroller -->|"renders"| node_printviews
node_printstatus -.->|"reports"| node_history
node_analytics -.->|"reports"| node_employee
node_rembgui -.->|"requests"| node_dispatcher
node_dispatcher -->|"dispatches"| node_job
node_dispatcher -->|"prepares"| node_preparer
node_job -->|"invokes"| node_service
node_service -->|"prepares"| node_preparer
node_service -.->|"runs"| node_externalrembg
node_service -->|"returns"| node_result
node_employee -->|"records changes"| node_history
node_employee -->|"belongs to"| node_office

click node_panel "https://github.com/kplariza/id_generator/blob/main/app/Providers/Filament/AdminPanelProvider.php"
click node_offices "https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/Offices/OfficeResource.php"
click node_employees "https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/EmployeeIds/EmployeeIdResource.php"
click node_smallrecords "https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/SmallEmployeeIds/SmallEmployeeIdResource.php"
click node_users "https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/Users/UserResource.php"
click node_creation "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/IdCreationDashboard.php"
click node_smallcreation "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/SmallIdCreationDashboard.php"
click node_templates "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/ManageIdCardTemplate.php"
click node_smalltemplates "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/ManageSmallIdCardTemplate.php"
click node_overlay "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/Concerns/ManagesDraggableEmployeePhotoOverlay.php"
click node_preview "https://github.com/kplariza/id_generator/blob/main/resources/views/filament/pages/partials/id-card-preview.blade.php"
click node_printdata "https://github.com/kplariza/id_generator/blob/main/app/Support/EmployeeIdPrintViewData.php"
click node_printcontroller "https://github.com/kplariza/id_generator/blob/main/app/Http/Controllers/EmployeeIdPrintController.php"
click node_printviews "https://github.com/kplariza/id_generator/blob/main/resources/views/filament/resources/employee-ids/pages/print-id-card.blade.php"
click node_printstatus "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/AnalyticsPrintingStatus.php"
click node_analytics "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/GeneratedIdsAnalytics.php"
click node_rembgui "https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/Concerns/PollsProfilePictureRembg.php"
click node_dispatcher "https://github.com/kplariza/id_generator/blob/main/app/Support/ProfilePictureRembgDispatcher.php"
click node_job "https://github.com/kplariza/id_generator/blob/main/app/Jobs/ProcessProfilePictureRembgJob.php"
click node_service "https://github.com/kplariza/id_generator/blob/main/app/Services/RembgBackgroundRemovalService.php"
click node_preparer "https://github.com/kplariza/id_generator/blob/main/app/Support/RembgInputImagePreparer.php"
click node_result "https://github.com/kplariza/id_generator/blob/main/app/Services/RembgProcessResult.php"
click node_employee "https://github.com/kplariza/id_generator/blob/main/app/Models/EmployeeId.php"
click node_office "https://github.com/kplariza/id_generator/blob/main/app/Models/Office.php"
click node_setting "https://github.com/kplariza/id_generator/blob/main/app/Models/Setting.php"
click node_user "https://github.com/kplariza/id_generator/blob/main/app/Models/User.php"
click node_history "https://github.com/kplariza/id_generator/blob/main/app/Models/EmployeeIdPrintStatusHistory.php"
click node_qr "https://github.com/kplariza/id_generator/blob/main/app/Services/QRCodeGenerator.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_panel,node_offices,node_employees,node_smallrecords,node_users,node_printstatus,node_analytics toneBlue
class node_creation,node_smallcreation,node_templates,node_smalltemplates,node_overlay,node_preview,node_printdata,node_printcontroller,node_printviews,node_qr toneAmber
class node_rembgui,node_dispatcher,node_job,node_service,node_preparer,node_result toneMint
class node_employee,node_office,node_setting,node_user,node_history toneRose
class node_admin,node_externalrembg toneIndigo
```

## Components

### Admin workflows

- [Filament admin](https://github.com/kplariza/id_generator/blob/main/app/Providers/Filament/AdminPanelProvider.php): `app/Providers/Filament/AdminPanelProvider.php`
- [Office management](https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/Offices/OfficeResource.php): `app/Filament/Resources/Offices/OfficeResource.php`
- [Employee ID records](https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/EmployeeIds/EmployeeIdResource.php): `app/Filament/Resources/EmployeeIds/EmployeeIdResource.php`
- [Small ID records](https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/SmallEmployeeIds/SmallEmployeeIdResource.php): `app/Filament/Resources/SmallEmployeeIds/SmallEmployeeIdResource.php`
- [User administration](https://github.com/kplariza/id_generator/blob/main/app/Filament/Resources/Users/UserResource.php): `app/Filament/Resources/Users/UserResource.php`
- [Print tracking](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/AnalyticsPrintingStatus.php): `app/Filament/Pages/AnalyticsPrintingStatus.php`
- [Generation analytics](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/GeneratedIdsAnalytics.php): `app/Filament/Pages/GeneratedIdsAnalytics.php`

### Card production

- [ID creation](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/IdCreationDashboard.php): `app/Filament/Pages/IdCreationDashboard.php`
- [Small ID creation](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/SmallIdCreationDashboard.php): `app/Filament/Pages/SmallIdCreationDashboard.php`
- [Card templates](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/ManageIdCardTemplate.php): `app/Filament/Pages/ManageIdCardTemplate.php`
- [Small templates](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/ManageSmallIdCardTemplate.php): `app/Filament/Pages/ManageSmallIdCardTemplate.php`
- [Overlay editing](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/Concerns/ManagesDraggableEmployeePhotoOverlay.php): `app/Filament/Pages/Concerns/ManagesDraggableEmployeePhotoOverlay.php`
- [Card preview](https://github.com/kplariza/id_generator/blob/main/resources/views/filament/pages/partials/id-card-preview.blade.php): `resources/views/filament/pages/partials/id-card-preview.blade.php`
- [Print view data](https://github.com/kplariza/id_generator/blob/main/app/Support/EmployeeIdPrintViewData.php): `app/Support/EmployeeIdPrintViewData.php`
- [Print controller](https://github.com/kplariza/id_generator/blob/main/app/Http/Controllers/EmployeeIdPrintController.php): `app/Http/Controllers/EmployeeIdPrintController.php`
- [Print views](https://github.com/kplariza/id_generator/blob/main/resources/views/filament/resources/employee-ids/pages/print-id-card.blade.php): `resources/views/filament/resources/employee-ids/pages/print-id-card.blade.php`
- [QR generation](https://github.com/kplariza/id_generator/blob/main/app/Services/QRCodeGenerator.php): `app/Services/QRCodeGenerator.php`

### Image processing

- [Background removal UI](https://github.com/kplariza/id_generator/blob/main/app/Filament/Pages/Concerns/PollsProfilePictureRembg.php): `app/Filament/Pages/Concerns/PollsProfilePictureRembg.php`
- [Removal dispatcher](https://github.com/kplariza/id_generator/blob/main/app/Support/ProfilePictureRembgDispatcher.php): `app/Support/ProfilePictureRembgDispatcher.php`
- [Removal job](https://github.com/kplariza/id_generator/blob/main/app/Jobs/ProcessProfilePictureRembgJob.php): `app/Jobs/ProcessProfilePictureRembgJob.php`
- [Removal service](https://github.com/kplariza/id_generator/blob/main/app/Services/RembgBackgroundRemovalService.php): `app/Services/RembgBackgroundRemovalService.php`
- [Image preparation](https://github.com/kplariza/id_generator/blob/main/app/Support/RembgInputImagePreparer.php): `app/Support/RembgInputImagePreparer.php`
- [Process result](https://github.com/kplariza/id_generator/blob/main/app/Services/RembgProcessResult.php): `app/Services/RembgProcessResult.php`

### Application data

- [Employee record](https://github.com/kplariza/id_generator/blob/main/app/Models/EmployeeId.php): `app/Models/EmployeeId.php`
- [Office record](https://github.com/kplariza/id_generator/blob/main/app/Models/Office.php): `app/Models/Office.php`
- [Settings](https://github.com/kplariza/id_generator/blob/main/app/Models/Setting.php): `app/Models/Setting.php`
- [User account](https://github.com/kplariza/id_generator/blob/main/app/Models/User.php): `app/Models/User.php`
- [Print history](https://github.com/kplariza/id_generator/blob/main/app/Models/EmployeeIdPrintStatusHistory.php): `app/Models/EmployeeIdPrintStatusHistory.php`

### Other components

- **Administrator**
- **rembg executable**

## Connections

- Administrator → Filament admin: uses (evidence: `README.md`)
- Filament admin → Employee ID records: administers
- Employee ID records → Employee record: manages
- Office management → Office record: manages
- Small ID records → Employee record: manages
- User administration → User account: manages
- ID creation → Card preview: previews
- Small ID creation → Card preview: previews
- Card templates → Settings: configures
- Small templates → Settings: configures
- Overlay editing → Card preview: updates
- Card preview → Employee record: reads (evidence: `resources/views/filament/pages/partials/id-card-preview.blade.php`)
- Print controller → Employee record: loads (evidence: `app/Http/Controllers/EmployeeIdPrintController.php`)
- Print controller → Print view data: builds (evidence: `app/Http/Controllers/EmployeeIdPrintController.php`)
- Print view data → Employee record: reads (evidence: `app/Support/EmployeeIdPrintViewData.php`)
- Print view data → Settings: reads (evidence: `app/Support/EmployeeIdPrintViewData.php`)
- Print view data → QR generation: uses (evidence: `app/Support/EmployeeIdPrintViewData.php`)
- Print controller → Print views: renders (evidence: `app/Http/Controllers/EmployeeIdPrintController.php`)
- Print tracking → Print history: reports
- Generation analytics → Employee record: reports
- Background removal UI → Removal dispatcher: requests
- Removal dispatcher → Removal job: dispatches (evidence: `app/Support/ProfilePictureRembgDispatcher.php`)
- Removal dispatcher → Image preparation: prepares (evidence: `app/Support/ProfilePictureRembgDispatcher.php`)
- Removal job → Removal service: invokes (evidence: `app/Jobs/ProcessProfilePictureRembgJob.php`)
- Removal service → Image preparation: prepares (evidence: `app/Services/RembgBackgroundRemovalService.php`)
- Removal service → rembg executable: runs
- Removal service → Process result: returns (evidence: `app/Services/RembgBackgroundRemovalService.php`)
- Employee record → Print history: records changes (evidence: `app/Models/EmployeeId.php`)
- Employee record → Office record: belongs to (evidence: `app/Models/EmployeeId.php`)
