Employee Storage Service CodingChallenge

This is coding challenge that I developed to show you my coding and design skills, for example:

  1. Spring MVC

  2. Spring Security

  3. Integration with REST service using Java-RS client

  4. Spring Rest Service

  5. Spring Boot

  6. JPA

  7. Hibernate

  8. H2 database

  9. MockMvc

  10. Thymeleaf

  11. Java Script

Coding Challenge Requirements

Requirement Specification

Definition

We're building an employee storage service for companies.

A company admin needs to be able to:

  • create employee records for company,
  • view them in a list and detail view for company,
  • update the employee records and delete them for company,
  • find the average salary for the company

Your task is to build the backend for this service.

It should be a rest API that exposes the required endpoints.

The company data can either be autogenerated or configurable or dynamically created. (Up to you)

Nice to have 1: Build a frontend for the rest api

Nice to have 2: Use jvm based technologies

Data definition

  • Employee model

    • Name
    • Surname
    • email
    • address
    • salary
    • company id
  • Company model

    • Name

Delivery

A publicly available git repository with a README.md that explains how to compile, build and start the project.

My soulution

How run in IDE (Eclipse, Idea)

  1. Run "mvn clean install"

  2. Run Application.class in any Java IDE

How run using jar file and Spring Boot

  1. Run "mvn clean install"

  2. Run Application.class in codingchallenge-1.0-SNAPSHOT.jar, for example

    java -jar target/codingchallenge-1.0-SNAPSHOT.jar

See more info in Spring Boot documentation

How see result in web

Use following link: https://employee-storage-service.herokuapp.com/

Rest Service

https://employee-storage-service.herokuapp.com/rest/companies/1/employees (get) - show all employees for companies with id = 1 https://employee-storage-service.herokuapp.com/rest/companies/1 (get) - show information about company with id = 1, https://employee-storage-service.herokuapp.com/rest/companies (get) - show information about all companies, https://employee-storage-service.herokuapp.com/rest/companies/2/employees/1 (get) - show employee with id = 1 for company with id = 2, https://employee-storage-service.herokuapp.com/rest/companies/2/employees (post) - add new employee for company with id = 2, https://employee-storage-service.herokuapp.com/rest/companies/2/employees (put) - update employee for company with id = 2, https://employee-storage-service.herokuapp.com/rest/companies/2/employees (delete) - delete employee for company with id = 2,