GithubHelp home page GithubHelp logo

devs-from-matrix / hexagonal-spring-boot-java Goto Github PK

View Code? Open in Web Editor NEW
3.0 5.0 5.0 338 KB

template for hexagonal architecture with spring boot framework

License: MIT License

Java 96.53% Gherkin 3.47%
hexagonal-architecture app-generator spring-boot open-jdk java

hexagonal-spring-boot-java's Introduction

hexagonal-spring-boot-java Build Status Codacy Badge

This project is a template reference for hexagonal spring boot. This repository is to be used by app-generator for scaffolding.

The keywords of the app-generators are the following

  • packagename - to rename the package names
  • artifactName - to rename the artifact id
  • Example - to rename class, variables

Use it with caution as these will be used by the app-generator to replace them with domain specific name in the scaffold code.

Pre-requisite

  • maven
  • open jdk 17

How to build ?

mvn clean install

How to build a docker image ?

cd bootstrap && mvn compile jib:dockerBuild

More information

How to start ?

cd bootstrap && mvn spring-boot:run

Formatting

This project uses git-code-format-maven-plugin for formatting the code per google style guide

How to format ?

mvn git-code-format:format-code

Validating

This project uses githook-maven-plugin which is a maven plugin to configure and install local git hooks by running set of commands during build.

Command to validate formatted code

mvn git-code-format:validate-code-format

Contribution guidelines

We are really glad you're reading this, because we need volunteer developers to help this project come to fruition.

Request you to please read our contribution guidelines

hexagonal-spring-boot-java's People

Contributors

anupbaranwal avatar dependabot-preview[bot] avatar dependabot[bot] avatar ganesh0479 avatar paul58914080 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hexagonal-spring-boot-java's Issues

[New Feature]: added coverage status

Is your feature request related to a problem? Please describe.
As a user of using a particular one needs to know what is the coverage the template is providing. Today we cannot see this information.

Describe the solution you'd like

  • Step 1: use jacoco to prepare the report
  • Step 2: publish the report to codecov

Describe alternatives you've considered

[New Feature] change from packageName to packagename

Is your feature request related to a problem? Please describe.
When we have `packageName' as the name of a package then its not a java standard because it should essentially be all lower case however we have used camelCase.

Describe the solution you'd like

Step 1: change from packageName to packagename in all the modules
Step 2: Update the README

[New Feature] use bootstrap module in acceptance

Is your feature request related to a problem? Please describe.
Currently the bootstrap module is not tested with acceptance test which means the configurations and application that we write is never tested

Describe the solution you'd like
It is better to add the dependency of bootstrap within acceptance test and get ride of extra configuration written
https://github.com/devs-from-matrix/hexagonal-spring-boot-java/blob/main/acceptance-test/src/test/java/packagename/ExampleE2EApplication.java

[New Feature] run mutation test using activation

Is your feature request related to a problem? Please describe.
Mutation test with pitest can take long time depending on the number of tests. This would slow down the ci\cd. A better way is to activate this execution conditionally

Describe the solution you'd like
Use a maven profile with activation

<profiles>
  <profile>
    <id>mutation-test</id>
    <activation>
      <property>
        <name>mutation.tests</name>
      </property>
    </activation>
    <build>
      <plugins>
        <plugin>
         <!-- pitest plugin here -->
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>

[New Feature] integration of liquibase

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
https://www.liquibase.org/

[New Feature] add mutation testing

Is your feature request related to a problem? Please describe.
Mutation testing is to help the tester develop effective tests or locate weaknesses in the test data used for the program or in sections of the code that are seldom or never accessed during execution. Mutation testing is a form of white-box testing. Currently we do not know the effectiveness of the tests.

Describe the solution you'd like
PIT is a state of the art mutation testing system, providing gold standard test coverage for Java and the jvm. It's fast, scalable and integrates with modern test and build tooling. More details about it at https://pitest.org/quickstart/maven/

Additional context
Aggregating multi-modules report https://pitest.org/aggregating_tests_across_modules/

[New Feature] integration of Envers

Is your feature request related to a problem? Please describe.

Database auditing means tracking and logging events related to persistent entities, or simply entity versioning. Today we do not have the means with this template to accomplish the same and with no audit or tracking we might end up loosing history

Describe the solution you'd like

Hibernate Envers project aimed to track data changes at the entity level with easy configurations in properties level and entity class level using annotations. The spring-data-envers project builds on top of Hibernate Envers and comes up as an extension of the Spring Data JPA project.

https://docs.spring.io/spring-data/envers/docs/2.5.2/reference/html/#reference

Describe alternatives you've considered

  • The pure JPA approach is the most basic and consists of using lifecycle callbacks. However, you are only allowed to modify the non-relationship state of an entity. This makes the @PreRemove callback useless for our purposes, as any settings you've made in the method will be deleted then along with the entity.
  • Envers is a mature auditing module provided by Hibernate. It is highly configurable and lacks the flaws of the pure JPA implementation. Thus, it allows us to audit the delete operation, as it logs into tables other than the entity's table.
  • The Spring Data JPA approach abstracts working with JPA callbacks and provides handy annotations for auditing properties. It's also ready for integration with Spring Security. The disadvantage is that it inherits the same flaws of the JPA approach, so the delete operation cannot be audited.

Additional context

https://denuwanhimangahettiarachchi.medium.com/maintain-the-data-versioning-info-with-spring-data-envers-42b6dfc19e27

[New Feature] migrate to reactive programming

Is your feature request related to a problem? Please describe.
Migrate the template to use reactive programming

Describe the solution you'd like
Use the following frameworks\libraries

  • spring-boot-starter-webflux

[New Feature] code needs to be auto formatted before commit for better readability

Is your feature request related to a problem? Please describe.
Each developer is using her or his own code formatter which is not standardised across the project. It is hard to read code when each have their own styles and also sometimes there are unnecessary commits just because of formatting.

Describe the solution you'd like
It would be very beneficial if we are able to format the code before committing and pushing the changes to the version control. Would be great if we are able to add the plugin git-code-format-maven-plugin which would format the code. Also, we would need to integrate with githook-maven-plugin with which we can ensure the formatter is invoked before we commit the changed.

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.