JHipster

Develop and Deploy Microservices With JHipster

Description
Repository : https://github.com/masteringjhipster

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= TODO
 * 1) install NodeJS and NPM

TODO
 * 1) install Yarn

TODO
 * 1) install Yeoman

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

yarn install yarn global add gulp-cli

./mvnw
 * 1) start the demo app

gulp
 * 1) start gulp for relaunch the update

open http://localhost:9001/#/ open http://localhost:8080
 * 1) open the browsers

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

=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

yarn install
 * 1) install the dependencies

./mvnw
 * 1) start the demo app

gulp
 * 1) start gulp for relaunch the update

open http://localhost:9001/#/ open http://localhost:8080
 * 1) open the browsers

=Update the generated application=

Update the generated application with the following JDL document. DEFAULT_MIN = 1 DEFAULT_MAX = 3

/** * This is a project to track * @author Didier */ entity Project { name String required minlength(6) pattern("^[-_ a-zA-Z0-9]*$") }

/** * This is a label for tagging the projects * @author Didier */ entity Label { /**	* The name of the label */	label String required minlength(3) }

entity Ticket { /**       * The title of the ticket */	title String required, description String, priority Integer min(DEFAULT_MIN) max(DEFAULT_MAX) 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} }

dto * with mapstruct angularSuffix * with bt paginate Ticket with pagination

=Code review=
 * 1) Import the Maven project into your favorite IDE (Eclipse for me ;-)
 * 2) (Optional) Install Angular IDE plugin into your (Eclipse) IDE.
 * 3) Browse src/main/java for looking the Java code of the generated Spring backend
 * 4) Browse src/main/resources for looking the default resources of the generated Spring backend
 * 5) Browse src/main/webapp for looking the HTML and TypeScript code of the generated Anjular 2 frontend
 * 6) Browse src/main/docker for looking the Dockerfiles of the application containers

Screenshot Angular 2 part

Screenshot Spring

Screenshot Spring

Screenshot Docker

=Add a new module from the Marketplace= Choose a module to install into the Marketplace (for instance, OSM maps with Leaflet).

npm install -g generator-jhipster-leaflet yo jhipster-leaflet

=More= From
 * http://www.21-points.com/#/about
 * http://www.jhipster-book.com/#!/

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

./gradlew
 * 1) start the demo app