@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

LAYOUT_WITH_LEGEND()

title Kell Creations - Enterprise Integration & Orchestration Architecture

Person(owner, "Business Owner", "Oversees operations, approvals, and business workflows")
Person(staff, "Operations Staff", "Executes day-to-day publishing, production, and administrative workflows")

System_Boundary(platform, "Kell Creations Platform") {
  Container(api, "API Orchestrator", "Integration Service", "Central integration layer for internal and external system communication")
  Container(n8nflow, "Workflow Orchestration", "Automation Service", "Executes automated workflows, event handling, notifications, and process logic")
  Container(notify, "Notification Service", "Messaging Service", "Generates alerts, reminders, and approval messages")
  Container(audit, "Audit & Logging Service", "Observability Service", "Captures integration events, workflow actions, and process outcomes")

  Container(inventory, "Inventory Application", "Business Application", "Manages stock, materials, and product availability")
  Container(social, "Social Media Management", "Business Application", "Manages campaigns, content scheduling, and social engagement")
  Container(wpmanage, "WordPress Management", "Business Application", "Manages site administration, product publishing, and content updates")
  Container(mrp, "Craft Manufacturing / MRP", "Business Application", "Manages BOMs, work orders, and production planning")
  Container(finance, "Financial Analysis", "Business Application", "Consumes business data for reporting and decision support")
  Container(policyrepo, "Policy Repository", "Document Service", "Provides controlled procedures and approval-driven governance records")
}

System_Ext(wordpress, "WordPress", "www.kellcreations.com")
System_Ext(mail, "Mail Server", "mail.kellcreations.com")
System_Ext(facebook, "Facebook", "@kellcreation")
System_Ext(instagram, "Instagram", "@kellcreations")
System_Ext(xsocial, "X", "@kellcreations")
System_Ext(git, "Forgejo Git", "git.kellsupport.com")

Rel(owner, n8nflow, "Approves or reviews selected workflows through")
Rel(staff, n8nflow, "Initiates and monitors workflows through")

Rel(inventory, api, "Publishes and receives integration events through")
Rel(social, api, "Publishes and receives integration events through")
Rel(wpmanage, api, "Publishes and receives integration events through")
Rel(mrp, api, "Publishes and receives integration events through")
Rel(finance, api, "Consumes enterprise data and events through")
Rel(policyrepo, api, "Provides controlled process and governance triggers through")

Rel(api, n8nflow, "Triggers orchestrated workflows in")
Rel(n8nflow, notify, "Uses for alerts and approvals")
Rel(n8nflow, audit, "Logs workflow actions to")
Rel(api, audit, "Logs integration events to")

Rel(api, wordpress, "Synchronizes content, products, and updates with")
Rel(api, facebook, "Publishes campaign and engagement content to")
Rel(api, instagram, "Publishes campaign and engagement content to")
Rel(api, xsocial, "Publishes campaign and engagement content to")
Rel(notify, mail, "Sends messages through")

Rel(policyrepo, git, "Stores controlled workflow and policy source in")

Rel(n8nflow, inventory, "Executes automation against")
Rel(n8nflow, social, "Executes automation against")
Rel(n8nflow, wpmanage, "Executes automation against")
Rel(n8nflow, mrp, "Executes automation against")
Rel(n8nflow, finance, "Sends reporting or workflow outputs to")

@enduml