For our purpose we will create web application for Libraries. You can choose whatever you want, but I think, that this case will allow me to create whole bunch of different interactions between users and application to show you in implementation.
To create application:
Open terminal
Go to designated directory, if you don't have one create it (in my case it is ~/Workspace/library)
Type jhipster
You will see JHipster generator like here:
Let's discuss available options, shall we? I will mark with italic font my options
Application Type: for simple project I don't really see need of creating microservices, as it makes development more complex with none value added. Choose Monolithic application
Base name of your application - How it will be visible in whole application, in README.md and so on. Type your application name
Default Java package name - It's pretty self-explanatory. Follow Java package naming conventions. Type your package name
Do you want to use the JHipster Registry to configure, monitor and scale your application? - The JHipster Registry is an Open Source tool used to manage your application at runtime. I often use it, but it is mandatory only on microservice based applications. In our simple case you probably don't need it. No
Which type of authentication would you like to use? - I choose JWT, because it is stateless, gives you more flexibility in further options (like unified mechanism for web application and mobile app). HTTP Session Authentication utilizes Spring Security and is pretty heavy. OAuth 2.0 is too complex to set up for our purpose. JWT authentication (stateless, with a token)
Which type of database would you like to use? - Pretty self-explanatory. I chose SQL. SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
** Which production database would you like to use?** - This is the database you will use with your “production” profile. For Oracle you would have to install Oracle Driver manually PostgreSQL
Which development database would you like to use? - This is the database you will use with your “development” profile. PostgreSQL
H2, running in-memory - easiest one, but your data will be deleted after application server restart.
H2, data stored on disk - easy as well, but you will not loose data after restart
Same database as in development - more complex to set up, but I highly recommend it. This will allow you to work on same environment on production and development. That approach results in lower amount of surprises on production environment.
Do you want to use the Spring cache abstraction? - This will have positive impact on application performance. I choose local cache, but really it is up to your preferences. Yes, with the Ehcache implementation (local cache, for a single node)
Do you want to use Hibernate 2nd level cache? - This appear only for SQL Applications. It will significantly boost your app performance. I highly recommend to use it. Y
Would you like to use Maven or Gradle for building the backend? - Gradle gives you more control over your application build, which is really important if you want do do something custom with your structure. Gradle also becomes standard in industry from couple years. Gradle
Which other technologies would you like to use? - Up to you. I chose Elasticsearch for search. To choose option mark it with space and hit enter after you will choose all interesting options. Elasticsearch
Which Framework would you like to use for the client? Choose Framework for your frontend. Both React and Angular Comes with TypeScript React
Would you like to enable SASS stylesheet preprocessor? Y
Would you like to enable internationalization support? - Choose Languages for your application. If you will hit N You will stay with English as default. I choose two languages with English as base, to show you how to handle this, but It's up to you. Y, English (primary), Polish (secondary)
Besides JUnit and Jest, which testing frameworks would you like to use? - Choose Frameworks you WILL use. It doesn't make sense to choose Protractor, when I know, that will not use it. I choose Gatling to test my app performance. Gatling
Would you like to install other generators from the JHipster Marketplace? - For this step Yeoman is mandatory. To see all options go to JHipster Marketplace No
Now JHipster will generate application, initialize its git repo, build front end. After finished operation you will see something like this:
You can successfully import application to your favorite IDE
Build & Run
To run your application set up Elasticsearch and Postgres. You can do it manually, but I use Docker for this purpose, so to run application, that it will be fully functional app:
Go to library directory
cd ~/Workspace/library
Type
docker-compose -f src/main/docker/elasticsearch.yml up -d
docker-compose -f src/main/docker/postgresql.yml up -d
./gradlew