# kerimkuscu/human-resources-management-system architecture

> Architecture diagram of the GitHub repository kerimkuscu/human-resources-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kerimkuscu/human-resources-management-system
- Repository: https://github.com/kerimkuscu/human-resources-management-system

## Overview

1. This is a Laravel 5/6-style monolith with a Vue.js admin SPA embedded inside it. The PHP side provides routing, auth, persistence, and API endpoints; the frontend is built with Laravel Mix/Webpack into `public/js/app.js` and `public/css/app.css`.

2. The application entrypoints are split by concern:
   - `public/index.php` boots the Laravel app for all HTTP requests.
   - `resources/views/index.blade.php` acts as the main shell for the Vue SPA.
   - `resources/views/auth/*` contains server-rendered auth screens such as login, register, password reset, and verification.

3. The backend is organized around a small set of domain modules:
   - People/Employees
   - Candidates/Applicants
   - Attendance
   - Leaves and Leave Types
   - Users and User Roles  
   Each module has a controller, request validation class, Eloquent model, and API resource class.

4. The request flow is conventional Laravel MVC:
   - Routes in `routes/web.php` and `routes/api.php` dispatch to controllers.
   - `FormRequest` classes such as `EmployeeFormRequest`, `AttendanceFormRequest`, and `UserLeaveFormRequest` handle validation.
   - Controllers read/write Eloquent models in `app/Models`.
   - `Http/Resources` classes shape JSON for the frontend.

5. The frontend is a Vue-based dashboard application, not a separate standalone SPA. It is structured under `resources/js` with:
   - `router/` for client-side navigation
   - `views/` for feature screens
   - `components/` for shared UI like navbar, sidebar, and not-found page
   - `datagrid/` for reusable list/table behavior  
   The UI is organized by business area, with separate view trees for users, people, attendance, leave settings, and applicants.

6. The dashboard is data-driven and appears to summarize the core HR/workforce entities. The `Dashboard/Cards` components point to counts or KPIs for users, roles, people, applicants, attendance, and leaves, which suggests the landing page aggregates data from multiple modules.

7. Authentication is a first-class boundary. The repo includes standard Laravel auth controllers, password reset, verification, and a `LoginFormRequest`. There is also `config/jwt.php`, which suggests API authentication may use JWT for at least part of the application. `app/Http/Middleware/Authenticate.php` and `RedirectIfAuthenticated.php` enforce session/API access control.

8. Persistence is centered on a relational database through Eloquent migrations and seeders. The schema includes tables for:
   - users
   - user profiles
   - user roles
   - employees
   - candidates
   - attendance
   - user leaves
   - leave types  
   Seeders populate baseline roles, users, and employees, which implies the app expects a preconfigured admin/HR dataset.

9. Cross-cutting middleware and helpers shape request handling:
   - `JsonMiddleware` likely forces API responses into JSON format.
   - Standard Laravel middleware covers CSRF, trimming, proxy trust, and maintenance mode.
   - `Traits/BelongsToUser.php` suggests some records are scoped to the authenticated user or tenant-like ownership model.

10. The project supports localization and UI theming. There are English and Turkish language files on the frontend, plus PHP validation/auth translation files. SCSS partials define the layout and component styling for login, sidebar, datagrids, tables, modals, and the overall theme.

11. Supporting infrastructure is the standard Laravel stack: cache, sessions, mail, queue, broadcasting, and filesystem configs are present, even if the main visible workload is CRUD and dashboard reporting. Static assets are served from `public/`, with `storage/` used for runtime files, logs, and cached views.

12. Testing exists at both feature and unit levels, with at least one API feature test for user leaves. That indicates the API surface is intended to be exercised end-to-end, not just via isolated unit tests.

13. For an architecture diagram, the key boundaries are:
   - Browser/Vue SPA and auth pages on the client edge
   - Laravel HTTP layer with middleware and routes
   - Domain controllers + validation + resources
   - Eloquent models and relational database
   - Shared auth/session/JWT infrastructure  
   The main data flows are CRUD operations for HR entities and dashboard aggregation from those entity tables.

