C4 Diagram Examples

5 systems illustrated across all 4 levels of the C4 model

← Back to Home

Shows the system in context: who uses it and which external systems it interacts with.

flowchart TB customer["Personal Banking Customer"] staff["Bank Staff"] onlineBanking["Online Banking System"] email["E-mail System"] mainframe["Mainframe Banking System"] customer -- "Views account balances and makes payments using" --> onlineBanking staff -- "Manages customer accounts and support requests using" --> onlineBanking onlineBanking -- "Sends e-mail notifications using" --> email onlineBanking -- "Gets account and transaction data from" --> mainframe

Zooms in on the system to show the containers (applications and data stores) that make it up.

flowchart TB customer["Personal Banking Customer"] webApp["Web Application"] mobileApp["Mobile App"] spa["Single-Page App"] apiApp["API Application"] db["Database"] email["E-mail System"] mainframe["Mainframe Banking System"] customer -- "Visits" --> webApp customer -- "Uses" --> mobileApp webApp -- "Delivers" --> spa spa -- "Makes API calls to" --> apiApp mobileApp -- "Makes API calls to" --> apiApp apiApp -- "Reads/writes" --> db apiApp -- "Sends emails using" --> email apiApp -- "Reads/writes account data" --> mainframe

Zooms in on a key container to show the components (services and controllers) inside it.

flowchart TB clients["Client Applications"] paymentsController["Payments Controller"] accountsController["Accounts Controller"] authController["Auth Controller"] paymentsService["Payments Service"] accountsService["Accounts Service"] authService["Auth Service"] emailService["E-mail Service"] mainframe["Mainframe Banking System"] db["Database"] email["E-mail System"] clients -- "Calls" --> paymentsController clients -- "Calls" --> accountsController clients -- "Calls" --> authController paymentsController -- "Uses" --> paymentsService accountsController -- "Uses" --> accountsService authController -- "Uses" --> authService paymentsService -- "Uses" --> emailService paymentsService -- "Submits payments to" --> mainframe accountsService -- "Reads account data from" --> mainframe accountsService -- "Reads/writes" --> db authService -- "Reads/writes" --> db emailService -- "Sends e-mail using" --> email

Zooms in on a key component to show the classes and interfaces that implement it.

flowchart TB ctrl["AccountsController"] svc["AccountsService"] repo["AccountsRepository"] mf["MainframeClient"] account["Account"] tx["Transaction"] ctrl -- "uses" --> svc svc -- "uses" --> repo svc -- "uses" --> mf repo -- "returns" --> account repo -- "returns" --> tx mf -- "returns" --> account