---
# System prepended metadata

title: Landing Page

---

# Landing Page 

## Existing Flow

### Generate Token
```plantuml
participant "FE" as fe
participant "everpro-product" as ep
participant "everpro-page-builder" as lp
database "everpro-page-builder" as lpdb


fe -> ep : get token PageBuilder
activate ep
ep -> ep : validate auth
ep -> lp : generate token (userID, ReferenceID)
activate lp
lp -> lpdb : save data
activate lpdb
lp <-- lpdb : resp 
note right
table `page_auth`
end note
deactivate lpdb
ep <-- lp : resp token
deactivate lp
fe <-- ep : resp token
 deactivate ep
```


### Get Template
```plantuml
participant "FE" as fe
participant "everpro-page-builder" as lp
database "everpro-page-builder" as lpdb

fe -> lp : generate token
activate lp
lp -> lpdb : save token
lp <-- lpdb : resp 
fe <-- lp : resp token
fe -> lp : request get template
lp -> lpdb : query get template
note right
table `templates`
end note
lp <-- lpdb : resp query
fe <-- lp : resp template
```

### Insert Landing Page
```plantuml
participant "FE" as fe
participant "evm-asgard" as asgard
participant "everpro-page-builder" as lp
database "everpro-page-builder" as lpdb
fe -> asgard : upload picture
fe <-- asgard : resp url (origin & resize)
fe -> lp : insert landingPage
activate lp
lp -> lpdb : query insert
note right
table `landing_page`
end note
lp <-- lpdb : created
fe <-- lp : resp created
```

### Update Landing Page
```plantuml
participant "FE" as fe
participant "evm-asgard" as asgard
participant "everpro-page-builder" as lp
database "everpro-page-builder" as lpdb
fe -> asgard : upload picture
fe <-- asgard : resp url (origin & resize)
fe -> lp : update landingPage
activate lp
lp -> lpdb : query update
note right
table `landing_page`
end note
lp <-- lpdb : updated
fe <-- lp : resp updated
```

### Get Landing Page By {ReferenceEntityID}
```plantuml
participant "FE" as fe
participant "everpro-page-builder" as lp
database "everpro-page-builder" as lpdb
participant "evm-asgard" as asgard

fe -> lp : req get landingPage
activate lp
lp -> lpdb : query get where
note right
table `landing_page`
end note
lp <-- lpdb : resp data
fe <-- lp : resp landingPage
deactivate lp
fe -> asgard : req picture by url (to get cache pic)
fe <-- asgard : resp cache picture
```

### Get Detail Product  By {ProductEntityID}
```plantuml
participant "FE" as fe
participant "everpro-product" as p
database "everpro-product" as pdb
participant "everpro-page-builder" as lp
database "everpro-page-builder" as lpdb

fe -> p : req get detail product
activate p
p -> pdb : query where
p <-- pdb : resp data
p -> lp : req get landingPage by ProductID
activate lp
lp -> lpdb : query get where
note right
table `landing_page`
end note
lp <-- lpdb : resp data
p <-- lp : resp landingPage
deactivate lp
fe <-- p : resp detail product
```