Skip to content

Java App : A RESTful API for a Human Resources (HR) system. This application is a backend service for managing employee records, built with Spring Boot, Spring Data JPA, and Lombok. It follows a clean layered architecture, demonstrates robust RESTful exception handling, and is designed to be consumed by a modern frontend application.

Notifications You must be signed in to change notification settings

Litti8/Java-human-resources-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HR System REST API

This is a RESTful API for a Human Resources (HR) system, developed as part of a personal Java challenge. It is designed as a backend service to manage employee records, providing a set of endpoints for standard CRUD operations.

Features

  • Create new employee records.
  • Read all employees or a single employee by their ID.
  • Update existing employee information.
  • Delete employee records.

Technologies Used

  • Spring Boot: The core framework for building the backend.
  • Spring Data JPA: For handling data persistence to a MySQL database.
  • Lombok: To reduce boilerplate code in model classes.
  • MySQL: The relational database used for data storage.
  • Logback: For robust and configurable application logging.

How to Run Locally

1. Database Setup

First, you need to configure your database connection in the src/main/resources/application.properties file.

Properties

# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/human_resources_db?createDatabaseIfNotExist=true
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# JPA Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true

# Server port
server.port=8080

Make sure to replace your_username and your_password with your actual MySQL credentials. The database URL includes the parameter createDatabaseIfNotExist=true, which will create the database if it does not already exist.

2. Run the Application

Once the database is configured, you can run the application directly from your IDE by executing the HrApplication.java main class. Alternatively, you can use Maven:

mvn spring-boot:run

The API will be accessible at http://localhost:8080/hr-app.

API Endpoints

  • GET /hr-app/employees: Get a list of all employees.
  • POST /hr-app/employees: Add a new employee.
  • GET /hr-app/employees/{id}: Get a specific employee by their ID.
  • PUT /hr-app/employees/{id}: Update an existing employee by their ID.
  • DELETE /hr-app/employees/{id}: Delete an employee by their ID.

About

Java App : A RESTful API for a Human Resources (HR) system. This application is a backend service for managing employee records, built with Spring Boot, Spring Data JPA, and Lombok. It follows a clean layered architecture, demonstrates robust RESTful exception handling, and is designed to be consumed by a modern frontend application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages