How lakshman1543/springbootems-employeemanagementsystem works
Purpose and Runtime
This is a Java/Spring Boot employee-management backend. It exposes role-oriented HTTP APIs for administrators, managers, and employees, covering authentication, employee administration, duties, leave, and email/password-recovery workflows. The application bootstraps from src/main/java/com/klef/fsad/sdp/EmployeeManagementSystemApplication.java; Maven build/runtime dependencies are defined by pom.xml.
API Entry Layer
Controllers are the external request boundary and divide operations by role and authentication:
• src/main/java/com/klef/fsad/sdp/controller/AuthController.java
• src/main/java/com/klef/fsad/sdp/controller/AdminController.java
• src/main/java/com/klef/fsad/sdp/controller/ManagerController.java
• src/main/java/com/klef/fsad/sdp/controller/EmployeeController.java
Requests should flow controller → service abstraction → service implementation → Spring Data repository. LoginRequest is the explicit login payload at src/main/java/com/klef/fsad/sdp/dto/LoginRequest.java.
Identity and Access
The system maintains separate role entities for admins, managers, and employees:
• src/main/java/com/klef/fsad/sdp/model/Admin.java
• src/main/java/com/klef/fsad/sdp/model/Manager.java
• src/main/java/com/klef/fsad/sdp/model/Employee.java
JWT creation/parsing is centralized in src/main/java/com/klef/fsad/sdp/security/JWTUtilizer.java. Authentication flows are handled at the auth-controller boundary; downstream planners should treat token issuance/validation and role selection as security-critical integration points.
Employee and Manager Administration
Employee and manager lifecycle/business operations are encapsulated behind service interfaces and implementations:
• src/main/java/com/klef/fsad/sdp/services/EmployeeService.java
• src/main/java/com/klef/fsad/sdp/services/EmployeeServiceImpl.java
• src/main/java/com/klef/fsad/sdp/services/ManagerService.java
• src/main/java/com/klef/fsad/sdp/services/ManagerServiceImpl.java
Persistence boundaries are the corresponding repositories, including src/main/java/com/klef/fsad/sdp/repository/EmployeeRepository.java and src/main/java/com/klef/fsad/sdp/repository/ManagerRepository.java. Admin-specific operations follow the same pattern through AdminService and AdminRepository.
Work Assignment and Leave
Duties and leave are independent domain workflows, modeled and persisted separately:
• src/main/java/com/klef/fsad/sdp/model/Duty.java
• src/main/java/com/klef/fsad/sdp/services/DutyServiceImpl.java
• src/main/java/com/klef/fsad/sdp/model/Leave.java
• src/main/java/com/klef/fsad/sdp/services/LeaveServiceImpl.java
Their repositories (src/main/java/com/klef/fsad/sdp/repository/DutyRepository.java, src/main/java/com/klef/fsad/sdp/repository/LeaveRepository.java) form the database access boundary. Manager-facing APIs likely coordinate assignment and review actions; employee-facing APIs likely submit or consume these records.
Email and Password Recovery
Email and reset-token records support notification and credential-recovery flows:
• src/main/java/com/klef/fsad/sdp/model/Email.java
• src/main/java/com/klef/fsad/sdp/model/ForgotPassword.java
• src/main/java/com/klef/fsad/sdp/model/ResetToken.java
• src/main/java/com/klef/fsad/sdp/services/EmailService.java
EmailRepository and ResetTokenRepository persist this workflow state. An email transport/provider may be configured externally, but none is identifiable from the supplied tree.
Infrastructure Boundaries
Spring Boot supplies the application runtime, dependency injection, HTTP handling, and likely JPA repository integration. Environment-dependent settings—including database connectivity, JWT secrets, and possible mail configuration—belong in src/main/resources/application.properties. The repository does not include frontend assets, deployment manifests, migrations, or infrastructure-as-code; these are external boundaries rather than in-repo stages.
Main entry points: DutyServiceImpl.java Duty Service · LeaveServiceImpl.java Leave Service · AuthController.java Auth Controller · ManagerController.java Manager Controller
Components 23
HTTP API
Role-oriented REST entry points.
- Auth Controller
src/main/java/com/klef/fsad/sdp/controller/AuthController.java - Admin Controller
src/main/java/com/klef/fsad/sdp/controller/AdminController.java - Manager Controller
src/main/java/com/klef/fsad/sdp/controller/ManagerController.java - Employee Controller
src/main/java/com/klef/fsad/sdp/controller/EmployeeController.java - Login Request
src/main/java/com/klef/fsad/sdp/dto/LoginRequest.java
Business Services
Service implementations coordinate domain workflows.
- Employee Service
src/main/java/com/klef/fsad/sdp/services/EmployeeServiceImpl.java - Manager Service
src/main/java/com/klef/fsad/sdp/services/ManagerServiceImpl.java - Admin Service · Admin lifecycle operations follow the service abstraction pattern.
- Duty Service
src/main/java/com/klef/fsad/sdp/services/DutyServiceImpl.java - Leave Service
src/main/java/com/klef/fsad/sdp/services/LeaveServiceImpl.java - Duty
src/main/java/com/klef/fsad/sdp/model/Duty.java - Leave
src/main/java/com/klef/fsad/sdp/model/Leave.java
Persistence
Spring Data repository boundary.
- Employee Repository
src/main/java/com/klef/fsad/sdp/repository/EmployeeRepository.java - Manager Repository
src/main/java/com/klef/fsad/sdp/repository/ManagerRepository.java - Admin Repository
- Duty Repository
src/main/java/com/klef/fsad/sdp/repository/DutyRepository.java - Leave Repository
src/main/java/com/klef/fsad/sdp/repository/LeaveRepository.java - Email & Reset Store · Persists email records and reset tokens.
Identity & Recovery
Authentication, role data, and password recovery.
- JWT Utilizer · Creates and parses authentication tokens.
src/main/java/com/klef/fsad/sdp/security/JWTUtilizer.java - Role Entities · Separate Admin, Manager, and Employee identities.
- Email Service · Supports email and credential recovery workflows.
src/main/java/com/klef/fsad/sdp/services/EmailService.java
Other components
- Spring Boot App · Application bootstrap and dependency-injection runtime.
src/main/java/com/klef/fsad/sdp/EmployeeManagementSystemApplication.java - Runtime Configuration · Database, JWT, and possible mail settings.
src/main/resources/application.properties
Connections 22
- Spring Boot App → Runtime Configuration: loads
- Auth Controller → Login Request: accepts
- Auth Controller → JWT Utilizer: issues and validates
- Auth Controller → Role Entities: selects role identity
- Admin Controller → Admin Service: admin operations
- Manager Controller → Manager Service: management operations
- Manager Controller → Duty Service: assigns and reviews
- Manager Controller → Leave Service: reviews
- Employee Controller → Employee Service: employee operations
- Employee Controller → Duty Service: consumes duties
- Employee Controller → Leave Service: submits leave
- Employee Service → Employee Repository: persists
- Manager Service → Manager Repository: persists
- Admin Service → Admin Repository: persists
- Duty Service → Duty: manages
- Duty Service → Duty Repository: persists
- Leave Service → Leave: manages
- Leave Service → Leave Repository: persists
- Email Service → Email & Reset Store: stores recovery state
- Employee Repository → Role Entities: maps employee role
- Manager Repository → Role Entities: maps manager role
- Admin Repository → Role Entities: maps admin role