Skip to content

Instantly share code, notes, and snippets.

@tckb
Created March 25, 2022 13:59
Show Gist options
  • Select an option

  • Save tckb/843760047123bd6a39d37cecaa8573c1 to your computer and use it in GitHub Desktop.

Select an option

Save tckb/843760047123bd6a39d37cecaa8573c1 to your computer and use it in GitHub Desktop.
workspace "pathfinder"{
model {
shopCustomer = person "Shop Customer" "An authenticated shop user who has accessn to storefront" "Customer"
ctp = softwareSystem "Commercetools" "Software System" {
ctpBackend = container "Backend"
ctpPersistance = container "Persistance" "Some kind of internal persistance, exact details aren't really relevant" "Persistance layer" "Database"
}
erp = softwareSystem "Dolibarr ERP system" "Software System"
crm = softwareSystem "Customer Relation Management System" "Software System"
enterprise "Pathfinder" {
pim = softwareSystem "PIM" "DaaS or graphQL federated System that access to product related data" "Software System"
store = softwareSystem "Storefront" "JavaScript or Storefront accelarator" "Web Browser"
ms = softwareSystem "Mulesoft Integration" "The system and components that can be integrated from the mulesoft platform" "Software System" {
!adrs adrs
!docs docs
orderExtensionAPI = container "Order Extension API" "The API that will be invoked before the orders are persisted in the backend of Commercetools" "Container" {
orderExtensionListenerFlow = component "Request processing" "listens to the incoming request, validates and persists the order event to the queue and responds with `200`" "Flow"
orderExtensionOrderProcessingFlow = component "Order processing" "Fetches the order event from the queue, prepares the event and sends the event to the order processing API" "Flow"
}
orderProcessAPI = container "Order Process API" "The Order processing API that receives orders and convert it into canonical model and process it into ERP system" "Container"
erpSystemAPI = container "ERP Order System API" "The API that receives canonical orders and syncs orders to ERP system" "Container"
msObjectStore = container "Key-value Store" "a keyvalue store for storing states" "Objectstore" "Database"
msQueue = container "Message queue" "a keyvalue store for storing states" "Queue" "Queue"
}
}
shopCustomer -> store "View products, can add them to cart and place orders"
store -> ctp "Creates carts, orders"
store -> pim "Access product, categories etc" "graphQL"
ms -> erp "Syncs Orders and other related data"
crm -> orderProcessAPI "Lookup customer data"
ctp -> ms "Extension API, Subscriptions etc" "HTTPS"
ms -> pim "Get product information"
ctpBackend -> ctpPersistance "persists orders, carts"
# component relationship
ctp -> orderExtensionAPI "calls before order creation, update or delete"
erpSystemAPI -> msObjectStore "Save authetication information" "DW/HTTPS"
erpSystemAPI -> erp "Send the order to ERP system" "XML/HTTPS"
ctpBackend -> orderExtensionListenerFlow "Order data" "JSON/HTTPS"
orderExtensionListenerFlow -> ctpBackend "Order extension response" "JSON/HTTPS"
orderExtensionListenerFlow -> msQueue "Persists orders" "DW/HTTPS"
msQueue -> orderExtensionOrderProcessingFlow "Fetch orders" "DW/HTTPS"
orderExtensionOrderProcessingFlow -> orderProcessAPI "Send orders to be further processed" "JSON/HTTPS"
orderProcessAPI -> erpSystemAPI "Send canonical order to be persisted on ERP system" "JSON/HTTPS"
deploymentEnvironment "Develop" {
deploymentNode "Cloudhub Worker1" "" "" {
deploymentNode "Mule4 Runtime" "" "" {
orderExtensionInstance = containerInstance orderExtensionAPI
}
}
deploymentNode "Cloudhub Worker2" "" ""{
deploymentNode "Mule4 Runtime" "" "" {
orderProcessAPIInstance = containerInstance orderProcessAPI
}
}
deploymentNode "Cloudhub Worker3" "" ""{
deploymentNode "Mule4 Runtime" "" "" {
erpSystemAPIInstance = containerInstance erpSystemAPI
}
}
}
}
views {
systemlandscape "SystemLandscape" {
include *
}
systemcontext ms "mulesoft" {
include *
autoLayout
}
container ms "mulesoftContainer" {
include *
autoLayout
}
systemcontext ctp "Commerctools" {
include *
autoLayout
}
container ctp {
include *
autoLayout
}
deployment ms "Develop" "DevelopmentDeployment" {
include *
autoLayout lr
}
component orderExtensionAPI "Components" {
include *
autoLayout
}
dynamic orderExtensionAPI "OrderCreation" "Creating a order from the storefront" {
shopCustomer -> store "Login and Create a order"
store -> ctp "Submit new order request"
ctp -> orderExtensionListenerFlow "Create Order Reference Object"
orderExtensionListenerFlow -> ctp "200 - OK"
orderExtensionListenerFlow -> msQueue "Persist Order Reference object"
msQueue -> orderExtensionOrderProcessingFlow "Fetch Order Reference object"
orderExtensionOrderProcessingFlow -> orderProcessAPI "Send commercetools order object to be processed"
crm -> orderProcessAPI "fetch customer information of the order"
pim -> orderProcessAPI "fetch product information of the order"
orderProcessAPI -> orderProcessAPI "convert to canonical order"
orderProcessAPI -> erpSystemAPI "Send canonical order information"
erpSystemAPI -> erpSystemAPI "Convert canonical order to ERP order"
msObjectStore -> erpSystemAPI "Lookup or Save authentication data for ERP"
erpSystemAPI -> erp "Save ERP order data"
}
styles {
element "Person" {
color #ffffff
fontSize 22
shape Person
}
element "Customer" {
background #08427b
}
element "Bank Staff" {
background #999999
}
element "Software System" {
background #1168bd
color #ffffff
}
element "Existing System" {
background #999999
color #ffffff
}
element "Container" {
background #438dd5
color #ffffff
}
element "Web Browser" {
shape WebBrowser
}
element "Mobile App" {
shape MobileDeviceLandscape
}
element "Database" {
shape Cylinder
}
element "Component" {
background #85bbf0
color #000000
}
element "Queue" {
shape Pipe
}
element "Failover" {
opacity 25
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment