Skip to content

Instantly share code, notes, and snippets.

@mraible
Last active December 16, 2021 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mraible/3c97f60c6617e67fd87cd9895d54311c to your computer and use it in GitHub Desktop.
Save mraible/3c97f60c6617e67fd87cd9895d54311c to your computer and use it in GitHub Desktop.
Microservices with JHipster and Import JDL
application {
config {
baseName gateway,
packageName com.okta.developer.gateway,
applicationType gateway,
authenticationType oauth2,
prodDatabaseType postgresql,
searchEngine elasticsearch,
serviceDiscoveryType eureka,
testFrameworks [protractor]
}
entities Blog, Post, Tag, Product
}
application {
config {
baseName blog,
packageName com.okta.developer.blog,
applicationType microservice,
authenticationType oauth2,
prodDatabaseType postgresql,
searchEngine elasticsearch,
serverPort 8081,
serviceDiscoveryType eureka
}
entities Blog, Post, Tag
}
application {
config {
baseName store,
packageName com.okta.developer.store,
applicationType microservice,
authenticationType oauth2,
databaseType mongodb,
devDatabaseType mongodb,
prodDatabaseType mongodb,
enableHibernateCache false,
searchEngine elasticsearch,
serverPort 8082,
serviceDiscoveryType eureka
}
entities Product
}
entity Blog {
name String required minlength(3),
handle String required minlength(2)
}
entity Post {
title String required,
content TextBlob required,
date Instant required
}
entity Tag {
name String required minlength(2)
}
entity Product {
title String required,
price BigDecimal required min(0),
image ImageBlob
}
relationship ManyToOne {
Blog{user(login)} to User,
Post{blog(name)} to Blog
}
relationship ManyToMany {
Post{tag(name)} to Tag{post}
}
paginate Post, Tag with infinite-scroll
paginate Product with pagination
microservice Product with store
microservice Blog, Post, Tag with blog
@mraible
Copy link
Author

mraible commented Sep 16, 2018

  1. Create an apps.jh file with the JDL above, then run jhipster import-jdl apps.jh.

  2. Docker commands you need to run before starting each app:

docker-compose -f gateway/src/main/docker/jhipster-registry.yml up -d
docker-compose -f gateway/src/main/docker/keycloak.yml up -d
docker-compose -f store/src/main/docker/mongodb.yml up -d
  1. Then run ./mvnw in each application's directory.
  2. Open your browser to http://localhost:8080 and login.

@abdorah
Copy link

abdorah commented Dec 16, 2021

Thank you very much for your great tutorials!!!!

@mraible
Copy link
Author

mraible commented Dec 16, 2021

It's my pleasure! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment