This project is a Spring Boot REST API built using Clean Architecture principles.
It manages candidate recruitment workflows and demonstrates:
- Proper layered architecture
- DTO + MapStruct mapping
- Role-based access control
- Business logic separation
- Recruitment score calculation
- Candidate registration
- Update candidate details
- Soft delete support
- Pagination support
- Recruitment score calculation
- Role-based access control (ADMIN / USER)
- Candidate status management (APPLIED โ HIRED / REJECTED / SHORTLISTED)
- Clean Architecture implementation
- DTO + MapStruct mapping
- Interceptor-based authorization
- Swagger API documentation
| Category | Technology |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot 3.x |
| Build Tool | Gradle |
| Database | PostgreSQL |
| ORM | Spring Data JPA / Hibernate |
| Mapping | MapStruct |
| API Documentation | Springdoc OpenAPI (Swagger) |
| Boilerplate | Lombok |
| Architecture | Clean Architecture |
The project follows Clean Architecture:
Controller โ UseCase โ Domain โ Repository Interface
โ
Infrastructure (JPA)
- Core business models (
Candidate,CandidateStatus) - Repository interfaces
- Business logic (score calculation, status rules)
- Application workflows
- Database entities
- JPA repositories
- Persistence implementation
- REST Controllers
- DTOs
- Mappers
- Interceptors
- CRUD operations for candidates
- Pagination support for large datasets
- Recruitment score calculation system
- Soft delete using Hibernate
- Role-based authorization via interceptor
- Status workflow (APPLIED โ SHORTLISTED โ HIRED / REJECTED)
- DTO-based response handling
- MapStruct for object mapping
src
โโโ main
โโโ java
โโโ lk
โ โโโ practice
โ โโโ candidate_recruitment_tracker
โ โโโ domain
โ โ โโโ model
โ โ โ โโโ Candidate.java
โ โ โ โโโ CandidateStatus.java
โ โ โโโ repository
โ โ โโโ CandidateRepository.java
โ โ
โ โโโ infrastructure
โ โ โโโ config
โ โ โ โโโ BeanConfig.java
โ โ โ
โ โ โโโ persistence
โ โ โโโ persistenceMappers
โ โ โ โโโ CandidatePersistenceMapper.java
โ โ โโโ CandidateEntity.java
โ โ โโโ CandidateImpl.java
โ โ โโโ JpaCandidateRepository.java
โ โ
โ โโโ usecase
โ โ โโโ CandidateUseCase.java
โ โ โโโ CandidateUseCaseImpl.java
โ โ
โ โโโ web
โ โโโ config
โ โ โโโ WebConfig.java
โ โ
โ โโโ controllers
โ โ โโโ CandidateController.java
โ โ
โ โโโ DTOs
โ โ โโโ CandidateRequestDTO.java
โ โ โโโ CandidateResponseDTO.java
โ โ
โ โโโ interceptors
โ โ โโโ RoleBasedInterceptor.java
โ โ
โ โโโ webMappers
โ โโโ CandidateWebMapper.java
โ
โโโโโโโโโโโโโโโโโโโโ resources
โโโ static
โโโ templates
โโโ application.properties
โโโ example-application.properties
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | /api/v1/candidates/all?page=0&size=10 |
Get all candidates (paginated) | USER / ADMIN |
| POST | /api/v1/candidates/register |
Register a new candidate | USER / ADMIN |
| PUT | /api/v1/candidates/{id} |
Update candidate details | USER / ADMIN |
| DELETE | /api/v1/candidates/{id} |
Soft delete candidate | ADMIN ONLY |
| PUT | /api/v1/candidates/status/{id} |
Update candidate status | ADMIN ONLY |
| Header | Description |
|---|---|
X-User-Role |
User role (ADMIN or USER) |
Candidate score is calculated using:
- Experience points:
experience ร 10 - Salary penalty applied if salary > 500,000
Recruitment Score = (Experience ร 10) - Salary Penalty
Swagger UI:
http://localhost:5000/swagger-ui/index.html
OpenAPI JSON:
http://localhost:5000/v3/api-docs
{
"fullName": "John Doe",
"email": "john@example.com",
"experience": 3,
"appliedRole": "Software Engineer",
"expectedSalary": 600000
}{
"id": 1,
"fullName": "John Doe",
"email": "john@example.com",
"experience": 3,
"appliedRole": "Software Engineer",
"expectedSalary": 600000,
"status": "APPLIED",
"recruitmentScore": 30.0
}git clone https://github.com/your-username/candidate-recruitment-tracker.gitcd candidate-recruitment-tracker./gradlew bootRunhttp://localhost:5000/api/v1/candidates
Built as a Clean Architecture practice project to improve backend design skills using Spring Boot.
This project was created to practice:
- Clean Architecture
- REST API design
- Real-world backend structuring
- Scalable system design principles
This is a learning-focused project designed with real-world architecture patterns and can be extended into a production-grade system.