How leanquality2017/lean-hrm works
UniHR is a role- and company-scoped HR management application, with institute operations and payroll available as gated modules. Users enter through the Next.js application and authentication flow; domain pages call API route handlers, which validate and authorize requests before operating on Prisma-backed records. The graph emphasizes documented employee, payroll, attendance, leave, and institute capabilities; most domain handlers and UI pages were not sampled, so their specific call relationships are omitted.
Main entry points: db.ts Prisma database · api-auth.ts API authorization · payroll/route.ts Payroll · employees/route.ts Employee management
Components 20
Application entry
- App shell
src/components/app-shell.tsx - PWA registration
src/components/pwa-register.tsx
Identity and safeguards
- Credentials login
src/lib/auth.ts - API authorization
src/lib/api-auth.ts - Page guards
src/lib/page-guard.ts
Workforce operations
- Employee management
src/app/api/employees/route.ts - Attendance
src/app/api/attendance/route.ts - Leave requests
src/app/api/leaves/route.ts - Payroll
src/app/api/payroll/route.ts - Work reports
src/app/api/work-reports/route.ts - Recruitment
src/app/api/applications/route.ts - Company operations
src/app/api/companies/route.ts
Institute operations
- Institute modules
src/app/(app)/institute
Shared services
- Request validation
src/lib/validation.ts - Feature gates
src/lib/feature-gates.ts - Audit logging
src/lib/audit.ts - Pagination
src/lib/pagination.ts - Prisma database
src/lib/db.ts - Domain constants
src/lib/constants.ts
Other components
- HR user
Connections 38
- HR user → App shell: uses
src/components/app-shell.tsx - App shell → PWA registration: registers
src/components/app-shell.tsx - HR user → Credentials login: signs in
- Credentials login → Prisma database: checks credentials
src/lib/auth.ts - Credentials login → API authorization: provides session
src/lib/api-auth.ts - API authorization → Prisma database: loads user
src/lib/api-auth.ts - Page guards → Feature gates: checks gates
src/lib/page-guard.ts - HR user → Employee management: manages staff
- HR user → Attendance: records attendance
- HR user → Leave requests: requests leave
- HR user → Payroll: reviews payroll
- HR user → Work reports: submits reports
- HR user → Recruitment: handles applicants
- HR user → Company operations: administers companies
- HR user → Institute modules: manages institute
- Employee management → API authorization: authorizes
src/app/api/employees/route.ts - Employee management → Request validation: validates input
src/app/api/employees/route.ts - Employee management → Prisma database: reads and writes
src/app/api/employees/route.ts - Attendance → API authorization: authorizes
src/app/api/attendance/route.ts - Attendance → Prisma database: reads and writes
src/app/api/attendance/route.ts - Leave requests → API authorization: authorizes
src/app/api/leaves/route.ts - Leave requests → Prisma database: reads and writes
src/app/api/leaves/route.ts - Payroll → API authorization: authorizes
src/app/api/payroll/route.ts - Payroll → Feature gates: checks gate
src/app/api/payroll/route.ts - Payroll → Request validation: validates input
src/app/api/payroll/route.ts - Payroll → Audit logging: records events
src/app/api/payroll/route.ts - Payroll → Prisma database: reads and writes
src/app/api/payroll/route.ts - Payroll → Pagination: parses pages
src/app/api/payroll/route.ts - Work reports → API authorization: authorizes
src/app/api/work-reports/route.ts - Work reports → Prisma database: reads and writes
src/app/api/work-reports/route.ts - Recruitment → API authorization: authorizes
src/app/api/applications/route.ts - Recruitment → Request validation: validates input
src/app/api/applications/route.ts - Recruitment → Prisma database: reads and writes
src/app/api/applications/route.ts - Company operations → API authorization: authorizes
src/app/api/companies/route.ts - Company operations → Prisma database: reads and writes
src/app/api/companies/route.ts - Institute modules → Feature gates: gated by
- Employee management → Domain constants: uses roles
src/app/api/employees/route.ts - Audit logging → Prisma database: writes logs
src/lib/audit.ts