How aditi-sen-core/employee-attendance-system works
The system supports employee and HR workflows: employees authenticate, track attendance, apply for and review leave, and manage profiles; HR manages employees and attendance, decides leave requests, and views reports. The React client routes role-protected pages through domain API modules to Spring REST controllers, services, and repositories backed by MySQL. JWT authentication and role-based access protect the API. The README documents reports and analytics; their page is represented, but report-generation details were not sampled.
Main entry points: axios.js HTTP client · pages Role-based pages · AuthController.java Authentication endpoint · EmployeeRepository.java Employee records
Components 25
React application
- Role-based pages
frontend/src/pages - Protected routing
frontend/src/routes/AppRoutes.jsx - Auth context
frontend/src/context/AuthContext.jsx - Auth API
frontend/src/api/authApi.js - Attendance API
frontend/src/api/attendanceApi.js - Leave API
frontend/src/api/leaveApi.js - Employee API
frontend/src/api/employeeApi.js - HTTP client
frontend/src/api/axios.js
Identity and access
- Authentication endpoint
backend/src/main/java/com/attendance/backend/controller/AuthController.java - JWT service
backend/src/main/java/com/attendance/backend/security/JwtService.java - Security filter and rules
backend/src/main/java/com/attendance/backend/security/JwtAuthenticationFilter.java - Security configuration
backend/src/main/java/com/attendance/backend/config/SecurityConfig.java
Attendance and leave
- Attendance endpoint
backend/src/main/java/com/attendance/backend/controller/AttendanceController.java - Attendance rules and stats
backend/src/main/java/com/attendance/backend/service/AttendanceService.java - Leave endpoint
backend/src/main/java/com/attendance/backend/controller/LeaveController.java - Leave workflow
backend/src/main/java/com/attendance/backend/service/LeaveService.java - Reports and analytics
frontend/src/pages/hr/Reports.jsx - Attendance records
backend/src/main/java/com/attendance/backend/repository/AttendanceRepository.java - Leave records
backend/src/main/java/com/attendance/backend/repository/LeaveRepository.java
Employee records
- Employee endpoint
backend/src/main/java/com/attendance/backend/controller/EmployeeController.java - Employee management
backend/src/main/java/com/attendance/backend/service/EmployeeService.java - Employee records
backend/src/main/java/com/attendance/backend/repository/EmployeeRepository.java
Other components
- Employee
- HR manager
- MySQL
Connections 32
- Employee → Protected routing: opens portal
- HR manager → Protected routing: opens portal
- Protected routing → Role-based pages: routes by role
- Role-based pages → Auth context: uses session
- Auth context → Auth API: requests login
- Auth API → HTTP client: sends request
- HTTP client → Authentication endpoint: calls REST
- Authentication endpoint → Employee records: finds account
- Authentication endpoint → JWT service: creates token
- JWT service → Authentication endpoint: returns token
- HTTP client → Security filter and rules: sends JWT
- Security configuration → Security filter and rules: configures filter
- Role-based pages → Attendance API: attendance actions
- Role-based pages → Leave API: leave actions
- Role-based pages → Employee API: employee actions
- Attendance API → HTTP client: sends request
- Leave API → HTTP client: sends request
- Employee API → HTTP client: sends request
- HTTP client → Attendance endpoint: calls REST
- HTTP client → Leave endpoint: calls REST
- HTTP client → Employee endpoint: calls REST
- Attendance endpoint → Attendance rules and stats: dispatches
- Attendance rules and stats → Attendance records: reads and writes
- Leave endpoint → Leave workflow: dispatches
- Leave workflow → Leave records: reads and writes
- Leave workflow → Employee records: checks balance
- Employee endpoint → Employee management: dispatches
- Employee management → Employee records: reads and writes
- Employee records → MySQL: persists records
- Attendance records → MySQL: persists records
- Leave records → MySQL: persists records
- Role-based pages → Reports and analytics: HR reporting