[![Build Status][github-actions-jhonline-image]][github-actions-url]
JHipster Online is a Web application that allows to generate JHipster applications without installing JHipster on your machine.
This is an Open Source project (Apache 2 license) that powers the https://start.jhipster.tech/ website.
You can use https://start.jhipster.tech/ for free, but if you find a bug or need a specific feature, you are welcome to contribute to the project. You can also choose to clone or fork the project, and have your own version that is hosted within your company.
JHipster Online works with a MySQL database, that is configured in the usual application-*.yml
Spring Boot configuration
files, using the standard spring.datasource
keys.
JHipster Online uses JWT to secure the application. For a production application, it is therefore mandatory that:
- The
jhipster.security.authentication.jwt.key
is configured, and that key is stored securely (not commited in your application's Git repository). We recommend to configure it as an environnement variable on your server, or in a specific Spring Bootapplication.yml
file that is stored in your application's folder on your production server (which is our configuration on the official JHipster Online website). - The application is only available through HTTPS. You can configure it using Spring Boot (please read the comments in the
application-prod.yml
file), or using an Apache 2 HTTP server with Let's Encrypt on front of your application (which is our configuration on the official JHipster Online website).
E-mails are used to validate users' e-mail addresses or to send "forgotten password" e-mails. They are disabled by default, but it might be a good idea to configure them once the application is in production.
To configure e-mail sending, you need to configure the jhipster.mail
keys (see JHipster common application properties),
and the Spring Boot standard spring.mail
keys.
When running the app with the dev
profile, make sure to start the development mail server with:
docker-compose -f src/main/docker/mailserver.yml up -d
You can view the mails sent by JHipster with the MailHog UI at http://localhost:8025.
GitHub is configured using the application.github
keys in the application-*.yml
configuration files.
JHipster Online can work on the public GitHub instance on https://github.com as well as any private instance of GitHub Enterprise that is configured inside your company.
JHipster Online has to be configured as an "OAuth App": create a jhipster
organization,
and go to that organization's "Settings > Developer Settings > OAuth Apps" to create a new "OAuth App" with
the required credentials. This will allow JHipster Online to create applications and pull requests on your
behalf. JHipster Online uses https://your-jhipster-online-url/api/github/callback
as callback endpoint.
JHipster Online also needs to have a specific "JHipster Bot" user configured, like the
https://github.com/jhipster-bot used by the official JHipster Online website.
Here is the final configuration, that should be set up inside the application-dev.yml
file for
development, and inside the application-prod.yml
file for production.
application:
github:
host: https://github.com # The GitHub to connect to (by default: the public GitHub instance)
client-id: XXX # The OAuth Client ID of the application on GitHub
client-secret: XXX # The OAuth Client secret of the application on GitHub
Similarly to GitHub, your GitLab configuration must be placed in your application-*.yml
using the application.gitlab
keys.
JHipster Online can work on the public GitLab instance on https://gitlab.com as well as any private instance of GitLab that is configured inside your company.
JHipster Online needs to have a specific "JHipster Bot" user configured: create that user (if you have your own private instance, you can call it
jhipster-bot
, otherwise choose the name you like), and log in using that user.
Once logged in, the required API credentials can be created by going to "Settings > Applications > Add new application". Create a new application:
- Its name is
jhipster
- The redirect URI is
https://your-jhipster-online-url/api/gitlab/callback
- It has the
api
andread_user
scopes
Save that new application and store safely the Application Id
and Secret
values, so you can use them to configure
the application-*.yml
files.
Here is the final configuration, that should be set up inside the application-dev.yml
file for
development, and inside the application-prod.yml
file for production.
application:
gitlab:
host: https://gitlab.com # The GitLab to connect to. The main public GitLab instance is default here.
client-id: XXX # Your GitLab application Id
client-secret: XXX # Your GitLab application secret
redirect-uri: XXX # The URI where the user will be redirected after GitLab authentication. This URI
# must be registered in you GitLab application callback URLs
To generate a production build, like any normal JHipster application, please run:
./mvnw -Pprod clean package
-
The project can be deployed to GAE flexible environment by simply creating a tagged release.
-
Creating a new release triggers the deploy.yml GitHub Actions workflow.
-
The above workflow includes a Docker build and pushes the image to Google Container Registry. Cloud Monitoring and Cloud Logging are used for obtaining application logs and monitoring.
- Increment the version numbers in
pom.xml
andpackage.json
. - Create a tagged release. All you have to do is got to the releases section
and edit the draft created by
github-actions
.
-
Install dependency generator-jhipster-speedcode:
-
git clone git@github.com:ey-org/ey-generator.git
branch speed-components-integrated cd generator-jhipster-speedcode
-
npm install
andnpm link
-
-
Setting environment variables (of this project)
application:
jhipster-cmd:
cmd: ${SPEEDCODE_COMMAND}
timeout: ${TIME_OUT}
tmp-folder: ${DIR_TMP}
speedcode-repo: ${SPEEDCODE_REPO}
speedcode-package: '@ey/generator-jhipster-speedcode'
npm-command: ${NPM_COMMAND}
Where:
- DIR_TMP=C:\Users\usuario\AppData\Local\Temp; #Directory where the generated projects will be executed.
-
NPM_COMMAND=C:\Users\usuario\AppData\Roaming\npm\npm.cmd #Location of the speedcode command,
where npm
-
SPEEDCODE_COMMAND=C:\Users\usuario\AppData\Roaming\npm\speedcode.cmd; #Location of the speedcode command
where speedcode
- SPEEDCODE_REPO= http://localhost:4873; #URL to local npm repository (Check Auto-Install part)
- TIME_OUT= 120 #Time limit to generate an application (otherwise the process is stopped)
MACOS example
- DIR_TMP=/tmp
- NPM_COMMAND=/usr/local/lib/node_modules/npm/bin/npm-cli.js
- SPEEDCODE_COMMAND=/usr/local/lib/node_modules/@ey/generator-jhipster-speedcode/cli/app.js
- SPEEDCODE_REPO= http://localhost:4873
- TIME_OUT= 120
- Install and run the front-end:
yarn install && yarn start
- Run the database:
docker-compose -f src/main/docker/mysql.yml up -d
- Run the back-end:
./mvnw
The application generator checks if the @ey/generator-jhipster-speedcode package is installed on the machine, and if it is not, it automatically installs speedcode from a local npm repository, at the start of its execution, in order to simulate this flow is required:
-
Install local npm repository (Verdaccio)
npm install -g verdaccio
- Start verdaccio:
verdaccio
(start in http://localhost:4873)
-
Add the @ey/generator-jhipster-speedcode package to the repository:
npm publish --registry:http://localhost:4873
-
Check flow:
- Uninstall speedcode
npm uninstall -g generator-jhipster-speedcode
,npm list -g
. - Run speedcode
- Verify package in:
npm list -g
- Uninstall speedcode
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:
docker build -t jhonline .
Upload to the dockerised verdaccio (``verdaccio.yml`), the @ey/generator-jhipster-speedcode package before starting the applications.
Then run:
docker compose -f src/main/docker/app.yml up -d
Se ha modificado principalmente el archivo jhipster.configuration.model.ts
para que cuando se serialice, tenga el mismo formato del archivo .yo-rc.json
generado con el comando speedcode
export interface BlueprintModel {
name: string;
version: string;
}
const blueprint: BlueprintModel = {
name: '@ey/generator-jhipster-speedcode',
version: '3.0.0'
};
export class JHipsterConfigurationModel {
public skipJhipsterDependencies = true;
public applicationType = 'monolith';
public baseName = 'speedcodeSampleApplication';
public packageName = 'com.ey.speedcode.app';
public serverPort = 8080;
public serviceDiscoveryType: any = false;
public authenticationType = 'jwt';
public authenticationTypeSaml = false;
public authenticationTypeJwt = false;
public cacheProvider = 'no';
public enableHibernateCache = false;
public websocket: any = false;
public databaseType = 'sql';
public devDatabaseType = 'h2Disk';
public prodDatabaseType = 'postgresql';
public searchEngine: any = false;
public buildTool = 'maven';
public clientPackageManager = 'npm';
public testFrameworks: string[] = [];
public enableTranslation = true;
public nativeLanguage = 'en';
public languages = ['en'];
public clientFramework = 'angularX';
public jhiPrefix = 'jhi';
public withAdminUi = true;
public reactive = true;
public configurationType = "configServer";
public scfConfigurationServer = true;
public mailType = "mailLocal";
public scfMailServer = false;
public useGReCaptcha = false;
public profilingType = "default";
public clientTheme = "EY";
public monorepository = true;
public skipCommitHook = true ;
public jwtSecretKey = "string"
public devServerPort = 4200;
public blueprints: BlueprintModel[] = [blueprint];
public otherModules: BlueprintModel[] = [blueprint];
constructor(data?: Partial<JHipsterConfigurationModel>) {
if (data) {
const dataCopy = { ...data };
dataCopy.testFrameworks = [...(data.testFrameworks || [])];
dataCopy.languages = [...(data.languages || [])];
Object.assign(this, data);
}
}
}
Se ha modificado tambien parte de las vistas en el archivo generator.component.html
para eliminar las preguntas que ya no sean necesarias debido a que tenian valores por defecto y tambien que muestre en el flujo correcto como por ejemplo: Unicamente permitir la base de datos SQL si se escoge una autenticacion SAML