from diagrams import Diagram
from diagrams.c4 import Person, Container, Database, System, SystemBoundary, Relationship
with Diagram("Container diagram for Internet Banking System", direction="TB") as diag:
customer = Person(
name="Personal Banking Customer",
description="A customer of the bank, with personal bank accounts."
)
with SystemBoundary("Internet Banking System"):
webapp = Container(
name="Web Application",
technology="Java and Spring MVC",
description="Delivers the static content and the Internet banking SPA.",
)
spa = Container(
name="Single-Page Application",
technology="Javascript and Angular",
description="Provides Internet banking functionality via web browser.",
)
api = Container(
name="API Application",
technology="Java and Spring MVC",
description="Provides Internet banking functionality via JSON/HTTPS API.",
)
database = Database(
name="Database",
technology="Oracle Database Schema",
description="Stores user registration, credentials, access logs.",
)
email = System(name="E-mail System", external=True)
mainframe = System(name="Mainframe Banking System", external=True)
customer >> Relationship("Visits using [HTTPS]") >> webapp
customer >> Relationship("Views and makes payments") >> spa
webapp >> Relationship("Delivers to browser") >> spa
spa >> Relationship("API calls [JSON/HTTPS]") >> api
api >> Relationship("reads/writes") >> database
api >> Relationship("Sends email [SMTP]") >> email
api >> Relationship("API calls [XML/HTTPS]") >> mainframe