How sinawatra/smarthr-api works
SmartHR is a REST backend for HR administration. Users authenticate, receive JWTs, and call role-protected API endpoints to manage employee records and use attendance, leave, onboarding, evaluation, organisation, announcement, probation, and dashboard features. Sampled source confirms the employee and leave controller-to-service paths, and several service-to-repository interactions; other feature paths are retained from the README but their internal wiring was not sampled. PostgreSQL and the Cloudinary and Telegram integrations are documented external dependencies.
Main entry points: LeaveRequestService.java Leave requests · AuthController.java Authentication · EmployeeService.java Employee management · EmployeeController.java Employee endpoints
Components 19
Access and security
- Authentication
src/main/java/com/smarthr/smarthr/controller/AuthController.java - JWT security
src/main/java/com/smarthr/smarthr/security/JwtAuthenticationFilter.java
People operations
- Employee management
src/main/java/com/smarthr/smarthr/service/EmployeeService.java - Employee endpoints
src/main/java/com/smarthr/smarthr/controller/EmployeeController.java
Workforce workflows
- Attendance
src/main/java/com/smarthr/smarthr/service/AttendanceService.java - Leave endpoints
src/main/java/com/smarthr/smarthr/controller/LeaveRequestController.java - Leave requests
src/main/java/com/smarthr/smarthr/service/LeaveRequestService.java - Onboarding tasks
src/main/java/com/smarthr/smarthr/service/OnboardingTaskService.java - Task templates
src/main/java/com/smarthr/smarthr/service/DefaultOnboardingTaskService.java
Performance and insights
- Evaluations
src/main/java/com/smarthr/smarthr/service/EvaluationService.java - Evaluation criteria
src/main/java/com/smarthr/smarthr/service/EvaluationCriteriaService.java - Probation tracking
src/main/java/com/smarthr/smarthr/service/EmployeeService.java - HR dashboard
src/main/java/com/smarthr/smarthr/service/DashboardService.java
Organisation and communications
- Organisation setup
src/main/java/com/smarthr/smarthr/service/DepartmentService.java - Announcements
src/main/java/com/smarthr/smarthr/service/AnnouncementService.java
Other components
- API caller
- Cloudinary
- Telegram
- PostgreSQL
Connections 22
- API caller → Authentication: authenticates
README.md - API caller → Employee endpoints: manages employees
README.md - API caller → Leave endpoints: requests leave
README.md - API caller → Attendance: records attendance
README.md - API caller → Onboarding tasks: updates tasks
README.md - API caller → Task templates: manages templates
README.md - API caller → Evaluations: submits evaluations
README.md - API caller → Evaluation criteria: reads criteria
README.md - API caller → Probation tracking: views probation
README.md - API caller → HR dashboard: views statistics
README.md - API caller → Organisation setup: configures organisation
README.md - API caller → Announcements: manages announcements
README.md - Authentication → JWT security: issues tokens
- Employee endpoints → Employee management: calls
src/main/java/com/smarthr/smarthr/controller/EmployeeController.java - Leave endpoints → Leave requests: calls
src/main/java/com/smarthr/smarthr/controller/LeaveRequestController.java - Leave requests → Cloudinary: uploads attachments
src/main/java/com/smarthr/smarthr/service/LeaveRequestService.java - Announcements → Telegram: pushes announcements
README.md - Employee management → PostgreSQL: reads and writes
- Leave requests → PostgreSQL: reads and writes
- Attendance → PostgreSQL: reads and writes
- Evaluations → PostgreSQL: reads and writes
- HR dashboard → PostgreSQL: aggregates data