Skip to content

Instantly share code, notes, and snippets.

@renanfranca
Last active May 8, 2022 03:31
Show Gist options
  • Save renanfranca/e473ac73e6493357d1ee60699b63101f to your computer and use it in GitHub Desktop.
Save renanfranca/e473ac73e6493357d1ee60699b63101f to your computer and use it in GitHub Desktop.
//Define the gateway application
application {
config {
baseName gateway,
applicationType gateway,
packageName com.mamazinha.gateway,
authenticationType jwt,
prodDatabaseType postgresql,
clientFramework angularX,
serviceDiscoveryType eureka,
testFrameworks [cypress],
languages [en, pt-br],
nativeLanguage en,
enableTranslation true
}
//Define which entities will have the angular
//front-end implemented
entities BabyProfile, Weight, Height, Humor, HumorHistory, Nap, BreastFeed
}
//Define the baby microservice
application {
config {
baseName baby,
applicationType microservice,
packageName com.mamazinha.baby,
authenticationType jwt,
prodDatabaseType postgresql,
serverPort 8081,
serviceDiscoveryType eureka,
cacheProvider ehcache,
enableHibernateCache true,
languages [en, pt-br],
nativeLanguage en,
enableTranslation true,
searchEngine false
}
// Define the entities that will have the backend implemented
entities BabyProfile, Weight, Height, Humor, HumorHistory, Nap, BreastFeed
}
//Starting define the entities
entity BabyProfile {
name String required
picture ImageBlob
birthday ZonedDateTime required
sign String
main Boolean
userId String required
}
entity Weight {
value Double required
date ZonedDateTime required
}
entity Height {
value Double required
date ZonedDateTime required
}
entity Humor {
value Integer required /** 1 to 5 ANGRY, SAD, CALM, HAPPY, EXCITED*/
description String required
emotico ImageBlob
}
entity HumorHistory {
// humor Humor - this field will be created though relationship
date ZonedDateTime
}
//enum Humor {
// ANGRY, SAD, CALM, HAPPY, EXCITED
//}
entity Nap {
start ZonedDateTime
end ZonedDateTime
// humor Humor - this field will be created though relationship
place Place
}
enum Place {
LAP, BABY_CRIB, CART, BABY_CONFORT
}
entity BreastFeed {
start ZonedDateTime
end ZonedDateTime
pain Pain
}
enum Pain {
NO_PAIN, DISCOMFORTING, DISTRESSING, INTENSE, UTTERLY_HORRIBLE, UNIMAGINABLE
}
//Define the relationships
relationship ManyToOne {
Weight{BabyProfile(name)} to BabyProfile
Height{BabyProfile(name)} to BabyProfile
HumorHistory{BabyProfile(name)} to BabyProfile
Nap{BabyProfile(name)} to BabyProfile
BreastFeed{BabyProfile(name)} to BabyProfile
HumorHistory{Humor(description)} to Humor
Nap{Humor(description)} to Humor
}
//Pagination
paginate Weight, Height, Humor, HumorHistory, Nap, BreastFeed with infinite-scroll
paginate BabyProfile with pagination
//Entities handle by baby microservice
microservice BabyProfile, Weight, Height, Humor, HumorHistory, Nap, BreastFeed with baby
// Use Data Transfer Objects (DTO)
dto * with mapstruct
// Service layer
service all with serviceClass
@renanfranca
Copy link
Author

renanfranca commented May 5, 2022

This gist was explained in my blog post:
I built a Baby Care web app using JHipster (open source from now on 🥰)

If you enjoyed this gist, please, considering give it a star ⭐ to support me and enhanced this gist's visibility 🤩

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