@startuml
set separator none
title API Application - Dynamic

!include <C4/C4_Sequence>

AddElementTag("Component", $bgColor="#85bbf0", $borderColor="#5d82a8", $fontColor="#000000", $sprite="", $shadowing="", $borderStyle="Solid", $borderThickness="1")
AddElementTag("Container,Database", $bgColor="#438dd5", $borderColor="#2e6295", $fontColor="#ffffff", $sprite="", $shadowing="", $borderStyle="Solid", $borderThickness="1")
AddElementTag("Container,Web Browser", $bgColor="#438dd5", $borderColor="#2e6295", $fontColor="#ffffff", $sprite="", $shadowing="", $borderStyle="Solid", $borderThickness="1")

AddRelTag("Relationship", $textColor="#707070", $lineColor="#707070", $lineStyle = "")

Container(InternetBankingSystem.SinglePageApplication, "Single-Page Application", $techn="JavaScript and Angular", $descr="Provides all of the Internet banking functionality to customers via their web browser.", $tags="Container,Web Browser", $link="")
Component(InternetBankingSystem.APIApplication.SignInController, "Sign In Controller", $techn="Spring MVC Rest Controller", $descr="Allows users to sign in to the Internet Banking System.", $tags="Component", $link="")
Component(InternetBankingSystem.APIApplication.SecurityComponent, "Security Component", $techn="Spring Bean", $descr="Provides functionality related to signing in, changing passwords, etc.", $tags="Component", $link="")
ContainerDb(InternetBankingSystem.Database, "Database", $techn="Oracle Database Schema", $descr="Stores user registration information, hashed authentication credentials, access logs, etc.", $tags="Container,Database", $link="")

Rel(InternetBankingSystem.SinglePageApplication, InternetBankingSystem.APIApplication.SignInController, "Submits credentials to", $techn="JSON/HTTPS", $tags="Relationship", $link="")
Rel(InternetBankingSystem.APIApplication.SignInController, InternetBankingSystem.APIApplication.SecurityComponent, "Validates credentials using", $techn="", $tags="Relationship", $link="")
Rel(InternetBankingSystem.APIApplication.SecurityComponent, InternetBankingSystem.Database, "select * from users where username = ?", $techn="JDBC", $tags="Relationship", $link="")
Rel(InternetBankingSystem.Database, InternetBankingSystem.APIApplication.SecurityComponent, "Returns user data to", $techn="JDBC", $tags="Relationship", $link="")
Rel(InternetBankingSystem.APIApplication.SecurityComponent, InternetBankingSystem.APIApplication.SignInController, "Returns true if the hashed password matches", $techn="", $tags="Relationship", $link="")
Rel(InternetBankingSystem.APIApplication.SignInController, InternetBankingSystem.SinglePageApplication, "Sends back an authentication token to", $techn="JSON/HTTPS", $tags="Relationship", $link="")

SHOW_LEGEND(true)
@enduml