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

LAYOUT_WITH_LEGEND()

title WordPress Management - Component Diagram

Person(owner, "Business Owner", "Oversees site content, product publishing, and administrative decisions")
Person(staff, "Operations Staff", "Performs content updates, product maintenance, and site administration tasks")

ContainerDb(txdb, "Transaction Database", "Database", "Stores products, content metadata, sync records, and transaction-related data")
Container(auth, "Authentication Service", "Shared Service", "Provides authentication and identity controls")
Container(datarepo, "Shared Data Repository", "Shared Service", "Provides access to shared business entities and reference data")
Container(api, "API Orchestrator", "API / Integration Service", "Coordinates internal and external integrations")
Container(audit, "Audit & Logging Service", "Observability Service", "Captures administrative, publishing, and compliance-relevant events")
Container(notify, "Notification Service", "Shared Service", "Generates alerts, reminders, and exception notifications")
System_Ext(wordpress, "WordPress", "www.kellcreations.com", "Website, WooCommerce, and publishing platform")

Container_Boundary(wp_app, "WordPress Management") {
  Component(ui, "WordPress Management UI", "Web UI", "Provides dashboards, publishing controls, product administration, and content workflows")
  Component(content_service, "Content Management Service", "Application Service", "Manages pages, posts, descriptions, and publishing state")
  Component(product_service, "Product Publishing Service", "Application Service", "Manages WooCommerce product setup, updates, visibility, and catalog publishing")
  Component(media_service, "Media & Asset Service", "Application Service", "Tracks images, assets, and content associations for site publishing")
  Component(sync_service, "WordPress Synchronization Service", "Application Service", "Coordinates synchronization between internal platform records and WordPress")
  Component(admin_service, "Site Administration Service", "Application Service", "Handles administrative settings, operational controls, and exception handling")
  Component(reporting_service, "WordPress Reporting Service", "Application Service", "Produces publishing status, sync status, and site operation reports")
  Component(repository, "WordPress Repository", "Data Access Component", "Reads and writes WordPress-management-related data")
}

Rel(owner, ui, "Uses")
Rel(staff, ui, "Uses")

Rel(ui, content_service, "Sends requests to")
Rel(ui, product_service, "Sends requests to")
Rel(ui, media_service, "Sends requests to")
Rel(ui, sync_service, "Sends requests to")
Rel(ui, admin_service, "Sends requests to")
Rel(ui, reporting_service, "Sends requests to")

Rel(content_service, repository, "Reads from and writes to")
Rel(product_service, repository, "Reads from and writes to")
Rel(media_service, repository, "Reads from and writes to")
Rel(sync_service, repository, "Reads from and writes to")
Rel(admin_service, repository, "Reads from and writes to")
Rel(reporting_service, repository, "Reads from")

Rel(repository, txdb, "Reads from and writes to")

Rel(content_service, datarepo, "Uses shared business data from")
Rel(product_service, datarepo, "Uses shared business data from")
Rel(media_service, datarepo, "Uses shared business data from")
Rel(sync_service, datarepo, "Uses shared business data from")

Rel(ui, auth, "Authenticates through")
Rel(sync_service, api, "Publishes and receives integration events through")
Rel(product_service, api, "Publishes product events through")
Rel(admin_service, notify, "Triggers alerts and exception notifications through")
Rel(reporting_service, api, "Sends reporting outputs through")

Rel(sync_service, wordpress, "Synchronizes content and product data with")
Rel(admin_service, wordpress, "Administers platform settings in")

Rel(content_service, audit, "Logs content publishing events to")
Rel(product_service, audit, "Logs product publishing events to")
Rel(sync_service, audit, "Logs synchronization activity to")
Rel(admin_service, audit, "Logs administrative actions to")
Rel(media_service, audit, "Logs asset changes to")

@enduml