Giter VIP home page Giter VIP logo

employee-portal's Introduction

employee-portal

A convenient web-application developed using Spring Boot 2.2.0 and H2 database that essentially exposes two REST services - one to register an employee and another to fetch the list of all employees.
While registering an employee, the Gender can be either MALE or FEMALE and Department can be either IT,HR or FINANCE.
The listing of employees API is pageable and can be sorted in ascending order by the first name and last name of employees. By default, it fetches the first page with max 10 records sorted by first name.

Prerequisite softwares to run the application

Git, JDK 1.8, Maven 3.6.3

Steps to run the application

  1. Download the codebase from github repository.
  2. Change to directory "employee-portal"
  3. Optional - Change to directory employee-portal/config and update the properties in application-local.properties, if required. Sensitive properties like username/password are jasypt encrypted and mentioned like ENC(XXXXXXXXX).
  4. Change to "employee-portal" directory and run the following command from terminal:
    • mvn clean install (This will also run the test cases). This should ensure a jar file created in employee-portal/target/employee-portal-1.0.0.jar
  5. Command to execute the jar as background process from terminal:
    • java -Dspring.config.location=[PATH-TO_CONFIG-DIRECTORY] -Dspring.profiles.active=local -Djasypt.encryptor.password=[JASYPT-ENCRYPTOR-PASSWORD] -Xmx1024m -jar employee-portal-1.0.0.jar > employee-portal.log &
      E.g. PATH-TO-CONFIG-DIRECTORY=/opt/applications/employee-portal/config/
      JASYPT-ENCRYPTOR-PASSWORD=samplestring

Testing the REST APIs

  1. Once the server starts in port 8080 (default), we can start testing the REST APIs. By default all APIs are secured with Basic Authentication and username/password is required to be provided while calling them.
    • We need to go to the following link from browser to test the registration and listing of all employee REST APIs - http://localhost:8080/swagger-ui.html and provide the Basic Authentication username & password.
    • We need to test the actuator endpoints from POSTMAN: E.g. GET http://localhost:8080/actuator/health and provide the Basic Authentication username & password while calling the APIs. Note: Actuator endpoints doesn't show up correctly in Swagger UI and therefore not exposed through the same.

Scope of Improvement of the solution

  1. Dockerizing the application to make it cloud native and scaling instances easily.
  2. Moving to JWT based authentication instead of simple Basic authentication.
  3. Configuring nginx for reverse-proxy and load-balancing. Also TLS should be implemented in nginx to secure the communication.
  4. Configuring logback for logging in console/file and log rotation.

employee-portal's People

Contributors

sayanb19 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.