Creating an application

After installing JHipster, the next step is to create an application. Create a project directory with an appropriate name in your local machine, select this directory from Command Prompt, and execute the following command. The name of the project directory is given as gdp, but it can be any valid name:

jhipster

Soon after hitting this command, JHipster will start to ask a series of questions, and will decide what has to be generated based on the answers given by the user, as follows:

  1. Which type of application would you like to create? There are four possible options to choose from, as follows:
    • Monolithic application: This option is used to create a self-contained application. This is the recommended option to create a simple application, so we will choose this option.
    • Microservice application: If you want to design an application based on a microservices architecture, you can choose this option.
    • Microservice gateway: The microservice gateway is used to build a microservice-based application with the UI. By default, microservice applications do not have a UI.
    • JHipster UAA server: JHipster supports creating applications with User Authentication and Authorization (UAA).
  1. What is the base name of your application? You need to give your application a name. By default, it takes the same name as the project directory. If you want, you can give it another name.
  2. What is your default Java package name? Next, you need to give a Java package name. You can give an appropriate name (it will be considered as a base package, and all other Java source files will be generated in their respective packages relative to this package).
  3. Do you want to use the JHipster Registry to configure, monitor, and scale your application? This question concerns using the JHipster Registry in our application. The registry is extensively used in microservice-based applications, for registering various services. For a monolithic application, we can still use it because although it is a kind of registry, it concerns the health of the application, which helps us to monitor the application. It comes as a Docker image. For simplicity, we are not going to use it, so choose No and go ahead. 
  1. Which type of authentication would you like to use? Next up is the authentication mechanism. It provides three options to choose from, as follows. We will select the third option (HTTP session authentication):
    1. JWT Authentication: JSON Web Token (JWT), which is an open standard for transmitting information between two parties in form of JSON. Authentication is the most common use case of JWT.
    2. OAuth2/OIDC Authentication: JHipster provides complete support for OAuth2 with Keycloak and OpenID Connect (OIDC), which is generated by default when we select this option. Keyclock is an open source identity brokering and access management solution. Open ID Connect (OIDC), which is a simple identity layer on top of the OAuth2 protocol.
    3. HTTP session authentication: This authenticates users based on sessions. This is the most commonly used option.
  1. Which type of database would you like to use? Next, it will ask the type of database, we would like to use in our application. JHipster supports various SQL databases. It also supports three NoSQL databases—MongoDB, Couchbase, and Cassandra, which has a Spring data backend. We will select SQL.
  1. Which production/development database would you like to use? You will be asked separate questions to select specific databases for production and development. JHipster maintains various profiles for various environments (such as development, production, and so on). It will configure the databases based on your selected options. In our case, we will select MySQL for both production and development.
  2. Do you want to use the Spring cache abstraction? Moving further, it will ask about the type of caching mechanism, such as Ehcache, Hazelcase, Memcached, or no cache at all; Spring cache abstraction will be used to plug any of them. We can select any of them, based on our particular business needs and the underlying hardware architecture (single node, multi-node, distributed, and so on). We will choose Ehcache (which is selected by default).
  3. Do you want to use Hibernate second level cache? Here, we have the option to use Hibernate's second-level cache. Select Yes for this option.
  1. Would you like to use Maven or Gradle for building the backend? You will be asked to choose either Maven or Gradle as a build tool. We will select Maven.
  1. Which other technologies would you like to use? Towards the end, JHipster will ask to add a few additional technologies, such as Elasticsearch, WebSocket, asynchronous messaging with Kafka, and API-first development with the OpenAPI generator. API-first is an approach to designing an application with the API first, and developing web or mobile applications on top of those APIs. Nowadays, many companies are adopting this approach, and JHipster supports it out of the box. To make the thing simple and straightforward, we will not select either of them. Since this is a multiple choice selector, you can just press Enter to move further without selecting any of them.
  2. Which Framework would you like to use for the client? The next question asks you to select a frontend framework, either Angular or React. Select Angular and press Enter.
  3. Would you like to enable Sass stylesheet preprocessor? Next, it will ask you whether to use the syntactically awesome style sheets (Sass) stylesheet preprocessor. Select Yes.
  1.  Would you like to enable internationalization support? If you wish to add support for internationalization, select a native language. Select English as an answer.
  2. Please choose additional languages to install: Along with your native language, you can add support for additional languages. JHipster supports around 30 languages. To make things simple, we will not add any additional language. 
  3. Besides JUnit and Jest, which testing frameworks would you like to use? You will be asked to select unit testing frameworks on this screen. JHipster supports the Gatling, Cucumber, and Protractor frameworks, as well as the default JUnit for unit testing. Select none of them and move to the next step.
  4. Would you like to install other generators from the JHipster Marketplace? The last question will ask you whether to add additional modules from the JHipster marketplace. This is a collection of third-party generators that work on top of the core JHipster, with access to its variables and functions and acts like sub-generators. You can use them in your application by downloading them from the JHipster Marketplace (https://www.jhipster.tech/modules/marketplace). We will select No for this option.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.181.52