Skip to content

Instantly share code, notes, and snippets.

@deepu105
Created September 18, 2018 17:28
Show Gist options
  • Save deepu105/83145766158bf8923d20866de1221afa to your computer and use it in GitHub Desktop.
Save deepu105/83145766158bf8923d20866de1221afa to your computer and use it in GitHub Desktop.
application {
config {
baseName store,
applicationType gateway,
packageName com.jhipster.demo.store,
serviceDiscoveryType eureka,
authenticationType jwt,
prodDatabaseType mysql,
cacheProvider hazelcast,
buildTool gradle,
clientFramework react,
useSass true,
testFrameworks [protractor]
}
entities *
}
application {
config {
baseName invoice,
applicationType microservice,
packageName com.jhipster.demo.invoice,
serviceDiscoveryType eureka,
authenticationType jwt,
prodDatabaseType mysql,
buildTool gradle,
serverPort 8081,
skipUserManagement true
}
entities Invoice, Shipment
}
application {
config {
baseName notification,
applicationType microservice,
packageName com.jhipster.demo.notification,
serviceDiscoveryType eureka,
authenticationType jwt,
databaseType mongodb,
prodDatabaseType mongodb,
devDatabaseType mongodb,
cacheProvider no,
enableHibernateCache false,
buildTool gradle,
serverPort 8082,
skipUserManagement true
}
entities Notification
}
/* Entities for Store Gateway */
/** Product sold by the Online store */
entity Product {
name String required
description String
price BigDecimal required min(0)
size Size required
image ImageBlob
}
enum Size {
S, M, L, XL, XXL
}
entity ProductCategory {
name String required
description String
}
entity Customer {
firstName String required
lastName String required
gender Gender required
email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)
phone String required
addressLine1 String required
addressLine2 String
city String required
country String required
}
enum Gender {
MALE, FEMALE, OTHER
}
entity ProductOrder {
placedDate Instant required
status OrderStatus required
code String required
invoiceId Long
}
enum OrderStatus {
COMPLETED, PENDING, CANCELLED
}
entity OrderItem {
quantity Integer required min(0)
totalPrice BigDecimal required min(0)
status OrderItemStatus required
}
enum OrderItemStatus {
AVAILABLE, OUT_OF_STOCK, BACK_ORDER
}
relationship OneToOne {
Customer{user(login) required} to User
}
relationship ManyToOne {
OrderItem{product(name) required} to Product
}
relationship OneToMany {
Customer{order} to ProductOrder{customer(email) required},
ProductOrder{orderItem} to OrderItem{order(code) required} ,
ProductCategory{product} to Product{productCategory(name)}
}
service Product, ProductCategory, Customer, ProductOrder, OrderItem with serviceClass
paginate Product, Customer, ProductOrder, OrderItem with pagination
/* Entities for Invoice microservice */
entity Invoice {
code String required
date Instant required
details String
status InvoiceStatus required
paymentMethod PaymentMethod required
paymentDate Instant required
paymentAmount BigDecimal required
}
enum InvoiceStatus {
PAID, ISSUED, CANCELLED
}
entity Shipment {
trackingCode String
date Instant required
details String
}
enum PaymentMethod {
CREDIT_CARD, CASH_ON_DELIVERY, PAYPAL
}
relationship OneToMany {
Invoice{shipment} to Shipment{invoice(code) required}
}
service Invoice, Shipment with serviceClass
paginate Invoice, Shipment with pagination
microservice Invoice, Shipment with invoice
/* Entities for notification microservice */
entity Notification {
date Instant required
details String
sentDate Instant required
format NotificationType required
userId Long required
productId Long required
}
enum NotificationType {
EMAIL, SMS, PARCEL
}
microservice Notification with notification
@tubbynl
Copy link

tubbynl commented Sep 19, 2018

if running on os-es having a VM for docker (Windows, macOS); remember to increase memory to at least 6GiB when running this.

d3ac1a40c682        docker_store-app_1                   4.88%               1.034GiB / 7.786GiB   13.28%              400kB / 2.55MB      106MB / 0B          106
d45ccff21b1a        docker_invoice-app_1                 4.89%               1011MiB / 7.786GiB    12.69%              338kB / 1.27MB      104MB / 0B          76
711a2be982ed        docker_jhipster-console_1            0.67%               104MiB / 7.786GiB     1.30%               1.98MB / 836kB      60.2MB / 98.3kB     10
59690a65639a        docker_jhipster-logstash_1           6.99%               767.2MiB / 7.786GiB   9.62%               3.38MB / 6.91MB     79.7MB / 0B         48
a69c3545c4fe        docker_jhipster-elasticsearch_1      1.48%               1.34GiB / 7.786GiB    17.22%              7.66MB / 2.1MB      71.5MB / 17.4MB     48
150566db922c        docker_invoice-mysql_1               0.09%               187.2MiB / 7.786GiB   2.35%               98.7kB / 73.8kB     40.1MB / 71.7MB     37
392ed0836340        docker_notification-mongodb-node_1   0.27%               38.16MiB / 7.786GiB   0.48%               3.73kB / 0B         434kB / 2.3MB       26
a20ee74b05bf        docker_jhipster-registry_1           1.25%               979.8MiB / 7.786GiB   12.29%              616kB / 2.96MB      71.7MB / 0B         97
df3dd74f057b        docker_store-mysql_1                 0.07%               197MiB / 7.786GiB     2.47%               120kB / 93.9kB      11.8MB / 91.2MB     37
86e1d97e0d91        notification-mongodb-config          0.27%               36.66MiB / 7.786GiB   0.46%               3.98kB / 0B         44.8MB / 3.63MB     29

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