Skip to content

Instantly share code, notes, and snippets.

@deepu105
Created December 10, 2019 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepu105/1ca418d824b8d45604f8b108db251d6e to your computer and use it in GitHub Desktop.
Save deepu105/1ca418d824b8d45604f8b108db251d6e to your computer and use it in GitHub Desktop.
jhipster-book-online-store-istio.jdl
/* Store gateway application */
application {
config {
baseName store
applicationType gateway
packageName com.mycompany.store
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType mysql
cacheProvider hazelcast
buildTool gradle
clientFramework angularX
useSass true
languages [en, zh-cn, ta]
websocket spring-websocket
testFrameworks [protractor]
}
entities *
}
/* Invoice microservice application */
application {
config {
baseName invoice,
applicationType microservice,
packageName com.mycompany.store,
serviceDiscoveryType no,
authenticationType jwt,
prodDatabaseType mysql,
buildTool gradle,
serverPort 8081,
languages [en, zh-cn, ta]
}
entities Invoice, Shipment
}
/* Notification microservice application */
application {
config {
baseName notification,
applicationType microservice,
packageName com.mycompany.store,
serviceDiscoveryType no,
authenticationType jwt,
databaseType mongodb,
cacheProvider no,
enableHibernateCache false,
buildTool gradle,
serverPort 8082,
languages [en, zh-cn, ta]
}
entities Notification
}
/* Entiteis for store service */
/** 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
}
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)}
}
/* 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
productOrderId Long required
}
enum InvoiceStatus {
PAID, ISSUED, CANCELLED
}
enum PaymentMethod {
CREDIT_CARD, CASH_ON_DELIVERY, PAYPAL
}
entity Shipment {
trackingCode String
date Instant required
details String
}
relationship OneToMany {
Invoice{shipment} to Shipment{invoice(code) required}
}
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
/* General options */
service * with serviceClass
paginate Product, Customer, ProductOrder, Invoice, Shipment, OrderItem with pagination
/**
* Deployments
*/
deployment {
deploymentType kubernetes
appsFolders [store, invoice, notification]
dockerRepositoryName "deepu105"
serviceDiscoveryType no
istio true
kubernetesServiceType Ingress
kubernetesNamespace jhipster
ingressDomain "34.77.78.2.nip.io"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment