bazzar/docs/infrastructure.puml

353 lines
7.5 KiB
Plaintext

@startuml
'https://plantuml.com/deployment-diagram
scale 1000
rectangle "API" {
' left to right direction
node "bazzar"
queue rumqttd
component "Accounts" {
node "account-manager"
database bazzar_accounts [
PostgreSQL
---
bazzar_accounts
]
"account-manager" <-up-> bazzar_accounts
"account-manager" --> rumqttd : emit event
usecase create_account [
Create
account
]
usecase me [
Me
]
usecase load_public_info [
Load
public
info
]
usecase delete_account [
Delete
account
]
usecase update_account [
Update
account
]
"account-manager" -- create_account
"account-manager" -- me
"account-manager" -- load_public_info
"account-manager" -- delete_account
"account-manager" -- update_account
}
component "Carts" {
node "cart-manager"
database bazzar_carts [
PostgreSQL
---
bazzar_carts
]
"cart-manager" <-up-> bazzar_carts
usecase modify_item [
Modify
item
]
usecase remove_product [
Remove
product
]
usecase modify_cart [
Modify
cart
]
usecase active_shopping_cart [
Active
shopping
cart
]
active_shopping_cart <-- rumqttd : account created
remove_product <-- rumqttd : product deleted
"cart-manager" -- modify_item
"cart-manager" -- remove_product
"cart-manager" -- modify_cart
"cart-manager" -- active_shopping_cart
}
component "Search" {
node "search-manager"
database "sonic"
"search-manager" <-up-> "sonic"
usecase suggest [
Suggest
]
usecase search [
Search
]
usecase create_index [
Create
index
]
usecase delete_index [
Delete
index
]
create_index <-- rumqttd : product created
delete_index <-- rumqttd : product deleted
"search-manager" -- suggest
"search-manager" -- search
"search-manager" -- create_index
"search-manager" -- delete_index
}
component "Stocks" {
node "stock-manager"
database bazzar_stocks [
PostgreSQL
---
bazzar_stocks
]
"stock-manager" <-up-> bazzar_stocks
"stock-manager" --> rumqttd : emit event
circle product [
Product
]
usecase create_product [
Create
product
]
usecase update_product [
Update
product
]
usecase delete_product [
Delete
product
]
circle product_variant [
Product
variant
]
usecase add_product_variant [
Add
product
variant
]
usecase update_product_variant [
Update
product
variant
]
usecase delete_product_variant [
Delete
product
variant
]
circle product_photo [
Product
photo
]
usecase add_product_photo [
Add
product
photo
]
usecase remove_product_photo [
Remove
product
photo
]
circle product_stock [
Product
stock
]
usecase update_product_stock [
Update
product
stock
]
usecase load_detailed_products [
Load
detailed
products
]
usecase load_single_product [
Load
single
product
]
"stock-manager" -- product
product -- create_product
product -- update_product
product -- delete_product
"stock-manager" -- product_variant
product_variant -- add_product_variant
product_variant -- update_product_variant
product_variant -- delete_product_variant
"stock-manager" -- product_photo
product_photo -- add_product_photo
product_photo -- remove_product_photo
"stock-manager" -- product_stock
product_stock -- update_product_stock
"stock-manager" -- load_detailed_products
"stock-manager" -- load_single_product
}
component "E-Mail Sender" {
node "email-sender"
cloud "sendgrid"
"email-sender" -up-> "sendgrid"
usecase welcome [
Welcome
]
usecase reset_password [
Reset
password
]
usecase goodbye [
Reset
password
]
welcome <-- rumqttd : account created
goodbye <-- rumqttd : account deleted
"email-sender" -- welcome
"email-sender" -- reset_password
"email-sender" -- goodbye
}
component "Payments" {
node "payment-manager"
cloud payment_service [
Payment
cloud
service
]
database bazzar_payments [
PostgreSQL
---
bazzar_payments
]
"payment-manager" <-up(0)-> payment_service : http
"payment-manager" <-up-> bazzar_payments
"payment-manager" --> rumqttd : emit event
usecase request [
Request
payment
]
usecase update_state [
Update
payment
state
]
"payment-manager" -- request
"payment-manager" -- update_state
}
component "Orders" {
node "order-manager"
database bazzar_orders [
PostgreSQL
---
bazzar_orders
]
"order-manager" <-up-> bazzar_orders
"order-manager" --> rumqttd : emit event
usecase create_order [
Create
order
]
usecase update_order_state [
Update
order
state
]
update_order_state <-- rumqttd : payment_status_changed
usecase cancel_order [
Cancel
order
]
"order-manager" -- create_order
"order-manager" -- update_order_state
"order-manager" -- cancel_order
}
component "Tokens" {
node "token-manager"
database bazzar_tokens [
PostgreSQL
---
bazzar_tokens
]
"token-manager" <-up-> bazzar_tokens
"token-manager" --> rumqttd : emit event
usecase create_jwt [
Create
JWT
]
usecase validate_jwt [
Validate
JWT
]
usecase refresh_jwt [
Refresh
JWT
]
"token-manager" -- create_jwt
"token-manager" -- validate_jwt
"token-manager" -- refresh_jwt
}
rectangle {
actor " rumqttd"
"bazzar" -- "Accounts" : rpc
"bazzar" -- "Carts" : rpc
"bazzar" -- "Stocks" : rpc
"bazzar" -- "Search" : rpc
"bazzar" -- "E-Mail" : rpc
"bazzar" -- "Tokens" : rpc
"bazzar" -- "Payments" : rpc
"bazzar" --> " rumqttd" : emit event
}
}
@enduml