@startuml
skinparam backgroundColor #FFFFFF
skinparam defaultFontColor #000000
skinparam ArrowColor #1F2937
skinparam RectangleBorderColor #111827
skinparam RectangleFontColor #000000
skinparam PackageBorderColor #111827
skinparam PackageFontColor #000000
skinparam NoteBorderColor #111827
skinparam NoteFontColor #000000
left to right direction

package "Demo Next.js App (Before)" {
  rectangle "Auth UI\n(auth-card, session-panel)" as ui_auth #FEE2E2
  rectangle "Endpoint Lab\nHardcoded endpoint list" as ui_lab #FDE68A
}

package "athena-auth-js (Before)" {
  rectangle "client.ts\ncreateClient(...).auth in browser" as pkg_client #FECACA
  rectangle "http.ts\ncallAuthEndpoint -> auth.request(...)" as pkg_http #FECACA
  rectangle "Small endpoint surface\nmanual endpoint selection" as pkg_surface #FED7AA
}

package "Athena SDK v2.0" {
  rectangle "@xylex-group/athena\nindex.js" as sdk_root #DBEAFE
  rectangle "Node-only deps\npg, fs, net, tls" as sdk_node #BFDBFE
}

cloud "Auth API\n/api/auth/*" as api #E5E7EB

ui_auth --> pkg_client : signIn/signUp/session calls
ui_lab --> pkg_http : run endpoint
pkg_http --> pkg_client : build auth request
pkg_client --> sdk_root : runtime import
sdk_root --> sdk_node : transitively pulls
pkg_client --> api : auth request
pkg_http --> api : direct probe fallback

note right of sdk_node
Next.js client bundle can fail when
Node modules are pulled into browser code.
end note

note bottom of ui_lab
Coverage was tied to a static endpoint matrix,
so new Athena v2 methods were not auto-covered.
end note
@enduml