alvinsim / springboot-react-HR

A sample HR application built using Spring Boot and React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Springboot-React-HR Sample Application

Introduction

This project is a HR (Java RESTful Web Service) application written using Spring Boot (version 2.3.0.RELEASE).

Start-up the Application

Pre-requisite

To run this application, the below requirements need to be installed.

  • Java JDK (version 11)
  • Maven (version 3.6.3)

As this project uses Lombok in the entity models, it may be useful to install its IDE or text editor plugin/extension. You can refer to the Lombok website for details on how to do so.

Starting it up

As this project uses Maven, you can use the command mvnw spring-boot:run to start it up.

Once the application is up, you can start to access the database and also access the API documentation via Swagger, which will be discussed below.

Database

In this application, it uses a H2 embedded database and I have chosen to use this sample HR Database. The DDL script can be found in src/main/resources/schema.sql, whilst the data.sql in the same directory is used to pre-populate the data when the application boots up.

After the application starts up, the H2 console can be accessed via the http://localhost:8080/h2 URL and connect using the details as per the screen capture.

h2-console.png

Refer below for the database diagram.

db-diagram.png

API

When the application is up, you can view a list of API calls via Swagger at http://localhost:8080/swagger-ui.html.

These APIs return a JSON response in the JSend format. In the response, there are three keys:

status
success, fail or error.
data
The data returned in the response or NULL if there is no data.
message
Error message when processing the request or the request has invalid data.

Front-end client – React

Pre-requisite

To run this front-end client, the below requirements need to be installed.

  • Node (version 14.9.0)
  • Yarn (version 1.22.4)

Once the above are installed, run the yarn command to start installation of the needed libraries.

Starting up the client

Run yarn start to startup the client and lastly, open a web browser and use the address http://localhost:1234.

References

Below are the articles that I referred to when building this application from scratch.

Tasks [0%]

  • [ ] Employee listing page
  • [ ] View and update job details
  • [ ] Delete job
  • [ ] View and update employee details
  • [ ] Delete employee

About

A sample HR application built using Spring Boot and React

License:The Unlicense


Languages

Language:Java 82.8%Language:TypeScript 15.2%Language:JavaScript 1.2%Language:Less 0.5%Language:HTML 0.2%Language:Shell 0.1%