Difference between revisions of "JHipster"

From air
Jump to navigation Jump to search
Line 1: Line 1:
 
[https://dzone.com/articles/develop-and-deploy-microservices-with-jhipster-1 Develop and Deploy Microservices With JHipster]
 
[https://dzone.com/articles/develop-and-deploy-microservices-with-jhipster-1 Develop and Deploy Microservices With JHipster]
   
  +
==Description==
   
  +
==JDL==
  +
JHipster Domain Language (http://www.jhipster.tech/jdl/) enables to describe the JHipster application (backend, frontend, microservice) for gen
  +
* Entities (User is a builtin entity)
  +
* Relationships between entities
  +
* Services
  +
* Pagination modes for listing the entities in the frontend.
   
  +
Example: [https://github.com/jhipster/jdl-samples/blob/master/bug-tracker.jh bug-tracker.jh]
  +
<pre>
  +
entity Project {
  +
name String
  +
}
  +
  +
entity Label {
  +
label String required minlength(3)
  +
}
  +
  +
entity Ticket {
  +
title String required,
  +
description String,
  +
dueDate LocalDate,
  +
done Boolean
  +
}
  +
  +
relationship ManyToMany {
  +
Ticket{label(label)} to Label{ticket}
  +
}
  +
  +
relationship ManyToOne {
  +
Ticket{project(name)} to Project
  +
}
  +
  +
relationship ManyToOne {
  +
Ticket{assignedTo(login)} to User{ticket}
  +
}
  +
  +
paginate Ticket with pagination
  +
</pre>
  +
  +
The type system is :
  +
* TODO
   
 
=Getting started=
 
=Getting started=

Revision as of 11:15, 7 September 2017

Develop and Deploy Microservices With JHipster

Description

JDL

JHipster Domain Language (http://www.jhipster.tech/jdl/) enables to describe the JHipster application (backend, frontend, microservice) for gen

  • Entities (User is a builtin entity)
  • Relationships between entities
  • Services
  • Pagination modes for listing the entities in the frontend.

Example: bug-tracker.jh

entity Project {
	name String
}

entity Label {
	label String required minlength(3)
}

entity Ticket {
	title String required,
	description String,
	dueDate LocalDate,
	done Boolean
}

relationship ManyToMany {
	Ticket{label(label)} to Label{ticket}
}

relationship ManyToOne {
	Ticket{project(name)} to Project
}

relationship ManyToOne {
	Ticket{assignedTo(login)} to User{ticket}
}

paginate Ticket with pagination

The type system is :

  • TODO

Getting started

# install NodeJS and NPM
TODO

# install Yarn 
TODO

# install Yeoman 
TODO

# install the demo app
git clone https://github.com/jhipster/jhipster-sample-app.git
cd jhipster-sample-app/

yarn install
yarn global add gulp-cli

# start the demo app
./mvnw


# start gulp for relaunch the update
gulp

# open the browsers
open http://localhost:9001/#/
open http://localhost:8080

# inspect the generation files used by jhispter-generator
more .jhipster/*.json

Generate an application (Bug Tracker)

Other schemes for application generation

git clone https://github.com/jhipster/jdl-samples.git
mkdir jhipster-bugtracker
cd jhipster-bugtracker
jhipster


? (1/16) Which *type* of application would you like to create? Monolithic applic
ation (recommended for simple projects)
? (2/16) What is the base name of your application? bugtracker
? (3/16) What is your default Java package name? example.bugtracker
? (4/16) Do you want to use the JHipster Registry to configure, monitor and scal
e your application? No
? (5/16) Which *type* of authentication would you like to use? JWT authenticatio
n (stateless, with a token)
? (6/16) Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB
, PostgreSQL, Oracle, MSSQL)
? (7/16) Which *production* database would you like to use? MySQL
? (8/16) Which *development* database would you like to use? H2 with disk-based 
persistence
? (9/16) Do you want to use Hibernate 2nd level cache? No
? (10/16) Would you like to use Maven or Gradle for building the backend? Maven
? (11/16) Which other technologies would you like to use? Social login (Google, 
Facebook, Twitter), Search engine using Elasticsearch, WebSockets using Spring W
ebsocket
? (12/16) Which *Framework* would you like to use for the client? Angular 4
? (13/16) Would you like to use the LibSass stylesheet preprocessor for your CSS
? Yes
? (14/16) Would you like to enable internationalization support? Yes
? Please choose the native language of the application French
? Please choose additional languages to install English
? (15/16) Besides JUnit and Karma, which testing frameworks would you like to us
e? Gatling, Cucumber, Protractor
? (16/16) Would you like to install other generators from the JHipster Marketpla
ce? No

jhipster import-jdl ../jdl-samples/bug-tracker.jh


# install the dependencies
yarn install


# start the demo app
./mvnw


# start gulp for relaunch the update
gulp

# open the browsers
open http://localhost:9001/#/
open http://localhost:8080


More

From


git clone https://github.com/mraible/21-points.git
cd 21-points
# install the dependencies
yarn install


# start the demo app
./gradlew