Skip to content

Spring Boot Application, support data jpa and pageable and sorting result via Swagger.Demonstrate one of the best practices using mapstruct,flyway and etc.

License

Notifications You must be signed in to change notification settings

tejamadasu/spring-practices-demo

 
 

Repository files navigation

Java Standarts

Spring Docker Image CI codecov License: MIT

Integration with GitHub Actions

Spring Boot Practices Application

In this project is demonstrated main Java Spring concepts. Model view controller architecture, using mapstruct for objects mapping,flyway for database migration, JUNIT 5 configuration for test coverage,read and filter data from json file and return it like a response, basic CRUD operations.Also is demonstrated how to return a Pageable response which is easy to filter, sorting and etc.Created Global exception handler for handle exception from the codebase and custom spring validator(example with annotation for field and class level).Demo of how to use CriteriaBuilder for data retrieving.Added configuration for collecting application metrics via Spring Boot Actuator and configuration for Injecting Git Information Into Spring.

GitHub actions pipelines integration

Added integration with GitHub actions for code analyzis with sonarcloud and codecov for code coverage report
Added integration with Docker.On every push event to main branch this action generates a new docker image with the relevant image tag.

How to start the project

Provided examples with implementation on SpringBoot.Links for more info:

Branches:

  • Branch with name: "java11Version" is set up for JDK11
  • Main branch is with the newest spring boot 3.0.2 and JDK17

Git commit plugin response:

// 20221101225521
// http://localhost:8099/actuator/info

{
  "git": {
    "commit": {
      "message": {
        "short": "Merge branch 'main' into gitCommitPlugin"
      },
      "id": {
        "abbrev": "34078b6",
        "full": "34078b613c32ac9cf4f076b42232e3d9523aaeb7",
        "describe": "34078b6-dirty"
      },
      "time": "2022-11-01T18:59:21Z",
      "history": "https://github.com/alvelchev/spring-practices-demo/commit/4b36876"
    },
    "branch": "gitCommitPlugin",
    "build": {
      "time": "2022-11-01T20:53:58Z",
      "version": "0.0.1"
    }
  },
  "build": {
    "artifact": "springpageable",
    "name": "springpageable",
    "time": "2022-11-01T20:53:56.838Z",
    "version": "0.0.1",
    "group": "com.springpageable"
  }
}

About

Spring Boot Application, support data jpa and pageable and sorting result via Swagger.Demonstrate one of the best practices using mapstruct,flyway and etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.7%
  • Other 0.3%