forked from jhipster/jhipster.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
creating_an_app.html
executable file
·99 lines (80 loc) · 5.28 KB
/
creating_an_app.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
layout: default
title: Creating an application
sitemap:
priority: 0.7
lastmod: 2014-06-02T00:00:00-00:00
---
<h1><i class="fa fa-rocket"></i> Creating an application</h1>
<i><b>Please check our <a href="{{ site.url }}/video_tutorial.html">video tutorial</a> on creating a new JHipster application!</b></i>
<h2>Generating an application quickly</h2>
<p>To generate your application, type:</p>
<p>
<code>
yo jhipster
</code>
</p>
<p>And answer the questions asked by the generator to create an application taylored to your needs. Those options are described in the next section.</p>
<p>Once the application is generated, you can launch the Java server within your IDE, by running the Application class at the root of your application's Java package.</p>
<p>As it is a simple "Main" class, it is the easiest and quickest way to run and debug the application.</p>
<p>If you prefer to use Maven, you can also run your application by typing:</p>
<p>
<code>
mvn spring-boot:run
</code>
</p>
<p>The application will be available on <a href="http://localhost:8080" target="_blank">http://localhost:8080</a></p>
<h2>Options available when generating an application</h2>
<h3>What is the base name of your application?</h3>
<p>
This is the name of your application.
</p>
<h3>What is your default Java package name?</h3>
<p>
Your Java application will use this as its root package.
</p>
<h3>Do you want to use Java 8?</h3>
<p>
Depending on your choice, JHipster will either create a Java 7 or a Java 8 application. Java 8 comes with many new features, including lambdas, and having JHipster create some sample code is a great way to start using them.
</p>
<h3>Which *type* of authentication would you like to use?</h3>
<p>
You can either use a classical cookie-based authentication mechanism, like we are used to do in Java (this is how most people use <a href="http://docs.spring.io/spring-security/site/index.html" target="_blank">Spring Security</a>), or a OAuth2 authentication mechanism, which can allow you to build a stateless Web application (if you don't use your HTTP session anywhere else in your code).
</p>
<h3>Which *type* of database would you like to use?</h3>
<p>
You can choose between a classical SQL database, which you will access with Spring Data JPA, or a NoSQL approach with <a href="http://www.mongodb.org" target="_blank">MongoDB</a>.
</p>
<h3>Which *production* database would you like to use?</h3>
<p>
This is the database you will use with your "production" profile. To configure it, please modify your <code>src/main/resources/config/application-prod.yml</code> file.
</p>
<h3>Which *development* database would you like to use?</h3>
<p>
This is the database you will use with your "development" profile. To configure it, please modify your <code>src/main/resources/config/application-dev.yml</code> file.
</p>
<h3>Do you want to use Hibernate 2nd level cache?</h3>
<p>
<a href="http://hibernate.org/" target="_blank">Hibernate</a> is the JPA provider used by JHipster. For performance reasons, we highly recommend you to use a cache, and to tune it according to your application's needs.<br/>
If you choose to do so, you can use either <a href="http://ehcache.org/" target="_blank">ehcache</a> (local cache) or <a href="http://www.hazelcast.com/" target="_blank">Hazelcast</a> (distributed cache, for use in a clustered environnement)
</p>
<h3>Do you want to use clustered HTTP sessions?</h3>
<p>
By default, JHipster uses a HTTP session only for storing <a href="http://docs.spring.io/spring-security/site/index.html" target="_blank">Spring Security</a>'s authentication and autorisations information. Of course, you can choose to put more data in your HTTP sessions.<br/>Using HTTP sessions will cause issues if you are running in a cluster, especially if you don't use a load balancer with "sticky sessions".<br/>If you want to replicate your sessions inside your cluster, choose this option to have <a href="http://www.hazelcast.com/" target="_blank">Hazelcast</a> configured.
</p>
<h3>Do you want to use WebSockets?</h3>
<p>
Websockets can be enabled using the <a href="http://async-io.org/" target="_blank">Atmosphere framework</a>. We also provide a complete sample to show you how to use the framework efficiently.
</p>
<h3>Would you like to use Maven or Gradle?</h3>
<p>
You can build your generated Java application either with <a href="http://maven.apache.org/" target="_blank">Maven</a> or <a href="http://www.gradle.org/" target="_blank">Gradle</a>. Maven is more stable and more mature, and is our recommended choice if you don't know which option to take. Gradle is more flexible, easier to extend, and more hype.
</p>
<h3>Would you like to use Grunt or Gulp.js for building the frontend?</h3>
<p>
<a href="http://gruntjs.com/" target="_blank">Grunt</a> is the most widely used and most mature build tool for your JavaScript and CSS assets. <a href="http://www.gulpjs.com" target="_blank">Gulp.js</a> is a more recent alternative, which is easier to use and learn.
</p>
<h3>Would you like to use the Compass CSS Authoring Framework?</h3>
<p>
<a href="http://compass-style.org/" target="_blank">Compass</a> / Sass is a great solution to simplify designing CSS. To be used efficiently, you will need to run a <a href="http://gruntjs.com/" target="_blank">Grunt</a> server, which will be configured automatically.
</p>