Skip to content

Yahan-Botheju/candidate-recruitment-tracker-RESTAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšก Candidate Recruitment Tracker System

Java Spring Boot Gradle PostgreSQL License


๐Ÿ“Œ Overview

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

๐Ÿ“Œ Features

  • 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

๐Ÿ› ๏ธ Tech Stack

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

๐Ÿ—๏ธ Architecture Overview

The project follows Clean Architecture:

Controller โ†’ UseCase โ†’ Domain โ†’ Repository Interface
                                 โ†“
                          Infrastructure (JPA)

๐Ÿ“‚ Layers Explanation

๐Ÿ“Œ Domain Layer

  • Core business models (Candidate, CandidateStatus)
  • Repository interfaces

๐Ÿ“Œ UseCase Layer

  • Business logic (score calculation, status rules)
  • Application workflows

๐Ÿ“Œ Infrastructure Layer

  • Database entities
  • JPA repositories
  • Persistence implementation

๐Ÿ“Œ Web Layer

  • REST Controllers
  • DTOs
  • Mappers
  • Interceptors

๐Ÿš€ Features in Detail

  • 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

๐Ÿ“‚ Project Structure

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

โš™๏ธ API Endpoints

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

๐Ÿ” Authorization

Header Description
X-User-Role User role (ADMIN or USER)

๐Ÿงฎ Recruitment Score Logic

Candidate score is calculated using:

  • Experience points: experience ร— 10
  • Salary penalty applied if salary > 500,000
Recruitment Score = (Experience ร— 10) - Salary Penalty

๐Ÿ“š API Documentation (Swagger)

Swagger UI:

http://localhost:5000/swagger-ui/index.html

OpenAPI JSON:

http://localhost:5000/v3/api-docs

๐Ÿ“ฅ Sample Request

{
  "fullName": "John Doe",
  "email": "john@example.com",
  "experience": 3,
  "appliedRole": "Software Engineer",
  "expectedSalary": 600000
}

๐Ÿ“ค Sample Response

{
  "id": 1,
  "fullName": "John Doe",
  "email": "john@example.com",
  "experience": 3,
  "appliedRole": "Software Engineer",
  "expectedSalary": 600000,
  "status": "APPLIED",
  "recruitmentScore": 30.0
}

โ–ถ๏ธ How to Run

1. Clone repository

git clone https://github.com/your-username/candidate-recruitment-tracker.git

2. Navigate to project

cd candidate-recruitment-tracker

3. Run application

./gradlew bootRun

4. Access API

http://localhost:5000/api/v1/candidates

๐Ÿ‘จโ€๐Ÿ’ป Author

Built as a Clean Architecture practice project to improve backend design skills using Spring Boot.


โญ Project Purpose

This project was created to practice:

  • Clean Architecture
  • REST API design
  • Real-world backend structuring
  • Scalable system design principles

๐Ÿ“Œ Note

This is a learning-focused project designed with real-world architecture patterns and can be extended into a production-grade system.

About

A Spring Boot REST API built with Clean Architecture to manage candidate recruitment, featuring role-based access control, DTO mapping, and recruitment score calculation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages