News about JHipster Lite

593 views
Skip to first unread message

Pascal GRIMAUD

unread,
Jan 22, 2022, 4:59:25 AM1/22/22
to JHipster dev team
Hello team,

Some news about JHipster Lite, and more details on what has been done since september.
If you're not interested, you can stop reading here :-)

Pascal

TL;DR

History:

- I started the project at the beginning of september, after holidays
- In JHipster organization since december: https://github.com/jhipster/jhipster-lite
- I started it because I didn't manage to contribute easily to generator-jhipster
- I started it because of NubesGen, as I saw the code and in my opinion, it's far better, far easier to understand than what we have in generator-jhipster
- I'll be honest: I lost my motivation because of the complexity, all these options to maintain, all these options to test...
- an example: I wanted to improve the unit test of the Security part for OAuth2, but I needed to do it too for JWT, for Reactive, etc... so I gave up :-D
- I tried to propose the modulith approach but I failed
- it tooks me several nights to do it and I'm not happy with the final result (see the different comments in PRs)

Description:

- similar to generator-jhipster, JHipster Lite can be used to quick start your Spring Boot + Java projects
- the difference is: the generation needs to be done, step by step, like you would do when you do real code in company for your customer
- Java 17 is mandatory
- opinionated Hexagonal Architecture structure
- 100% coverage in the generated project

About the generator:

- the generator is coded in Java, and it generates Java code
  - JHipster Bom is at 69% :-/
  - JHipster Online 50% :-(
  - JHipster Control Center 35% :-((
- Mustache for templates
- Hexagonal Architecture too: each feature is in its own package, it means when you improve OAuth2 part, you don't need to worry about JWT, as it's completely separated

Negative point at the moment:

- you need to use swagger to generate your project, no front part yet
- few documentation, I'm focusing on adding features

Which features/options today?

Done:
- Init project
- Maven with Java 17
- Java base classes
- JaCoCo config for minimum coverage
- Sonar support
- Spring Boot
- Spring Boot MVC: Tomcat or Undertow
- Spring Security JWT, with Basic Auth
- Database: PostgreSQL or MySQL
- Liquibase
- Spring Boot actuator
- Spring Devtools
- Logging with AOP
- Logstash support
- Async configuration
- Spring Cache with Ehcache
- Springdoc
- Jib
- Spring Cloud Consul
- Spring Cloud Config

In WIP:
- use a web page instead of swagger, the front part will be with Vue3 + Hexagonal Architecture
- generate a front (will start with Vue 3)
- OAuth2
- Flyway
- User and Authority entities

Important part, which is not done yet:
- Gradle support
- Front part: Angular, React, maybe Svelte

Some stats:

- more than 60 stars, it's pretty cool :)
- 11 contributors, 2 womens
- already 7 releases, nearly 1 release per week

About Release:

- it took me 10sec to launch 1 single command and 3 minutes to write the Tweet, so, it's a total of 3min for a new release
- you can compare to generator-jhipster which took at least 4h or 5h, as it needs jhipster-bom, jhipster-registry, jhipster-control-center, react-jhipster, waiting Docker Hub, resync with generator-jhipster, jhipster.github.io, jhipster-online, all sample apps, jhipster-devbox, documentation-archive, etc...

About tests:

- JHipster Lite with mvn verify -> 1m45 with 100% coverage
- generator-test with npm test -> 14m33 outch...

How I tried to solve different problems:


Problem #1: too many generated files
- it solved as with this approach, the developer will generate only what he/she needs

Problem #2: hard to customize
- same answer, it solved as with the step by step approach, the user can choose what he/she needs and so can easily edit the generated code, which is really small
- for example: generate Spring Security JWT -> then edit this part. It's like 10 java classes
- another example: you can choose to not generate Security part and code it yourself

Problem #3: too many options
- strangely, with JHipster Lite, we don't care about having too much options (thanks to this architecture)
- each options is in its own context, its own package, and do not depend on other options
- the contributors can easily add new options, and if it doesn't work anymore or not well maintained, the API can be disabled or the package can be deleted and that's all, the option is gone

Problem #4: complex template
- with this architecture + mustache, no complex templates
- separated options / separated templates
- you can compare:
  - with genererator-jhipster: https://github.com/jhipster/generator-jhipster/blob/main/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs (no need to put the reactive part here, it's the same complexity)
- I don't care about having 2 SecurityConfiguration templates: 1 for JWT, 1 for OAuth2, as there are some common and specific parts
- this is done like this because the contributor who wants to improve OAuth2, doesn't need to care about the JWT

Problem #5: too many projects
- no external lib, mono repo, everything is in generated code
- see the release part, 3min to release JHipster Lite, at least 4h to release generator-jhipster

Problem #6: yeoman
- JHipster Lite is coded with pure Java (see the domain part, in Hexagonal Architecture)
- it does not depend on external frameworks, so it will be easy to migrate from Spring Boot to Quarkus, from Mustache to something else, if needed
- with this architecture, our "business / generator" codes do not depends on technology

What's next?

- I already did some small presentation to developers I worked with (some of them hate JHipster) and the opinion is the same: better approach, fit better to their needs
- I'm still convinced by this approach
- we could add later a CLI (using picocli), deploy this app like jhipster-online, use it as a Lambda function, build a native image etc
- if you need a demo or a presentation, I can schedule it with you

Have a nice day.
PS: sorry for my english, probably a lot of mistakes

Pierre Besson

unread,
Jan 22, 2022, 6:38:11 AM1/22/22
to Pascal GRIMAUD, JHipster dev team
Congrats Pascal for this incredible milestone. I really like the new approach of jhipster-lite of generating features in increments. I'm excited to join you as soon as I have more time to help on devops topics (deployment to cloud/docker/k8s).

I think this email is really complete and should be turned into a public blog post. Can you start a Google docs for proofreading and then you can post it on dev.to (medium is awful).

Best regards,
Pierre

--
You received this message because you are subscribed to the Google Groups "JHipster dev team" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jhipster-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jhipster-dev/CALUG8Vv2SbxHz-dHmV7foWT-eDO5T%2By54vrESp0iquSLT1mqyQ%40mail.gmail.com.

Deepu K Sasidharan

unread,
Jan 22, 2022, 8:54:30 AM1/22/22
to Pierre Besson, Pascal GRIMAUD, JHipster dev team

Frederik Hahne

unread,
Jan 22, 2022, 9:16:18 AM1/22/22
to Pascal GRIMAUD, JHipster dev team
Thanks Pascal for the detailed news. As already told you I will have a look at the Gradle part. It looks very promising.

Julien Dubois

unread,
Jan 22, 2022, 9:21:43 AM1/22/22
to Frederik Hahne, JHipster dev team, Pascal GRIMAUD
Pascal, this is awesome !

- Concerning the core architecture based on NubesGen: I like this so much more than Yeoman! Much faster, easier and testable. I’ve done many improvements recently, and will try to extract this in some way so that JHipster can benefit from this.
- Your e-mail should be more widely available : I hope you’re OK that I tweet a link to it.

--
Julien Dubois

Twitter: @juliendubois

Pascal GRIMAUD

unread,
Jan 22, 2022, 9:22:56 AM1/22/22
to Julien Dubois, Frederik Hahne, JHipster dev team
Sure, plz do it :-)

Sendil Kumar N

unread,
Jan 22, 2022, 10:00:27 AM1/22/22
to Pascal GRIMAUD, Julien Dubois, Frederik Hahne, JHipster dev team
This is amazing Pascal!! Great work! 

Vishal Mahajan

unread,
Jan 22, 2022, 2:06:12 PM1/22/22
to Sendil Kumar N, Pascal GRIMAUD, Julien Dubois, Frederik Hahne, JHipster dev team
That's great news. Let me know when ready to integrate the svelte frontend. Do you have a sample project on GitHub generated with all currently supported options?

Pascal GRIMAUD

unread,
Jan 22, 2022, 2:13:04 PM1/22/22
to Vishal Mahajan, Sendil Kumar N, Julien Dubois, Frederik Hahne, JHipster dev team
Not yet, I can do it manually if you want

I plan to do it automatically in the CI, at the same time than the release

Pascal GRIMAUD

unread,
Jan 23, 2022, 11:09:32 AM1/23/22
to Vishal Mahajan, Sendil Kumar N, Julien Dubois, Frederik Hahne, JHipster dev team
Here a sample project: https://github.com/pascalgrimaud/jhlite-sample-app
- start docker-compose postgresql database
- start application with ./mvnw spring-boot:run
no front yet :)

Cordialement,
Pascal Grimaud

Reply all
Reply to author
Forward
0 new messages