C4plantuml

Example 1

Container diagram for Internet Banking SystemContainer diagram for Internet Banking SystemInternet Banking[System]Web Application[Java, Spring MVC] Delivers the static contentand the Internet bankingSPASingle-Page App[JavaScript, Angular] Provides all the Internetbanking functionality tocutomers via their webbrowserMobile App[C#, Xamarin] Provides a limited subset ofthe Internet bankingfunctionality to customersvia their mobile deviceDatabase[SQL Database] Stores user registraioninformation, hased authcredentials, access logs,etc.API Application[Java, Docker Container] Provides Internet bankingfunctionality via APICustomer3 A customer of the bank,with personal bankaccountsE-Mail System The internal MicrosoftExchange systemMainframe BankingSystem Stores all of the corebanking information aboutcustomers, accounts,transactions, etc.Uses[HTTPS]Uses[HTTPS]UsesDeliversUses[async, JSON/HTTPS]Uses[async, JSON/HTTPS]Reads from andwrites to[sync, JDBC]Sends e-mails toSends e-mails using[sync, SMTP]Uses[sync/async,XML/HTTPS]Legend personsystemcontainerexternal personexternal systemexternal container
```kroki {_type=c4plantuml}

@startuml
!include C4_Container.puml

LAYOUT_TOP_DOWN()
LAYOUT_WITH_LEGEND()

title Container diagram for Internet Banking System

Person(customer, Customer3, "A customer of the bank, with personal bank accounts")

System_Boundary(c1, "Internet Banking") {
    Container(web_app, "Web Application", "Java, Spring MVC", "Delivers the static content and the Internet banking SPA")
    Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to cutomers via their web browser")
    Container(mobile_app, "Mobile App", "C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device")
    ContainerDb(database, "Database", "SQL Database", "Stores user registraion information, hased auth credentials, access logs, etc.")
    Container(backend_api, "API Application", "Java, Docker Container", "Provides Internet banking functionality via API")
}

System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system")
System_Ext(banking_system, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

Rel(customer, web_app, "Uses", "HTTPS")
Rel(customer, spa, "Uses", "HTTPS")
Rel(customer, mobile_app, "Uses")

Rel_Neighbor(web_app, spa, "Delivers")
Rel(spa, backend_api, "Uses", "async, JSON/HTTPS")
Rel(mobile_app, backend_api, "Uses", "async, JSON/HTTPS")
Rel_Back_Neighbor(database, backend_api, "Reads from and writes to", "sync, JDBC")

Rel_Back(customer, email_system, "Sends e-mails to")
Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP")
Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS")
@enduml
```

Example 2

«person»Label Optional Description«container»Label[Technology] Optional Description«system»Label Optional DescriptionLabel[Optional Technology]
```kroki {_type=c4plantuml}
@startuml C4_Elements
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

Person(personAlias, "Label", "Optional Description")
Container(containerAlias, "Label", "Technology", "Optional Description")
System(systemAlias, "Label", "Optional Description")

Rel(personAlias, containerAlias, "Label", "Optional Technology")
@enduml
```

Example 3

Customer1 People that need products SPA[angular] The main interface that thecustomer interacts with API[java] Handles all business logic Database[Microsoft SQL] Holds product, order andinvoice informationUses[https]Uses[https]Reads/WritesLegend personsystemcontainerexternal personexternal systemexternal container
```kroki {_type=c4plantuml}
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

!define DEVICONS https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/devicons
!define FONTAWESOME https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/font-awesome-5
!include DEVICONS/angular.puml
!include DEVICONS/java.puml
!include DEVICONS/msql_server.puml
!include FONTAWESOME/users.puml

LAYOUT_WITH_LEGEND()

Person(user, "Customer1", "People that need products", $sprite="person")
Container(spa, "SPA", "angular", "The main interface that the customer interacts with", $sprite="angular")
Container(api, "API", "java", "Handles all business logic", $sprite="java")
ContainerDb(db, "Database", "Microsoft SQL", "Holds product, order and invoice information", $sprite="msql_server")

Rel(user, spa, "Uses", "https")
Rel(spa, api, "Uses", "https")
Rel_R(api, db, "Reads/Writes")
@enduml
```