• Stars
    star
    212
  • Rank 180,138 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is a sample application created with JHipster, using React

jhipsterSampleApplicationReact

This application was generated using JHipster 7.9.3, you can find documentation and help at https://www.jhipster.tech/documentation-archive/v7.9.3.

Project Structure

Node is required for generation and recommended for development. package.json is always generated for a better development experience with prettier, commit hooks, scripts and so on.

In the project root, JHipster generates configuration files for tools like git, prettier, eslint, husky, and others that are well known and you can find references in the web.

/src/* structure follows default Java structure.

  • .yo-rc.json - Yeoman configuration file JHipster configuration is stored in this file at generator-jhipster key. You may find generator-jhipster-* for specific blueprints configuration.

  • .yo-resolve (optional) - Yeoman conflict resolver Allows to use a specific action when conflicts are found skipping prompts for files that matches a pattern. Each line should match [pattern] [action] with pattern been a Minimatch pattern and action been one of skip (default if ommited) or force. Lines starting with # are considered comments and are ignored.

  • .jhipster/*.json - JHipster entity configuration files

  • npmw - wrapper to use locally installed npm. JHipster installs Node and npm locally using the build tool by default. This wrapper makes sure npm is installed locally and uses it avoiding some differences different versions can cause. By using ./npmw instead of the traditional npm you can configure a Node-less environment to develop or test your application.

  • /src/main/docker - Docker configurations for the application and services that the application depends on

Development

Before you can build this project, you must install and configure the following dependencies on your machine:

  1. Node.js: We use Node to run a development web server and build the project. Depending on your system, you can install Node either from source or as a pre-packaged bundle.

After installing Node, you should be able to run the following command to install development tools. You will only need to run this command when dependencies change in package.json.

npm install

We use npm scripts and Webpack as our build system.

Run the following commands in two separate terminals to create a blissful development experience where your browser auto-refreshes when files change on your hard drive.

./mvnw
npm start

Npm is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by specifying a newer version in package.json. You can also run npm update and npm install to manage dependencies. Add the help flag on any command to see how you can use it. For example, npm help update.

The npm run command will list all of the scripts available to run for this project.

PWA Support

JHipster ships with PWA (Progressive Web App) support, and it's turned off by default. One of the main components of a PWA is a service worker.

The service worker initialization code is commented out by default. To enable it, uncomment the following code in src/main/webapp/index.html:

<script>
  if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('./service-worker.js').then(function () {
      console.log('Service Worker Registered');
    });
  }
</script>

Note: Workbox powers JHipster's service worker. It dynamically generates the service-worker.js file.

Managing dependencies

For example, to add Leaflet library as a runtime dependency of your application, you would run following command:

npm install --save --save-exact leaflet

To benefit from TypeScript type definitions from DefinitelyTyped repository in development, you would run following command:

npm install --save-dev --save-exact @types/leaflet

Then you would import the JS and CSS files specified in library's installation instructions so that Webpack knows about them: Note: There are still a few other things remaining to do for Leaflet that we won't detail here.

For further instructions on how to develop with JHipster, have a look at Using JHipster in development.

JHipster Control Center

JHipster Control Center can help you manage and control your application(s). You can start a local control center server (accessible on http://localhost:7419) with:

docker-compose -f src/main/docker/jhipster-control-center.yml up

Building for production

Packaging as jar

To build the final jar and optimize the jhipsterSampleApplicationReact application for production, run:

./mvnw -Pprod clean verify

This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files. To ensure everything worked, run:

java -jar target/*.jar

Then navigate to http://localhost:8080 in your browser.

Refer to Using JHipster in production for more details.

Packaging as war

To package your application as a war in order to deploy it to an application server, run:

./mvnw -Pprod,war clean verify

Testing

To launch your application's tests, run:

./mvnw verify

Client tests

Unit tests are run by Jest. They're located in src/test/javascript/ and can be run with:

npm test

UI end-to-end tests are powered by Cypress. They're located in src/test/javascript/cypress and can be run by starting Spring Boot in one terminal (./mvnw spring-boot:run) and running the tests (npm run e2e) in a second one.

Lighthouse audits

You can execute automated [lighthouse audits][https://developers.google.com/web/tools/lighthouse/] with [cypress audits][https://github.com/mfrachet/cypress-audit] by running npm run e2e:cypress:audits. You should only run the audits when your application is packaged with the production profile. The lighthouse report is created in target/cypress/lhreport.html

Other tests

Performance tests are run by Gatling and written in Scala. They're located in src/test/gatling.

To use those tests, you must install Gatling from https://gatling.io/.

For more information, refer to the Running tests page.

Code quality

Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with:

docker-compose -f src/main/docker/sonar.yml up -d

Note: we have turned off authentication in src/main/docker/sonar.yml for out of the box experience while trying out SonarQube, for real use cases turn it back on.

You can run a Sonar analysis with using the sonar-scanner or by using the maven plugin.

Then, run a Sonar analysis:

./mvnw -Pprod clean verify sonar:sonar

If you need to re-run the Sonar phase, please be sure to specify at least the initialize phase since Sonar properties are loaded from the sonar-project.properties file.

./mvnw initialize sonar:sonar

For more information, refer to the Code quality page.

Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the src/main/docker folder to launch required third party services.

For example, to start a mysql database in a docker container, run:

docker-compose -f src/main/docker/mysql.yml up -d

To stop it and remove the container, run:

docker-compose -f src/main/docker/mysql.yml down

You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running:

npm run java:docker

Or build a arm64 docker image when using an arm64 processor os like MacOS with M1 processor family running:

npm run java:docker:arm64

Then run:

docker-compose -f src/main/docker/app.yml up -d

When running Docker Desktop on MacOS Big Sur or later, consider enabling experimental Use the new Virtualization framework for better processing performance (disk access performance is worse).

For more information refer to Using Docker and Docker-Compose, this page also contains information on the docker-compose sub-generator (jhipster docker-compose), which is able to generate docker configurations for one or several JHipster applications.

Continuous Integration (optional)

To configure CI for your project, run the ci-cd sub-generator (jhipster ci-cd), this will let you generate configuration files for a number of Continuous Integration systems. Consult the Setting up Continuous Integration page for more information.

More Repositories

1

generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
TypeScript
21,203
star
2

jhipster-sample-app

This is a sample application created with JHipster
TypeScript
1,338
star
3

prettier-java

Prettier Java Plugin
Java
1,029
star
4

jhipster-registry

JHipster Registry, based on Spring Cloud Netflix Eureka and Spring Cloud Config
TypeScript
693
star
5

jhipster-kotlin

Kotlin based JHipster
Kotlin
445
star
6

jhipster-lite

JHipster Lite ⚡ is a development platform to generate, develop & deploy modern web applications & microservices architecture, step by step - using Hexagonal Architecture 💎
Java
413
star
7

jhipster

DEPRECATED: use https://github.com/jhipster/jhipster-bom instead
Java
409
star
8

jdl-studio

JDL Studio is an online JHipster Domain Language visual editor
TypeScript
403
star
9

jhipster-core

JHipster Domain Language, used by JHipster UML and JDL-Studio to generate entities
JavaScript
344
star
10

jhipster.github.io

Public website for JHipster - generates https://www.jhipster.tech
JavaScript
342
star
11

jhipster-dotnetcore

JHipster.NET blueprint
EJS
305
star
12

jhipster-vuejs

A Vue.js blueprint for JHipster. It will use Vue.js as the frontend library!
TypeScript
300
star
13

generator-jhipster-react-native

A React Native blueprint for JHipster
EJS
259
star
14

jhipster-uml

UML support for JHipster
JavaScript
258
star
15

generator-jhipster-nodejs

A NodeJS blueprint that creates the backend using NestJS
EJS
248
star
16

jhipster-console

JHipster monitoring & alerting console, based on ELK
Go
226
star
17

jdl-samples

Sample JDL files
215
star
18

jhipster-online

JHipster Online lets you generate your JHipster projects through a user friendly web interface.
Java
201
star
19

jhipster-devbox

JHipster virtualized development box
Shell
200
star
20

generator-jhipster-ionic

Ionic for JHipster ✨
TypeScript
186
star
21

jhipster-guides

Guides to help you learn JHipster quickly
Shell
177
star
22

generator-jhipster-quarkus

Quarkus blueprint for JHipster
EJS
135
star
23

generator-jhipster-entity-audit

JHipster module to enable entity audit and audit log page
EJS
127
star
24

jhipster-ide

An IDE for the JHipster Domain Language
Xtend
124
star
25

ng-jhipster

JHipster Angular library
TypeScript
123
star
26

generator-jhipster-micronaut

Micronaut blueprint for JHipster
EJS
98
star
27

jhipster-sample-app-ng2

DEPRECATED now that Angular 2+ is the default - This is a sample application created with JHipster, using Angular 2
Java
95
star
28

jhipster-sample-app-vuejs

This is a sample application created with JHipster, with the Vue.js blueprint
Java
91
star
29

react-jhipster

JHipster React library
TypeScript
82
star
30

webflux-jhipster

HTML
69
star
31

jhipster-bom

JHipster BOM and server-side library
Java
68
star
32

generator-jhipster-svelte

Generate Svelte powered JHipster web applications
EJS
61
star
33

jhipster-control-center

Manage your JHipster applications from a single place
TypeScript
59
star
34

jhipster-docker

DO NOT USE - DEPRECATED REPO - Old jdubois/jhipster Docker image, replaced by https://hub.docker.com/r/jhipster/jhipster/
59
star
35

jhipster-loaded

DEPRECATED - Java Agent used by JHipster to hot-reload Java classes
Java
51
star
36

jhipster-sample-app-microservice

This is a sample application created with JHipster, with the Microservice type
Java
50
star
37

jhipster-sample-app-oauth2

This is a sample application created with JHipster, with the OAuth2 option
TypeScript
50
star
38

jhipster-net-sample-app-template

JHipster.NET sample application
C#
49
star
39

jhipster-experimental-microservices

DON'T USE THIS - old experimental repository
Java
45
star
40

jhipster-sample-app-gradle

This is a sample application created with JHipster, with the Gradle option
TypeScript
43
star
41

generator-jhipster-module

DEPRECATED: use https://github.com/jhipster/generator-jhipster instead
EJS
43
star
42

generator-jhipster-native

JavaScript
41
star
43

jhipster-oh-my-zsh-plugin

JHipster plugin for oh-my-zsh
Shell
39
star
44

jhipster-sample-app-elasticsearch

This is a sample application created with JHipster, using ElasticSearch
TypeScript
39
star
45

jhipster-sample-app-dotnetcore

This is a sample .NET application created with the JHipster .NET blueprint
TypeScript
39
star
46

jhipster-sample-app-nodejs

This is a sample application created with NodeJS JHipster Official Blueprint (NHipster)
TypeScript
38
star
47

jhipster-sample-app-gateway

This is a sample application created with JHipster, with the Gateway type
TypeScript
37
star
48

generator-jhipster-blueprint

DEPRECATED: use https://github.com/jhipster/generator-jhipster instead
JavaScript
35
star
49

jhipster-app

The JHipster App lives in the menu bar, and helps running the most usual JHipster tasks
JavaScript
33
star
50

cn

中文官方版本, 由社区维护
JavaScript
30
star
51

consul-config-loader

A small docker based tool to load Spring Boot property files into Consul's K/V Store
Shell
29
star
52

jhipster-sample-app-quarkus

JHipster on Quarkus
TypeScript
27
star
53

jhipster-sample-app-mongodb

This is a sample application created with JHipster, with the MongoDB option
TypeScript
26
star
54

devoxx-2016

Code developed live during Devoxx 2016: video is at https://www.youtube.com/watch?v=dzdjP3CPOCs and slides are at http://www.slideshare.net/julien.dubois/devoxx-being-productive-with-jhipster
Java
25
star
55

chevrotain-java

A javascript based java parser based on chevrotain
JavaScript
25
star
56

jhipster-sample-app-hazelcast

This is a sample application created with JHipster, with the Hazelcast option
TypeScript
24
star
57

jhipster-sample-app-websocket

This is a sample application created with JHipster, with the Websocket option
TypeScript
24
star
58

jhipster-sample-app-micronaut

[WORK IN PROGRESS] JHipster on Micronaut
Java
23
star
59

jhipster-sample-app-token

DEPRECATED as JWT is now the default option - this is a sample application created with JHipster, with the JWT authentication option
Java
22
star
60

jhipster-sample-app-dto

This is a sample application created with JHipster, using DTOs
TypeScript
21
star
61

jhipster-go

GoHipster: A JHipster blueprint that will provide Golang as the server side language
JavaScript
20
star
62

jhipster-artwork

All artwork related to JHipster
18
star
63

jhipster-registry-sample-config

Sample Spring Cloud Config repository for the JHipster Registry
18
star
64

jhipster-dashboard

Hystrix dashboard for JHipster microservices architecture
Shell
16
star
65

jhipster-bot

Bot for creating JHipster applications
JavaScript
15
star
66

jhipster-sample-app-kotlin

This is a sample application created with JHipster, with the Kotlin blueprint
Kotlin
14
star
67

jhipster-docker-hub

docker-compose files using images from JHipster organization at Docker Hub
Shell
14
star
68

jhipster-sample-app-cassandra

This is a sample application created with JHipster, with the Cassandra option
TypeScript
13
star
69

jhipster-openid-connect

WORK IN PROGRESS - DO NOT USE YET - JHipster OpenID Connect server, based on CloudFoundry UAA
13
star
70

jhipster-operator

Java
12
star
71

jhipster-ansible

Ansible role for managing releases
HTML
12
star
72

generator-jhipster-docker-compose

DO NOT USE THIS REPO - it's now a sub-generator in the main generator-jhipster project
JavaScript
12
star
73

jhipster-sample-app-svelte

This is a sample application created with JHipster Svelte blueprint
Java
10
star
74

jhipster-automated-samples

Automatically generate the JHipster sample applications
Shell
10
star
75

jhipster-sample-app-nodejs-oauth2

This is a sample application created with NodeJS JHipster Official Blueprint (NHipster), with OAuth2 and the React option
TypeScript
9
star
76

jhipster-dependencies

DEPRECATED - Maven BOM for all JHipster projects
Shell
9
star
77

jhipster-lite-sample-app

This is a sample application created with JHipster Lite
Java
9
star
78

generator-jhipster-jooq

JHipster blueprint for jOOQ support
JavaScript
8
star
79

jhipster-fisher-plugin

A fisher plug-in for JHipster
Shell
8
star
80

jhipster-neo4j-app

Sample JHipster application forked to use Neo4J
Java
8
star
81

eslint-config-jhipster

JavaScript
8
star
82

jhipster-sample-app-ng1

DEPRECATED as AngularJS 1.X support is removed in JHipster 5 - This is a sample application created with JHipster, using AngularJS 1.x
Java
8
star
83

jhipster-net

Core library for JHipster.NET
C#
7
star
84

jhipster-dotnet

C#
7
star
85

jhipster-sample-app-java7

DEPRECATED as Java 7 is deprecated on JHipster
Java
7
star
86

jhipster-php

[work in progress] PHP implementation for JHipster
Java
7
star
87

hipslacker

A Slack bot for JHipster
Python
7
star
88

jhipster-ci-stack

DO NOT USE - UNDER DEVELOPMENT Official Docker continuous integration agent image
7
star
89

jhipster-sample-app-nocache

This is a sample application created with JHipster, without using a 2nd level cache
TypeScript
6
star
90

jhipster-registry-buildpack

A buildpack for the JHipster Registry
Shell
5
star
91

jhipster-sample-app-couchbase

This is a sample application created with JHipster, with the Couchbase option
TypeScript
4
star
92

jhipster-sample-app-blazor

Blazor front-end for JHipster .NET Core
C#
4
star
93

jhipster-code

Website for JHipster Code
JavaScript
4
star
94

jhipster-sample-app-noi18n

This is a sample application created with JHipster, without using i18n
TypeScript
4
star
95

documentation-archive

Archive for old JHipster documentation
HTML
3
star
96

jhipster-sample-app-golang

A sample application for go blueprint
3
star
97

jhipster-sample-app-nodejs-vuejs

This is a sample application created with NodeJS JHipster Official Blueprint (NHipster), with MongoDB and the Vue.js option
TypeScript
3
star
98

.github

Maintains all of the default policies for the JHipster organization
2
star
99

jhipster-sample-application

Java
2
star
100

jhipster-base

Shared data between JHipster dependent modules such like JH Core and JH IDE
Shell
2
star