# Code generated by ayida from deployment.ayida.hcl, gateway.ayida.hcl, main.ayida.hcl, notifications.ayida.hcl, orders.ayida.hcl, users.ayida.hcl. DO NOT EDIT. direction: right vars: { d2-config: { layout-engine: elk } } classes: { kind-container: {} shape-database: {} shape-topic: {} } "deployment__prod": "prod" { shape: rectangle style: { fill: transparent stroke: "#737373" font-color: "#3D3D3D" stroke-dash: 4 } "deployment__prod__node__cluster": "cluster" { shape: rectangle style: { fill: transparent stroke: "#737373" font-color: "#3D3D3D" stroke-dash: 4 } "deployment__prod__node__cluster__edge": "edge" { shape: rectangle style: { fill: transparent stroke: "#737373" font-color: "#3D3D3D" stroke-dash: 4 } "deployment__prod__instance__gateway": "gateway\nCONTAINER · Kong Gateway, Lua plugins\n\nRoutes, authenticates and rate-limits requests" { shape: rectangle class: [kind-container] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } } "deployment__prod__node__cluster__services": "services" { shape: rectangle style: { fill: transparent stroke: "#737373" font-color: "#3D3D3D" stroke-dash: 4 } "deployment__prod__instance__notifier": "notifier\nCONTAINER · Node.js, gRPC\n\nSends notifications and manages preferences" { shape: rectangle class: [kind-container] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } "deployment__prod__instance__order_5fapi": "order_api\nCONTAINER · Go, gRPC\n\nOrder creation, status, cancellation and history" { shape: rectangle class: [kind-container] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } "deployment__prod__instance__user_5fapi": "user_api\nCONTAINER · Go, gRPC\n\nRegistration, login, profiles and tokens" { shape: rectangle class: [kind-container] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } } } "deployment__prod__node__data": "data" { shape: rectangle style: { fill: transparent stroke: "#737373" font-color: "#3D3D3D" stroke-dash: 4 } "deployment__prod__instance__event_5fbus": "event_bus\nCONTAINER · Apache Kafka\n\nDomain events between services" { shape: rectangle class: [kind-container; shape-topic] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } "deployment__prod__instance__order_5fdb": "order_db\nCONTAINER · PostgreSQL\n\nOrders and order status history" { shape: rectangle class: [kind-container; shape-database] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } "deployment__prod__instance__redis": "redis\nCONTAINER · Redis\n\nActive sessions" { shape: rectangle class: [kind-container; shape-database] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } "deployment__prod__instance__user_5fdb": "user_db\nCONTAINER · PostgreSQL\n\nUser accounts and profiles" { shape: rectangle class: [kind-container; shape-database] style: { fill: "#2D66AE" stroke: "#245390" font-color: "#FFFFFF" border-radius: 6 } } } } "outside__container__notification_5fdb": "Notification DB" { shape: oval style: { fill: transparent stroke: "#999999" font-color: "#666666" stroke-dash: 4 } } "outside__container__rate_5flimit_5fstore": "Rate-limit store" { shape: oval style: { fill: transparent stroke: "#999999" font-color: "#666666" stroke-dash: 4 } } "outside__external__email_5fprovider": "Email provider" { shape: oval style: { fill: transparent stroke: "#999999" font-color: "#666666" stroke-dash: 4 } } "outside__external__partner": "Third-party integrator" { shape: oval style: { fill: transparent stroke: "#999999" font-color: "#666666" stroke-dash: 4 } } "outside__external__push_5fprovider": "Push provider" { shape: oval style: { fill: transparent stroke: "#999999" font-color: "#666666" stroke-dash: 4 } } "outside__external__sms_5fprovider": "SMS provider" { shape: oval style: { fill: transparent stroke: "#999999" font-color: "#666666" stroke-dash: 4 } } "outside__person__customer": "Customer" { shape: oval style: { fill: transparent stroke: "#999999" font-color: "#666666" stroke-dash: 4 } } "deployment__prod"."deployment__prod__node__data"."deployment__prod__instance__event_5fbus" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__notifier": "Consumes order.* and user.created\nKafka" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__data"."deployment__prod__instance__event_5fbus" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__order_5fapi": "Consumes user.deleted to anonymize orders\nKafka" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__edge"."deployment__prod__instance__gateway" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__notifier": "/api/notifications/*\ngRPC" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__edge"."deployment__prod__instance__gateway" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__order_5fapi": "/api/orders/*\ngRPC" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__edge"."deployment__prod__instance__gateway" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__user_5fapi": "/api/users/*\ngRPC" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__edge"."deployment__prod__instance__gateway" -> "outside__container__rate_5flimit_5fstore": "Reads and increments counters" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 4 } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__notifier" -> "outside__container__notification_5fdb": "Reads templates and preferences" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 4 } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__notifier" -> "outside__external__email_5fprovider": "Sends email\nHTTPS" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 4 } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__notifier" -> "outside__external__push_5fprovider": "Sends push notifications\nHTTPS" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 4 } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__notifier" -> "outside__external__sms_5fprovider": "Sends SMS\nHTTPS" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 4 } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__order_5fapi" -> "deployment__prod"."deployment__prod__node__data"."deployment__prod__instance__event_5fbus": "Publishes order.created, order.paid, order.shipped, order.delivered\nKafka" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 8 } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__order_5fapi" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__notifier": "Sends immediate notifications\ngRPC" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__order_5fapi" -> "deployment__prod"."deployment__prod__node__data"."deployment__prod__instance__order_5fdb": "Reads and writes orders\nSQL" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__order_5fapi" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__user_5fapi": "Looks up the ordering user\ngRPC" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__user_5fapi" -> "deployment__prod"."deployment__prod__node__data"."deployment__prod__instance__event_5fbus": "Publishes user.created, user.updated, user.deleted\nKafka" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 8 } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__user_5fapi" -> "deployment__prod"."deployment__prod__node__data"."deployment__prod__instance__redis": "Caches sessions" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__services"."deployment__prod__instance__user_5fapi" -> "deployment__prod"."deployment__prod__node__data"."deployment__prod__instance__user_5fdb": "Reads and writes users\nSQL" { style.stroke: "#737373" style.font-color: "#3D3D3D" } "outside__external__partner" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__edge"."deployment__prod__instance__gateway": "Public API calls\nHTTPS" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 4 } "outside__person__customer" -> "deployment__prod"."deployment__prod__node__cluster"."deployment__prod__node__cluster__edge"."deployment__prod__instance__gateway": "Web and mobile app requests\nHTTPS" { style.stroke: "#737373" style.font-color: "#3D3D3D" style.stroke-dash: 4 }