How kerimkuscu/human-resources-management-system works
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: Home.vue Dashboard views · api.php API routes · User.php Eloquent models · UserController.php Users
Components 26
Client UI
Vue dashboard, SPA shell, and server-rendered auth screens.
- SPA shell · Main Vue application shell and embedded dashboard host.
resources/views/index.blade.php - Auth views · Blade-rendered login, register, reset, and verification screens.
resources/views/auth/login.blade.php - Vue router · Client-side route definitions and navigation.
resources/js/router/routes.js - Dashboard views · Feature screens for users, people, attendance, leaves, and applicants.
resources/js/views/Home.vue - Shared UI · Navbar, sidebar, not-found, and datagrid building blocks.
resources/js/components/App.vue - UI language · Frontend English and Turkish language dictionaries.
resources/js/lang/en.js
Laravel HTTP
Routes, controllers, middleware, requests, and API resources.
- index.php · Boots the Laravel application for incoming requests.
public/index.php - Web routes · HTTP routes for the browser app and auth pages.
routes/web.php - API routes · API endpoints for the Vue dashboard and CRUD actions.
routes/api.php - HTTP kernel · Registers global and route middleware for request handling.
app/Http/Kernel.php - JSON middleware · Forces JSON-shaped responses for API traffic.
app/Http/Middleware/JsonMiddleware.php - Auth guards · Session and guest protection for authenticated areas.
app/Http/Middleware/Authenticate.php - Auth screens · Login, registration, reset, and verification flows.
app/Http/Controllers/Auth/AuthController.php - Form requests · Request validation for login, employees, candidates, attendance, users, and leaves.
app/Http/Requests/EmployeeFormRequest.php - API resources · Shapes JSON for employees, users, attendance, leaves, and roles.
app/Http/Resources/EmployeeResource.php
HR Domains
Core workforce and leave management modules.
- Employees · Employee CRUD and API operations.
app/Http/Controllers/EmployeeController.php - Applicants · Candidate and applicant management endpoints.
app/Http/Controllers/CandidatesController.php - Attendance · Attendance tracking endpoints.
app/Http/Controllers/AttendanceController.php - Leaves · User leave CRUD endpoints.
app/Http/Controllers/UserLeaveController.php - Leave types · Leave type management endpoints.
app/Http/Controllers/UserLeaveTypeController.php - Users · User and role administration endpoints.
app/Http/Controllers/UserController.php
Persistence
Eloquent models, migrations, and seed data.
- Eloquent models · Users, profiles, roles, employees, candidates, attendance, leaves, and leave types.
app/Models/User.php - Schema and seeds · 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 · Session, auth, and JWT configuration plus guards.
config/auth.php - JWT config · Token-based API authentication settings.
config/jwt.php - Asset build · Laravel Mix pipeline that compiles JS and CSS assets.
webpack.mix.js
Connections 46
- 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.