Main entry points: [`resources/js/views/Home.vue`](https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/views/Home.vue) (Dashboard views), [`routes/api.php`](https://github.com/kerimkuscu/human-resources-management-system/blob/master/routes/api.php) (API routes), [`app/Models/User.php`](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Models/User.php) (Eloquent models), [`app/Http/Controllers/UserController.php`](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/UserController.php) (Users)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client UI"]
  node_frontend_shell["SPA shell<br/>vue shell<br/>[index.blade.php]"]
  node_auth_views["Auth views<br/>server views<br/>[login.blade.php]"]
  node_vue_router["Vue router<br/>spa routing<br/>[routes.js]"]
  node_dashboard_views["Dashboard views<br/>vue screens<br/>[Home.vue]"]
  node_shared_components["Shared UI<br/>vue components<br/>[App.vue]"]
  node_vue_i18n["UI language<br/>localization<br/>[en.js]"]
end

subgraph group_http["Laravel HTTP"]
  node_public_index["index.php<br/>http entry<br/>[index.php]"]
  node_web_routes["Web routes<br/>route map<br/>[web.php]"]
  node_api_routes["API routes<br/>route map<br/>[api.php]"]
  node_middleware_kernel["HTTP kernel<br/>middleware stack<br/>[Kernel.php]"]
  node_json_middleware["JSON middleware<br/>response middleware<br/>[JsonMiddleware.php]"]
  node_auth_middleware["Auth guards<br/>access control<br/>[Authenticate.php]"]
  node_auth_controllers["Auth screens<br/>auth controllers<br/>[AuthController.php]"]
  node_form_requests["Form requests<br/>validation"]
  node_api_resources["API resources<br/>serialization"]
end

subgraph group_domain["HR Domains"]
  node_employee_controller["Employees<br/>domain controller"]
  node_candidate_controller["Applicants<br/>domain controller"]
  node_attendance_controller["Attendance<br/>domain controller"]
  node_leave_controller["Leaves<br/>domain controller"]
  node_leave_type_controller["Leave types<br/>domain controller"]
  node_user_controller["Users<br/>domain controller<br/>[UserController.php]"]
end

subgraph group_data["Persistence"]
  node_models["Eloquent models<br/>data models<br/>[User.php]"]
  node_migrations_seeders[("Schema and seeds<br/>database setup")]
end

subgraph group_infra["Shared Infra"]
  node_auth_config["Auth config<br/>security config<br/>[auth.php]"]
  node_jwt_config["JWT config<br/>security config<br/>[jwt.php]"]
  node_mix_build["Asset build<br/>frontend build<br/>[webpack.mix.js]"]
end

node_public_index -->|"dispatches web"| node_web_routes
node_public_index -->|"dispatches api"| node_api_routes
node_web_routes -->|"auth pages"| node_auth_controllers
node_web_routes -->|"loads shell"| node_frontend_shell
node_api_routes -->|"employees"| node_employee_controller
node_api_routes -->|"applicants"| node_candidate_controller
node_api_routes -->|"attendance"| node_attendance_controller
node_api_routes -->|"leaves"| node_leave_controller
node_api_routes -->|"leave types"| node_leave_type_controller
node_api_routes -->|"users"| node_user_controller
node_middleware_kernel -->|"registers"| node_json_middleware
node_middleware_kernel -->|"registers"| node_auth_middleware
node_auth_controllers -->|"renders"| node_auth_views
node_employee_controller -->|"validates"| node_form_requests
node_candidate_controller -->|"validates"| node_form_requests
node_attendance_controller -->|"validates"| node_form_requests
node_leave_controller -->|"validates"| node_form_requests
node_leave_type_controller -->|"validates"| node_form_requests
node_user_controller -->|"validates"| node_form_requests
node_employee_controller -->|"serializes"| node_api_resources
node_candidate_controller -->|"serializes"| node_api_resources
node_attendance_controller -->|"serializes"| node_api_resources
node_leave_controller -->|"serializes"| node_api_resources
node_leave_type_controller -->|"serializes"| node_api_resources
node_user_controller -->|"serializes"| node_api_resources
node_employee_controller -->|"persists"| node_models
node_candidate_controller -->|"persists"| node_models
node_attendance_controller -->|"persists"| node_models
node_leave_controller -->|"persists"| node_models
node_leave_type_controller -->|"persists"| node_models
node_user_controller -->|"persists"| node_models
node_dashboard_views -.->|"cards data"| node_employee_controller
node_dashboard_views -.->|"cards data"| node_candidate_controller
node_dashboard_views -.->|"cards data"| node_attendance_controller
node_dashboard_views -.->|"cards data"| node_leave_controller
node_dashboard_views -.->|"cards data"| node_user_controller
node_frontend_shell -->|"mounts"| node_vue_router
node_vue_router -->|"navigates"| node_dashboard_views
node_vue_router -->|"composes"| node_shared_components
node_dashboard_views -.->|"labels"| node_vue_i18n
node_shared_components -.->|"labels"| node_vue_i18n
node_models -->|"schema"| node_migrations_seeders
node_auth_config -->|"guards"| node_auth_middleware
node_jwt_config -.->|"api auth"| node_user_controller
node_mix_build -->|"builds"| node_frontend_shell
node_mix_build -->|"bundles"| node_dashboard_views

click node_public_index "https://github.com/kerimkuscu/human-resources-management-system/blob/master/public/index.php"
click node_web_routes "https://github.com/kerimkuscu/human-resources-management-system/blob/master/routes/web.php"
click node_api_routes "https://github.com/kerimkuscu/human-resources-management-system/blob/master/routes/api.php"
click node_middleware_kernel "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Kernel.php"
click node_json_middleware "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Middleware/JsonMiddleware.php"
click node_auth_middleware "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Middleware/Authenticate.php"
click node_auth_controllers "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/Auth/AuthController.php"
click node_employee_controller "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/EmployeeController.php"
click node_candidate_controller "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/CandidatesController.php"
click node_attendance_controller "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/AttendanceController.php"
click node_leave_controller "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/UserLeaveController.php"
click node_leave_type_controller "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/UserLeaveTypeController.php"
click node_user_controller "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/UserController.php"
click node_form_requests "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Requests/EmployeeFormRequest.php"
click node_api_resources "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Resources/EmployeeResource.php"
click node_frontend_shell "https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/views/index.blade.php"
click node_auth_views "https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/views/auth/login.blade.php"
click node_vue_router "https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/router/routes.js"
click node_dashboard_views "https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/views/Home.vue"
click node_shared_components "https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/components/App.vue"
click node_vue_i18n "https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/lang/en.js"
click node_models "https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Models/User.php"
click node_migrations_seeders "https://github.com/kerimkuscu/human-resources-management-system/blob/master/database/migrations/2014_10_12_000000_create_users_table.php"
click node_auth_config "https://github.com/kerimkuscu/human-resources-management-system/blob/master/config/auth.php"
click node_jwt_config "https://github.com/kerimkuscu/human-resources-management-system/blob/master/config/jwt.php"
click node_mix_build "https://github.com/kerimkuscu/human-resources-management-system/blob/master/webpack.mix.js"

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_frontend_shell,node_auth_views,node_vue_router,node_dashboard_views,node_shared_components,node_vue_i18n toneBlue
class node_public_index,node_web_routes,node_api_routes,node_middleware_kernel,node_json_middleware,node_auth_middleware,node_auth_controllers,node_form_requests,node_api_resources toneAmber
class node_employee_controller,node_candidate_controller,node_attendance_controller,node_leave_controller,node_leave_type_controller,node_user_controller toneMint
class node_models,node_migrations_seeders toneRose
class node_auth_config,node_jwt_config,node_mix_build toneIndigo
```

## Components

### Client UI

Vue dashboard, SPA shell, and server-rendered auth screens.

- [SPA shell](https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/views/index.blade.php): vue shell · Main Vue application shell and embedded dashboard host. · `resources/views/index.blade.php`
- [Auth views](https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/views/auth/login.blade.php): server views · Blade-rendered login, register, reset, and verification screens. · `resources/views/auth/login.blade.php`
- [Vue router](https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/router/routes.js): spa routing · Client-side route definitions and navigation. · `resources/js/router/routes.js`
- [Dashboard views](https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/views/Home.vue): vue screens · Feature screens for users, people, attendance, leaves, and applicants. · `resources/js/views/Home.vue`
- [Shared UI](https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/components/App.vue): vue components · Navbar, sidebar, not-found, and datagrid building blocks. · `resources/js/components/App.vue`
- [UI language](https://github.com/kerimkuscu/human-resources-management-system/blob/master/resources/js/lang/en.js): localization · Frontend English and Turkish language dictionaries. · `resources/js/lang/en.js`

### Laravel HTTP

Routes, controllers, middleware, requests, and API resources.

- [index.php](https://github.com/kerimkuscu/human-resources-management-system/blob/master/public/index.php): http entry · Boots the Laravel application for incoming requests. · `public/index.php`
- [Web routes](https://github.com/kerimkuscu/human-resources-management-system/blob/master/routes/web.php): route map · HTTP routes for the browser app and auth pages. · `routes/web.php`
- [API routes](https://github.com/kerimkuscu/human-resources-management-system/blob/master/routes/api.php): route map · API endpoints for the Vue dashboard and CRUD actions. · `routes/api.php`
- [HTTP kernel](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Kernel.php): middleware stack · Registers global and route middleware for request handling. · `app/Http/Kernel.php`
- [JSON middleware](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Middleware/JsonMiddleware.php): response middleware · Forces JSON-shaped responses for API traffic. · `app/Http/Middleware/JsonMiddleware.php`
- [Auth guards](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Middleware/Authenticate.php): access control · Session and guest protection for authenticated areas. · `app/Http/Middleware/Authenticate.php`
- [Auth screens](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/Auth/AuthController.php): auth controllers · Login, registration, reset, and verification flows. · `app/Http/Controllers/Auth/AuthController.php`
- [Form requests](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Requests/EmployeeFormRequest.php): validation · Request validation for login, employees, candidates, attendance, users, and leaves. · `app/Http/Requests/EmployeeFormRequest.php`
- [API resources](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Resources/EmployeeResource.php): serialization · Shapes JSON for employees, users, attendance, leaves, and roles. · `app/Http/Resources/EmployeeResource.php`

### HR Domains

Core workforce and leave management modules.

- [Employees](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/EmployeeController.php): domain controller · Employee CRUD and API operations. · `app/Http/Controllers/EmployeeController.php`
- [Applicants](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/CandidatesController.php): domain controller · Candidate and applicant management endpoints. · `app/Http/Controllers/CandidatesController.php`
- [Attendance](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/AttendanceController.php): domain controller · Attendance tracking endpoints. · `app/Http/Controllers/AttendanceController.php`
- [Leaves](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/UserLeaveController.php): domain controller · User leave CRUD endpoints. · `app/Http/Controllers/UserLeaveController.php`
- [Leave types](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/UserLeaveTypeController.php): domain controller · Leave type management endpoints. · `app/Http/Controllers/UserLeaveTypeController.php`
- [Users](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Http/Controllers/UserController.php): domain controller · User and role administration endpoints. · `app/Http/Controllers/UserController.php`

### Persistence

Eloquent models, migrations, and seed data.

- [Eloquent models](https://github.com/kerimkuscu/human-resources-management-system/blob/master/app/Models/User.php): data models · Users, profiles, roles, employees, candidates, attendance, leaves, and leave types. · `app/Models/User.php`
- [Schema and seeds](https://github.com/kerimkuscu/human-resources-management-system/blob/master/database/migrations/2014_10_12_000000_create_users_table.php): database setup · Relational schema migrations and baseline seed data. · `database/migrations/2014_10_12_000000_create_users_table.php`

### Shared Infra

Authentication, configuration, runtime, and build support.

- [Auth config](https://github.com/kerimkuscu/human-resources-management-system/blob/master/config/auth.php): security config · Session, auth, and JWT configuration plus guards. · `config/auth.php`
- [JWT config](https://github.com/kerimkuscu/human-resources-management-system/blob/master/config/jwt.php): security config · Token-based API authentication settings. · `config/jwt.php`
- [Asset build](https://github.com/kerimkuscu/human-resources-management-system/blob/master/webpack.mix.js): frontend build · Laravel Mix pipeline that compiles JS and CSS assets. · `webpack.mix.js`

## Connections

- index.php → Web routes: dispatches web · Browser requests enter Laravel and are routed through web endpoints.
- index.php → API routes: dispatches api · API requests are routed through the API layer.
- Web routes → Auth screens: auth pages · Web routes render the authentication controllers and views.
- Web routes → SPA shell: loads shell · Web entrypoint serves the Vue application shell.
- API routes → Employees: employees · API routes map to employee CRUD.
- API routes → Applicants: applicants · API routes map to candidate CRUD.
- API routes → Attendance: attendance · API routes map to attendance CRUD.
- API routes → Leaves: leaves · API routes map to leave CRUD.
- API routes → Leave types: leave types · API routes map to leave type CRUD.
- API routes → Users: users · API routes map to user and role administration.
- HTTP kernel → JSON middleware: registers · Kernel includes JSON middleware for API responses.
- HTTP kernel → Auth guards: registers · Kernel includes auth enforcement in the request pipeline.
- Auth screens → Auth views: renders · Authentication controllers serve Blade-based auth screens.
- Employees → Form requests: validates · Employee operations rely on form request validation.
- Applicants → Form requests: validates · Candidate operations rely on form request validation.
- Attendance → Form requests: validates · Attendance operations rely on form request validation.
- Leaves → Form requests: validates · Leave operations rely on form request validation.
- Leave types → Form requests: validates · Leave type operations rely on form request validation.
- Users → Form requests: validates · User operations rely on form request validation.
- Employees → API resources: serializes · Employee responses are shaped with API resources.
- Applicants → API resources: serializes · Candidate responses are shaped with API resources.
- Attendance → API resources: serializes · Attendance responses are shaped with API resources.
- Leaves → API resources: serializes · Leave responses are shaped with API resources.
- Leave types → API resources: serializes · Leave type responses are shaped with API resources.
- Users → API resources: serializes · User and role responses are shaped with API resources.
- Employees → Eloquent models: persists · Employee controller reads and writes Eloquent models.
- Applicants → Eloquent models: persists · Candidate controller reads and writes Eloquent models.
- Attendance → Eloquent models: persists · Attendance controller reads and writes Eloquent models.
- Leaves → Eloquent models: persists · Leave controller reads and writes Eloquent models.
- Leave types → Eloquent models: persists · Leave type controller reads and writes Eloquent models.
- Users → Eloquent models: persists · User controller reads and writes Eloquent models.
- Dashboard views → Employees: cards data · Dashboard cards aggregate people and workforce counts.
- Dashboard views → Applicants: cards data · Dashboard cards aggregate applicant counts.
- Dashboard views → Attendance: cards data · Dashboard cards aggregate attendance counts.
- Dashboard views → Leaves: cards data · Dashboard cards aggregate leave counts.
- Dashboard views → Users: cards data · Dashboard cards aggregate user and role counts.
- SPA shell → Vue router: mounts · The SPA shell boots the client router.
- Vue router → Dashboard views: navigates · Client routes switch between feature views.
- Vue router → Shared UI: composes · Routes render shared navigation and table components.
- Dashboard views → UI language: labels · Views consume localized UI strings.
- Shared UI → UI language: labels · Shared UI uses localized strings.
- Eloquent models → Schema and seeds: schema · Models depend on the underlying relational schema and seed data.
- Auth config → Auth guards: guards · Auth configuration drives middleware behavior.
- JWT config → Users: api auth · JWT settings support token-based access to API endpoints.
- Asset build → SPA shell: builds · Laravel Mix compiles the Vue entrypoint and assets.
- Asset build → Dashboard views: bundles · Compiled frontend assets include dashboard screens.
