Skip to content

Latest commit

 

History

History
316 lines (210 loc) · 13.4 KB

README.md

File metadata and controls

316 lines (210 loc) · 13.4 KB

Job Search Portal


Java Maven Spring Boot BSD Clause 3


Overview

This project, named "Job Search Portal," is an enterprise-ready Spring Boot application designed for managing job listings efficiently. It provides a set of RESTful API endpoints that allow you to perform various operations on job listings, such as adding, retrieving, updating, and deleting job information.

Technologies Used

  • Framework: Spring Boot
  • Language: Java
  • Build Tool: Maven
  • Database: H2 in-memory database

Dependencies Used

This project makes use of several dependencies to facilitate various functionalities. Here is a list of the key dependencies along with their versions:

  • Spring Boot: Spring Boot

    • Description: Spring Boot is the core framework for building Java applications with minimal setup.
    • Version: 3.1.4
  • Spring Boot Starter Data JPA: Spring Boot Starter Data JPA

    • Description: Spring Boot starter for working with Java Persistence API (JPA) data sources.
    • Version: 3.1.4
  • Spring Boot Starter Validation: Spring Boot Starter Validation

    • Description: Spring Boot starter for adding validation support.
    • Version: 3.1.4
  • Spring Boot Starter Web: Spring Boot Starter Web

    • Description: Spring Boot starter for building web applications.
    • Version: 3.1.4
  • H2 Database: H2 Database

    • Description: H2 is an in-memory database used for data storage in this project.
    • Version: 1.4.200
  • Lombok: Lombok

    • Description: Lombok is used for generating boilerplate code like getters, setters, and constructors.
    • Version: 1.18.22
  • Springfox Swagger: Springfox Swagger

    • Description: Springfox Swagger is used for generating API documentation.
    • Version: 3.0.0
  • Jakarta Validation API: Jakarta Validation API

    • Description: Jakarta Validation API is used for validation in Jakarta EE applications.
    • Version: 5.0.0-M1

These dependencies are essential for various aspects of the Job Search Portal project, including database management, validation, API documentation, and more. Make sure to refer to the official documentation of each dependency for detailed information on how to use them effectively.

Data Validation in the Job Class

The Job class in our Job Search Portal model is equipped with comprehensive data validation to ensure the accuracy and consistency of job data. Here are the key points about the validations applied to the fields:

Job ID

  • Validation: No additional validation (handled by database auto-generation).
  • Description: The id field is auto-generated by the database and serves as a unique identifier for each job.

Title

  • Validation: None
  • Description: The title field does not have additional validation constraints.

Description

  • Validation: None
  • Description: The description field does not have additional validation constraints.

Location

  • Validation: None
  • Description: The location field does not have additional validation constraints.

Salary

  • Validation: Minimum salary value of 20,000.
  • Description: The salary field is validated to ensure it is greater than or equal to 20,000.

Company Email

  • Validation: Valid email format.
  • Description: The companyEmail field is validated to ensure it contains a valid email address.

Company Name

  • Validation: None
  • Description: The companyName field does not have additional validation constraints.

Employer Name

  • Validation: None
  • Description: The employerName field does not have additional validation constraints.

Job Type

  • Validation: None
  • Description: The jobType field is not subject to additional validation as it represents an enumeration of predefined job types.

Applied Date

  • Validation: @NotNull(message = "Date cannot be null"), @Past(message = "Date must be in the past")
  • Description: The appliedDate field is validated to ensure it is not null and represents the date when the job was applied. I

Additional Data Validation

  • Dynamic Default Values (applied_date): When creating a new job listing, the applied_date field is automatically set to the current date. This ensures that the applied date reflects when the job listing was added to the system.

  • Custom Validation: I have implemented custom validation to ensure that the appliedDate field adheres to a specific date format. It must be in the "yyyy-mm-dd" format to maintain consistency in date representation.

These validations ensure that user data is accurately captured and meets specified criteria, contributing to the reliability and integrity of our User Management System. Users can trust that their information is handled with care and precision.

These validations ensure that job data is accurately captured and meets specified criteria, contributing to the reliability and integrity of our Job Search Portal.

Data Flow

Controller

The Controller layer is responsible for handling incoming HTTP requests and delegating them to the appropriate services. It defines API endpoints for the following operations:

  1. Get All Jobs: GET /jobs
  2. Get Job by ID: GET /job/{jobID}
  3. Add a Job: POST /job
  4. Add Multiple Jobs: POST /jobs
  5. Update Salary by Job ID: PUT /job/{jobID}/salary/{salary}
  6. Update Location by Job ID: PUT /job/{jobID}/location/{location}
  7. Update Company Email by Job ID: PUT /job/{jobID}/email/{email}
  8. Remove Job by ID: DELETE /job/{jobID}
  9. Get All Jobs of the Same Type: GET /jobs/type/{jobType}
  10. Get All Jobs with Salary Greater Than or Equal to a Value: GET /jobs/salary/{salary}
  11. Get All Jobs from the Same Company: GET /jobs/company/{companyName}
  12. Remove All Jobs from the Same Company: DELETE /jobs/company/{companyName}
  13. Update Salaries of Jobs with the Same Type: PUT /jobs/type/{jobType}/updateSalaries
