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

LAYOUT_WITH_LEGEND()

title Kell Creations - Enterprise Shared Services

Person(owner, "Business Owner")
Person(staff, "Operations Staff")

System_Boundary(platform, "Kell Creations Platform") {

  Container(auth, "Authentication Service", "Identity Service", "Centralized authentication, identity, and access control")

  Container(datarepo, "Shared Data Repository", "Data Service", "Provides unified access to core business entities and reference data")

  Container(api, "API Orchestrator", "API Gateway / Service Layer", "Central integration layer for internal services and external systems")

  Container(notify, "Notification Service", "Messaging Service", "Handles email alerts, approvals, reminders, and workflow notifications")

  Container(policyrepo, "Policy Repository", "Document Service", "Manages controlled policies, procedures, standards, and records")

  Container(audit, "Audit & Logging Service", "Observability Service", "Captures logs, events, and audit trails across all applications")

}

System_Ext(mail, "Mail Server", "mail.kellcreations.com")
System_Ext(git, "Forgejo Git", "git.kellsupport.com")
System_Ext(n8n, "n8n", "Automation and workflow engine")

Rel(owner, auth, "Authenticates through")
Rel(staff, auth, "Authenticates through")

Rel(api, n8n, "Triggers workflows and receives automation events from")
Rel(notify, mail, "Sends messages through")
Rel(policyrepo, git, "Stores version-controlled documents in")

Rel(api, datarepo, "Reads/Writes business data through")
Rel(api, auth, "Validates identity through")
Rel(api, notify, "Triggers notifications through")
Rel(api, audit, "Logs events to")

Rel(datarepo, audit, "Logs access events to")
Rel(auth, audit, "Logs authentication events to")
Rel(policyrepo, audit, "Logs document changes to")

@enduml