How sprint-4team/sb13-hrbank-team04 works
Purpose and Entry Points
HR Bank is an employee-management system with a React/TypeScript frontend and Spring Boot REST backend. The backend starts at src/main/java/com/codeit/hrbank/HrBankApplication.java; its built frontend is also served as static content under src/main/resources/static/index.html. Frontend development starts from frontend/src/main.tsx.
Frontend Application Shell
The Vite React client organizes the UI around page-level modules for dashboard, employees, departments, attendance, history, and backups. Shared layout/navigation establishes the application frame, while page components compose feature tables, filters, charts, and modals.
• frontend/src/components/layout/Layout.tsx
• frontend/src/components/layout/Navigation.tsx
• frontend/src/pages/Dashboard.tsx
Frontend API and State Boundary
Feature-specific API adapters isolate HTTP calls from UI components; centralized client plumbing is at frontend/src/api/client.ts. Per-domain stores hold fetched lists/dashboard data and coordinate filtering, cursor/infinite-scroll pagination, mutations, and toast feedback for views.
• frontend/src/api/employee/employeeApi.ts
• frontend/src/store/employeeStore.ts
• frontend/src/store/historyStore.ts
Employee and Department Core Domain
Employees are the primary managed records, associated with departments and status. REST controllers accept request DTOs, delegate to services, and persist through Spring Data/JPA repositories; custom repository implementations support richer searches. Employee changes are a likely cross-domain event source for history.
• src/main/java/com/codeit/hrbank/employee/controller/EmployeeController.java
• src/main/java/com/codeit/hrbank/employee/service/EmployeeService.java
• src/main/java/com/codeit/hrbank/department/service/DepartmentServiceImpl.java
Attendance and Change-History Domains
Attendance records are independently created and updated for employees. The changelog subsystem stores employee change logs and detailed diffs, exposes cursor-paged search and detail retrieval, and backs the frontend History screen.
• src/main/java/com/codeit/hrbank/attendance/controller/AttendanceController.java
• src/main/java/com/codeit/hrbank/changelog/service/ChangeLogServiceImpl.java
• src/main/java/com/codeit/hrbank/changelog/repository/EmployeeChangeLogRepositoryCustomImpl.java
Backup and File Boundaries
Backup history is a scheduled subsystem with explicit progress/status and a guard against concurrent backups. File handling is separately layered and uses local filesystem storage, exposing upload/download concerns outside employee persistence.
• src/main/java/com/codeit/hrbank/backup/scheduler/BackupScheduler.java
• src/main/java/com/codeit/hrbank/backup/service/BackupHistoryCreationService.java
• src/main/java/com/codeit/hrbank/file/storage/LocalFileStorage.java
Persistence, API Contracts, and Runtime
The runtime is JVM/Spring Boot, built with Gradle, using Spring Web and Spring Data JPA. Domain entities are persistence models; request/response DTOs form the REST contract boundary. Querydsl/JPA configuration supports custom query implementations. Global exception handling maps domain failures to API errors; Swagger configuration provides API documentation.
• build.gradle
• src/main/resources/application.yaml
• src/main/java/com/codeit/hrbank/common/GlobalExceptionHandler.java
Main entry points: HrBankApplication.java Spring Boot application · application.yaml JPA persistence · EmployeeService.java Employee service · Dashboard.tsx Dashboard page
Components 21
React Frontend
- Vite entry
frontend/src/main.tsx - App layout & navigation
frontend/src/components/layout/Layout.tsx - Dashboard page · Representative of dashboard, employee, department, attendance, history, and backup pages.
frontend/src/pages/Dashboard.tsx - HTTP client
frontend/src/api/client.ts - Employee API adapter
frontend/src/api/employee/employeeApi.ts - Employee store · Coordinates lists, filtering, pagination, mutations, and feedback.
frontend/src/store/employeeStore.ts - History store
frontend/src/store/historyStore.ts
Spring REST API
- Spring Boot application · Serves REST endpoints and the built frontend.
src/main/java/com/codeit/hrbank/HrBankApplication.java - Employee REST controller
src/main/java/com/codeit/hrbank/employee/controller/EmployeeController.java - Attendance REST controller
src/main/java/com/codeit/hrbank/attendance/controller/AttendanceController.java - Global exception handler
src/main/java/com/codeit/hrbank/common/GlobalExceptionHandler.java
Domain Services
- Employee service · Manages employee records, departments, and status changes.
src/main/java/com/codeit/hrbank/employee/service/EmployeeService.java - Department service
src/main/java/com/codeit/hrbank/department/service/DepartmentServiceImpl.java - Change-log service · Provides cursor-paged change history and detailed diffs.
src/main/java/com/codeit/hrbank/changelog/service/ChangeLogServiceImpl.java - Backup scheduler · Guards against concurrent backups.
src/main/java/com/codeit/hrbank/backup/scheduler/BackupScheduler.java - Backup history service · Creates backup history with progress and status.
src/main/java/com/codeit/hrbank/backup/service/BackupHistoryCreationService.java - Local file storage · Handles upload and download storage outside employee persistence.
src/main/java/com/codeit/hrbank/file/storage/LocalFileStorage.java
Persistence & Runtime
- Change-log custom queries · Implements richer cursor-paged history searches.
src/main/java/com/codeit/hrbank/changelog/repository/EmployeeChangeLogRepositoryCustomImpl.java - JPA persistence · Entities and Spring Data repositories persist domain records.
src/main/resources/application.yaml - Built frontend
src/main/resources/static/index.html - Gradle build · Builds the JVM service with Spring Web, Data JPA, and Querydsl support.
build.gradle
Connections 23
- Vite entry → App layout & navigation: boots
- App layout & navigation → Dashboard page: frames pages
- Dashboard page → Employee store: uses state
- Dashboard page → History store: uses state
- Employee store → Employee API adapter: loads and mutates
- Employee API adapter → HTTP client: uses
- History store → HTTP client: queries history
- HTTP client → Spring Boot application: REST requests
- Spring Boot application → Employee REST controller: routes
- Spring Boot application → Attendance REST controller: routes
- Spring Boot application → Global exception handler: maps failures
- Spring Boot application → Built frontend: serves
- Employee REST controller → Employee service: delegates
- Attendance REST controller → JPA persistence: persists attendance
- Employee service → Department service: resolves departments
- Employee service → JPA persistence: persists employees
- Employee service → Change-log service: records changes
- Change-log service → Change-log custom queries: searches
- Change-log custom queries → JPA persistence: queries
- Backup scheduler → Backup history service: triggers
- Backup history service → JPA persistence: records status
- Local file storage → JPA persistence: kept separate from
- Gradle build → Spring Boot application: builds and runs