@RestController
public class JobController {
    @Autowired
    JobService jobService;

    // Define API endpoints for various job operations
    // ...
}

Services

The Services layer implements the core business logic, data processing, and interaction with the data repository. Key responsibilities include:

  • Validating input data.
  • Performing CRUD operations on job data.
  • Handling data transformations and interactions with the H2 in-memory database.
@Service
public class JobService {
    @Autowired
    IJobRepo i

JobRepo;

    // Implement methods for job operations
    // ...
}

Repository

The Repository layer manages data access to the H2 in-memory database. It handles database operations such as Create, Read, Update, and Delete (CRUD) for job data. Additionally, it may include data mapping and conversion between Java objects and database entities.

@Repository
public interface IJobRepo extends JpaRepository<Job, Long> {
    // Define custom query methods for job data access
    // ...
}

Database Design

The project's database design includes a table named "Jobs" with fields such as:

  • id (Job ID): A unique identifier for each job.
  • title (Title): The job title.
  • description (Description): A description of the job.
  • location (Location): The job location.
  • salary (Salary): The job salary.
  • companyEmail (Company Email): The email address of the company.
  • companyName (Company Name): The name of the company.
  • employerName (Employer Name): The name of the employer.
  • jobType (Job Type): An enumeration specifying the job type.

Jobs Table

Column Name Data Type Description
id LONG (Primary Key) Unique identifier for each job
title VARCHAR(255) Job title
description TEXT Job description
location VARCHAR(255) Job location
salary DOUBLE Job salary
companyEmail VARCHAR(255) Company email address
companyName VARCHAR(255) Company name
employerName VARCHAR(255) Employer name
jobType ENUM Job type (IT, HR, SALES, etc.)

The "Jobs" table stores job-related information, including job IDs, titles, descriptions, locations, salaries, company details, employer names, and job types.

This database design ensures data integrity and provides a structured approach to managing job information within the application.

Data Structures Used

The project utilizes the following data structures:

Job Class

The Job class defines the structure for job data and includes fields for job attributes such as title, description, location, salary, company details, employer name, and job type.

JobType Enum

The JobType enum enumerates the possible job types, such as IT, HR, SALES, MARKETING, FINANCE, OPERATIONS, and CUSTOMER_SUPPORT.

JpaRepository

The project uses the JpaRepository interface provided by Spring Data JPA to perform CRUD operations on job data.

ArrayList

The project utilizes the ArrayList data structure to store and manage lists of User objects in various parts of the application. ArrayList provides dynamic sizing and efficient element retrieval, making it suitable for storing user records and performing operations on them.

These data structures enable the application to organize and manipulate job data efficiently while maintaining data integrity.

Project Summary

The Job Search Portal project is an enterprise-ready Spring Boot application designed for efficient job listing management. It offers a set of RESTful API endpoints for various job-related operations, ensuring that job data is accurately captured and managed.

Key Technologies Used

  • Framework: Spring Boot
  • Language: Java
  • Build Tool: Maven
  • Database: H2 in-memory database

Data Flow

Controller

The Controller layer handles incoming HTTP requests and routes them to the appropriate services. It defines API endpoints for operations such as adding, retrieving, updating, and deleting job records.

Services

The Services layer implements core business logic and data processing, including input validation, CRUD operations on job data, and data transformations.

Repository

The Repository layer manages data access to the H2 in-memory database, performing Create, Read, Update, and Delete (CRUD) operations for job data.

Database Design

The project's database design includes a "Jobs" table with fields for storing job-related information.

Data Structures Used

  • Job Class: Defines the structure for job data, including job attributes and timestamps.
  • JobType Enum: Enumerates job types, such as IT, HR, SALES, MARKETING, FINANCE, OPERATIONS, and CUSTOMER_SUPPORT.
  • JpaRepository: Used for performing CRUD operations on job data.

Key Features

  • RESTful API endpoints for job management.
  • Comprehensive data validation for job attributes.
  • Clean code separation with a layered architecture (Controller, Services, Repository).
  • Interaction with the H2 in-memory database.
  • Enumeration for job types.

The Job Search Portal project serves as a practical example of Spring Boot application development, demonstrating best practices in API design and job data management. It offers a solid foundation for building and extending job search and management systems in various applications.

License

This project is licensed under the BSD 3-Clause License.

Acknowledgments

Thank you to the Spring Boot and Java communities for providing excellent tools and resources.

Contact

For questions or feedback, please contact Amit Ashok Swain.