@startuml C4 Component Diagram
title Component Diagram

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

!define DEVICONS https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/devicons
!include DEVICONS/react.puml


Container(patient_ui, "Patient UI", "React", "Displays customizable interface with different needs and triggers alerts.", "react")
Container(nurse_ui, "Nurse UI", "React", "Receives alerts that fit the staff's profile.", "react")
Container(admin_ui, "Admin UI", "React", "Sets up, configures and monitors the system. Coordinates & plans staff.", "react")

ContainerDb(database, "Database")

System_Boundary(ecBell, "EC-Bell") {
    Component(patient_web, "patient-web", $descr="Serves UI build & API")
    Component(nurse_web, "nurse-web", $descr="Serves UI build & API")
    Component(admin_web, "admin-web", $descr="Serves UI build & API")

    Component(admin_service, "admin-service", $descr="Domain entities, logic & services")

    Component(admin_db, "admin-db", $descr="Loads & stores entities from/to the database")
}

Rel(patient_ui, patient_web, "Trigger alerts & load interface config", "HTTPS")
Rel(nurse_web, nurse_ui, "Notify staff member", "WebSocket")
Rel(admin_ui, admin_web, "Manage, operate and monitor application", "HTTPS")

Rel(patient_web, admin_service, "Trigger alerts", "Method Call")
Rel(admin_service, nurse_web, "Notify staff member", "Method Call")
Rel(admin_web, admin_service, "Manage entities", "Method Call")

BiRel(admin_service, admin_db, "Load/store data", "Method Call")
BiRel(admin_db, database, "Load/store data", "JDBC")

@enduml
