# reeyanto/erp architecture

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

- Interactive diagram: https://gitdiagram.com/reeyanto/erp
- Repository: https://github.com/reeyanto/erp

## Overview

This repository is an HR-oriented ERP admin application: administrators use the Filament dashboard to manage companies, departments, positions, and employees. The README identifies /admin as the entry point; the tree shows separate Filament resources, forms, tables, models, and an employee overview widget. Source excerpts are limited, so persistence and resource wiring are represented at the resource/model level without asserting unverified inter-entity workflows.

Main entry points: [`app/Providers/Filament/AdminPanelProvider.php`](https://github.com/reeyanto/erp/blob/main/app/Providers/Filament/AdminPanelProvider.php) (Filament panel), [`app/Filament/Resources/Employees/EmployeeResource.php`](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/EmployeeResource.php) (Employees), [`app/Filament/Resources/Companies/CompanyResource.php`](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Companies/CompanyResource.php) (Companies), [`app/Filament/Resources/Departments/DepartmentResource.php`](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Departments/DepartmentResource.php) (Departments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin interface"]
  node_panel["Filament panel"]
end

subgraph group_hr["HR management"]
  node_companies["Companies"]
  node_company_form["Company form<br/>[CompanyForm.php]"]
  node_company_table["Company table<br/>[CompaniesTable.php]"]
  node_departments["Departments"]
  node_department_form["Department form<br/>[DepartmentForm.php]"]
  node_department_table["Department table"]
  node_positions["Positions"]
  node_position_form["Position form<br/>[PositionForm.php]"]
  node_position_table["Position table<br/>[PositionsTable.php]"]
  node_employees["Employees"]
  node_employee_form["Employee form<br/>[EmployeeForm.php]"]
  node_employee_table["Employee table<br/>[EmployeesTable.php]"]
  node_employee_overview["Employee overview"]
end

subgraph group_data["Domain and persistence"]
  node_company_model["Company model<br/>[Company.php]"]
  node_department_model["Department model<br/>[Department.php]"]
  node_position_model["Position model<br/>[Position.php]"]
  node_employee_model["Employee model<br/>[Employee.php]"]
  node_user_model["User model<br/>[User.php]"]
  node_database[("Configured database<br/>[database.php]")]
  node_observer["Employee observer"]
end

node_admin(("Administrator"))
node_storage[("Public file storage")]

node_admin -->|"opens /admin"| node_panel
node_panel -->|"dispatches"| node_companies
node_panel -->|"dispatches"| node_departments
node_panel -->|"dispatches"| node_positions
node_panel -->|"dispatches"| node_employees
node_companies -->|"uses form"| node_company_form
node_companies -->|"uses table"| node_company_table
node_departments -->|"uses form"| node_department_form
node_departments -->|"uses table"| node_department_table
node_positions -->|"uses form"| node_position_form
node_positions -->|"uses table"| node_position_table
node_employees -->|"uses form"| node_employee_form
node_employees -->|"uses table"| node_employee_table
node_employees -->|"provides widget"| node_employee_overview
node_companies -->|"manages"| node_company_model
node_departments -->|"manages"| node_department_model
node_positions -->|"manages"| node_position_model
node_employees -->|"manages"| node_employee_model
node_company_model -->|"reads/writes"| node_database
node_department_model -->|"reads/writes"| node_database
node_position_model -->|"reads/writes"| node_database
node_employee_model -->|"reads/writes"| node_database
node_observer -->|"deletes employee image"| node_storage
node_observer -->|"deletes related user"| node_user_model

click node_panel "https://github.com/reeyanto/erp/blob/main/app/Providers/Filament/AdminPanelProvider.php"
click node_companies "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Companies/CompanyResource.php"
click node_company_form "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Companies/Schemas/CompanyForm.php"
click node_company_table "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Companies/Tables/CompaniesTable.php"
click node_departments "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Departments/DepartmentResource.php"
click node_department_form "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Departments/Schemas/DepartmentForm.php"
click node_department_table "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Departments/Tables/DepartmentsTable.php"
click node_positions "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Positions/PositionResource.php"
click node_position_form "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Positions/Schemas/PositionForm.php"
click node_position_table "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Positions/Tables/PositionsTable.php"
click node_employees "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/EmployeeResource.php"
click node_employee_form "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/Schemas/EmployeeForm.php"
click node_employee_table "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/Tables/EmployeesTable.php"
click node_employee_overview "https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/Widgets/EmployeesOverview.php"
click node_company_model "https://github.com/reeyanto/erp/blob/main/app/Models/Company.php"
click node_department_model "https://github.com/reeyanto/erp/blob/main/app/Models/Department.php"
click node_position_model "https://github.com/reeyanto/erp/blob/main/app/Models/Position.php"
click node_employee_model "https://github.com/reeyanto/erp/blob/main/app/Models/Employee.php"
click node_user_model "https://github.com/reeyanto/erp/blob/main/app/Models/User.php"
click node_database "https://github.com/reeyanto/erp/blob/main/config/database.php"
click node_observer "https://github.com/reeyanto/erp/blob/main/app/Observers/EmployeeObserver.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 toneBlue
class node_companies,node_company_form,node_company_table,node_departments,node_department_form,node_department_table,node_positions,node_position_form,node_position_table,node_employees,node_employee_form,node_employee_table,node_employee_overview,node_storage toneAmber
class node_company_model,node_department_model,node_position_model,node_employee_model,node_user_model,node_database,node_observer toneMint
class node_admin toneIndigo
```

## Components

### Admin interface

- [Filament panel](https://github.com/reeyanto/erp/blob/main/app/Providers/Filament/AdminPanelProvider.php): `app/Providers/Filament/AdminPanelProvider.php`

### HR management

- [Companies](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Companies/CompanyResource.php): `app/Filament/Resources/Companies/CompanyResource.php`
- [Company form](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Companies/Schemas/CompanyForm.php): `app/Filament/Resources/Companies/Schemas/CompanyForm.php`
- [Company table](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Companies/Tables/CompaniesTable.php): `app/Filament/Resources/Companies/Tables/CompaniesTable.php`
- [Departments](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Departments/DepartmentResource.php): `app/Filament/Resources/Departments/DepartmentResource.php`
- [Department form](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Departments/Schemas/DepartmentForm.php): `app/Filament/Resources/Departments/Schemas/DepartmentForm.php`
- [Department table](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Departments/Tables/DepartmentsTable.php): `app/Filament/Resources/Departments/Tables/DepartmentsTable.php`
- [Positions](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Positions/PositionResource.php): `app/Filament/Resources/Positions/PositionResource.php`
- [Position form](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Positions/Schemas/PositionForm.php): `app/Filament/Resources/Positions/Schemas/PositionForm.php`
- [Position table](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Positions/Tables/PositionsTable.php): `app/Filament/Resources/Positions/Tables/PositionsTable.php`
- [Employees](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/EmployeeResource.php): `app/Filament/Resources/Employees/EmployeeResource.php`
- [Employee form](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/Schemas/EmployeeForm.php): `app/Filament/Resources/Employees/Schemas/EmployeeForm.php`
- [Employee table](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/Tables/EmployeesTable.php): `app/Filament/Resources/Employees/Tables/EmployeesTable.php`
- [Employee overview](https://github.com/reeyanto/erp/blob/main/app/Filament/Resources/Employees/Widgets/EmployeesOverview.php): `app/Filament/Resources/Employees/Widgets/EmployeesOverview.php`

### Domain and persistence

- [Company model](https://github.com/reeyanto/erp/blob/main/app/Models/Company.php): `app/Models/Company.php`
- [Department model](https://github.com/reeyanto/erp/blob/main/app/Models/Department.php): `app/Models/Department.php`
- [Position model](https://github.com/reeyanto/erp/blob/main/app/Models/Position.php): `app/Models/Position.php`
- [Employee model](https://github.com/reeyanto/erp/blob/main/app/Models/Employee.php): `app/Models/Employee.php`
- [User model](https://github.com/reeyanto/erp/blob/main/app/Models/User.php): `app/Models/User.php`
- [Configured database](https://github.com/reeyanto/erp/blob/main/config/database.php): `config/database.php`
- [Employee observer](https://github.com/reeyanto/erp/blob/main/app/Observers/EmployeeObserver.php): `app/Observers/EmployeeObserver.php`

### Other components

- **Administrator**
- **Public file storage**

## Connections

- Administrator → Filament panel: opens /admin
- Filament panel → Companies: dispatches
- Filament panel → Departments: dispatches
- Filament panel → Positions: dispatches
- Filament panel → Employees: dispatches
- Companies → Company form: uses form
- Companies → Company table: uses table
- Departments → Department form: uses form
- Departments → Department table: uses table
- Positions → Position form: uses form
- Positions → Position table: uses table
- Employees → Employee form: uses form
- Employees → Employee table: uses table
- Employees → Employee overview: provides widget
- Companies → Company model: manages
- Departments → Department model: manages
- Positions → Position model: manages
- Employees → Employee model: manages
- Company model → Configured database: reads/writes
- Department model → Configured database: reads/writes
- Position model → Configured database: reads/writes
- Employee model → Configured database: reads/writes
- Employee observer → Public file storage: deletes employee image
- Employee observer → User model: deletes related user
