How viccodem/sistemarh_laravel works
1. Overall shape
- This is a Laravel 13 monolith for an HR system. The app is organized around role-specific back office screens, with Blade views for most pages and Livewire for richer interactive areas.
- The main runtime boundary is the standard Laravel request cycle: routes → middleware/auth/policies → controllers or Livewire components → services/models → database.
2. Access and identity
- Authentication is handled with the built-in Laravel auth stack under app/Http/Controllers/Auth and routes/auth.php.
- Role enforcement is explicit via app/Http/Middleware/CheckRole.php, which likely separates admin, empresa, candidato, and internal user access.
- Profile management is a separate concern (ProfileController, profile requests, profile views), alongside password and email verification flows.
3. Primary business domains
- The core entities are Empresa, Vacante, Candidato, Postulacion, Ticket, ChatRoom, ChatMessage, CatalogoServicio, ServicioAsignado, and PersonalExterno.
- These are represented as Eloquent models in app/Models and backed by dedicated migrations, so the database schema is a first-class part of the architecture.
4. Candidate / recruitment flow
- Candidate-facing pages live under resources/views/candidato, with a Livewire component CandidatoSolicitud for interactive application or request submission.
- The likely flow is candidate browsing vacancies, submitting applications (Postulacion), and tracking status in candidate views.
- CandidatoService and PostulacionService indicate business rules are not kept only in controllers; they are extracted into services.
5. Empresa (company) workspace
- Company users have their own controller and dashboard area under app/Http/Controllers/Empresa and resources/views/empresa.
- This area manages vacancies and “solicitudes” through standard create/edit/show/index screens, suggesting company-side intake and vacancy lifecycle management.
- The presence of vacantes/matching.blade.php suggests there is a matching or evaluation step between vacancy requirements and candidate profiles.
6. Admin back office
- Admin controllers and views cover management screens for empresas, candidatos, vacantes, catálogo de servicios, and personal externo.
- This is the administrative control plane for CRUD, moderation, and operational oversight rather than end-user interaction.
- Modal-based UI fragments in admin views suggest many admin actions are handled inline without full-page navigation.
7. Workflow, SLA, and service orchestration
- WorkflowService and SlaInteligenteService indicate a rules-driven layer for business process transitions and deadline handling, especially around tickets.
- config/workflow.php and config/sla.php make these behaviors configurable, so process logic is not hard-coded into controllers.
- Ticket migrations include SLA fields, showing that response/resolve timing is part of the data model, not just presentation.
8. Ticketing subsystem
- Tickets and ticket messages form a separate support/operations stream with their own CRUD pages under resources/views/tickets.
- This subsystem is likely used to track issues, requests, or internal support cases across roles.
- The Ticket/TicketMessage split indicates threaded conversations attached to a case record.
9. Chat subsystem
- Real-time or near-real-time messaging is implemented with Livewire components: ChatList and ChatConversacion.
- Persistence is modeled with ChatRoom, ChatRoomMember, and ChatMessage, which implies group or direct room membership rather than simple one-to-one messages.
- Chat has dedicated views under resources/views/chat and resources/views/livewire/chat, separating page shell from component rendering.
10. Interactive UI layer
- Livewire is used for the more dynamic screens: candidate submission, chat, and a KanbanBoard component.
- The Kanban board is likely tied to tracking states for vacancies, applications, or tickets, giving the system a visual workflow view.
- Most other UI is standard Blade layouts and components, with shared layout shells in resources/views/layouts and reusable form/button components in resources/views/components.
11. Authorization and domain rules
- CandidatoPolicy and VacantePolicy enforce object-level access control, complementing role middleware.
- This suggests the app distinguishes between “who may enter a section” and “who may act on a specific record”.
- Controllers likely stay thin on permission logic, deferring to policies and services.
12. Persistence and supporting infrastructure
- Data is stored in a relational database via migrations and seeded with DatabaseSeeder and DummyDataSeeder.
- Standard Laravel support tables are present for cache, jobs, notifications, and activity logging, indicating the app uses framework-backed operational features.
- storage/ is the usual Laravel boundary for logs, cached views, sessions, and file uploads.
13. Frontend/tooling boundary
- The app uses Laravel’s Blade stack with Vite, Tailwind, and app-specific JS/CSS entrypoints under resources/js and resources/css.
- The frontend is not a separate SPA; it is server-rendered pages enhanced by Livewire and compiled assets.
14. How the pieces connect
- A typical request path is: user enters through routes/web.php or routes/auth.php, middleware checks role/auth state, a controller or Livewire component invokes a service, the service reads/writes Eloquent models, and the result is rendered into Blade.
- The most important diagram boundaries are: authentication/authorization, role-specific workspaces, operational support (tickets/chat), and the shared data model underneath them.
Main entry points: web.php Web routes · Models Core models · CheckRole.php Role gate · candidato Candidato area
Components 21
Access & Auth
Authentication, role gates, and profile management
- Web routes · Main HTTP route entrypoint
routes/web.php - Auth routes · Login, registration, and verification routes
routes/auth.php - Role gate · Role-based access filter
app/Http/Middleware/CheckRole.php - Auth flow · Session, registration, password, and verification controllers
app/Http/Controllers/Auth - Profile · Profile settings and account updates
app/Http/Controllers/ProfileController.php
Role Workspaces
Main user-facing areas by role
- Empresa area · Company dashboard and vacancy management
app/Http/Controllers/Empresa/EmpresaController.php - Admin area · Administrative control panel for core entities
app/Http/Controllers/Admin/AdminController.php - Candidato area · Candidate-facing vacancy and application screens
resources/views/candidato
Operations
Support, chat, and workflow subsystems
- Tickets · Ticket case CRUD and detail views
app/Http/Controllers/TicketController.php - Chat UI · Interactive room list and conversation components
app/Livewire/Chat - Kanban board · Visual workflow board for states and tracking
app/Livewire/KanbanBoard.php
Domain & Data
Core models, services, and database layer
- Workflow rules · Business process transitions and SLA handling
app/Services/WorkflowService.php - Candidato service · Candidate domain rules and application support
app/Services/CandidatoService.php - Postulacion service · Application lifecycle rules
app/Services/PostulacionService.php - Core models · Primary entities for HR, tickets, chat, and services
app/Models - Policies · Object-level access control for key records
app/Policies - Schema · Database tables and structural evolution
database/migrations - Seed data · Database bootstrap and sample data
database/seeders
UI & App Shell
Shared views, components, and runtime entrypoints
- View shell · Shared layouts and reusable Blade components
resources/views/layouts - Livewire views · Component templates for dynamic screens
resources/views/livewire - Assets · Compiled JS and CSS entrypoints
resources/js/app.js
Connections 25
- Auth routes → Auth flow: dispatches · Auth routes are handled by the auth controllers
- Web routes → Role gate: guards · Web requests pass through role checks where required
- Role gate → Empresa area: allows · Role filtering gates company workspace access
- Role gate → Admin area: allows · Role filtering gates admin workspace access
- Role gate → Candidato area: allows · Role filtering gates candidate pages
- Web routes → Profile: dispatches · Profile routes reach the profile controller
- Web routes → Tickets: dispatches · Ticket routes reach the ticket controller
- Web routes → Chat UI: mounts · Chat routes render Livewire components
- Web routes → Kanban board: mounts · Workflow board is exposed as a Livewire screen
- Empresa area → Core models: reads/writes · Company screens operate on vacancies and related records
- Admin area → Core models: manages · Admin screens manage core entities
- Candidato area → Candidato service: uses · Candidate screens call domain logic
- Candidato area → Postulacion service: uses · Applications are coordinated through service logic
- Tickets → Workflow rules: applies · Ticket handling uses workflow and SLA rules
- Chat UI → Core models: persists · Chat components read and store room and message data
- Kanban board → Workflow rules: visualizes · Board reflects process states driven by workflow rules
- Workflow rules → Core models: updates · Workflow and SLA services operate on domain records
- Policies → Core models: protects · Policies enforce record-level access on core models
- Schema → Core models: defines · Migrations back the model layer with table schema
- Seed data → Schema: bootstraps · Seeders populate the database created by migrations
- View shell → Empresa area: renders · Shared layouts wrap workspace pages
- View shell → Admin area: renders · Shared layouts wrap admin pages
- Livewire views → Chat UI: renders · Livewire templates back chat components
- Livewire views → Kanban board: renders · Livewire templates back the kanban board
- Assets → View shell: supports · Compiled frontend assets support Blade layouts