Skip to content

Commit 87a9740

Browse files
authored
Merge pull request #1 from sebastienfi/feat-demo-workspace
Demo for workflow "Update Structurizr Diagrams" referencing the action sebastienfi/structurizr-pr-comment@v1
2 parents c39f001 + 94987d1 commit 87a9740

17 files changed

+269
-0
lines changed

.github/workflows/structurizr-diagrams-comment.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
comment-on-pr:
1212
if: github.event.workflow_run.conclusion == 'success'
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read # Allow to work with the contents of the repository, including git pull.
16+
issues: write # Allow to comment on pull requests.
17+
pull-requests: write # Allow to list and create pr's comments.
1418
steps:
1519
- uses: sebastienfi/structurizr-pr-comment@v1
1620
with:

.github/workflows/structurizr-diagrams-update.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
update-diagrams:
1414
runs-on: ubuntu-latest
1515
container: ghcr.io/sebastienfi/structurizr-cli-with-bonus:latest
16+
permissions:
17+
contents: write # Allow to work with the contents of the repository, including git push.
1618
steps:
1719
- uses: sebastienfi/structurizr-gen-images@v1
1820
with:
14.8 KB
Loading
82.7 KB
Loading
17.4 KB
Loading
90.5 KB
Loading
Loading
Loading
15.9 KB
Loading
119 KB
Loading
9.63 KB
Loading

docs/diagrams/structurizr-SignIn.png

41.2 KB
Loading
Loading
40.1 KB
Loading
Loading
72.8 KB
Loading

docs/workspace.dsl

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
/*
2+
* This is a combined version of the following workspaces, with automatic layout enabled:
3+
*
4+
* - "Big Bank plc - System Landscape" (https://structurizr.com/share/28201/)
5+
* - "Big Bank plc - Internet Banking System" (https://structurizr.com/share/36141/)
6+
*/
7+
workspace "Big Bank plc" "This is an example workspace to illustrate the key features of Structurizr, via the DSL, based around a fictional online banking system." {
8+
9+
model {
10+
customer = person "Personal Banking Customer" "A customer of the bank, with personal bank accounts." "Customer"
11+
12+
group "Big Bank plc" {
13+
supportStaff = person "Customer Service Staff" "Customer service staff within the bank." "Bank Staff"
14+
backoffice = person "Back Office Staff" "Administration and support staff within the bank." "Bank Staff"
15+
16+
mainframe = softwaresystem "Mainframe Banking System" "Stores all of the core banking information about customers, accounts, transactions, etc." "Existing System"
17+
email = softwaresystem "E-mail System" "The internal Microsoft Exchange e-mail system." "Existing System"
18+
atm = softwaresystem "ATM" "Allows customers to withdraw cash." "Existing System"
19+
20+
internetBankingSystem = softwaresystem "Internet Banking System" "Allows customers to view information about their bank accounts, and make payments." {
21+
singlePageApplication = container "Single-Page Application" "Provides all of the Internet banking functionality to customers via their web browser." "JavaScript and Angular" "Web Browser"
22+
mobileApp = container "Mobile App" "Provides a limited subset of the Internet banking functionality to customers via their mobile device." "Xamarin" "Mobile App"
23+
webApplication = container "Web Application" "Delivers the static content and the Internet banking single page application." "Java and Spring MVC"
24+
apiApplication = container "API Application" "Provides Internet banking functionality via a JSON/HTTPS API." "Java and Spring MVC" {
25+
signinController = component "Sign In Controller" "Allows users to sign in to the Internet Banking System." "Spring MVC Rest Controller"
26+
accountsSummaryController = component "Accounts Summary Controller" "Provides customers with a summary of their bank accounts." "Spring MVC Rest Controller"
27+
resetPasswordController = component "Reset Password Controller" "Allows users to reset their passwords with a single use URL." "Spring MVC Rest Controller"
28+
securityComponent = component "Security Component" "Provides functionality related to signing in, changing passwords, etc." "Spring Bean"
29+
mainframeBankingSystemFacade = component "Mainframe Banking System Facade" "A facade onto the mainframe banking system." "Spring Bean"
30+
emailComponent = component "E-mail Component" "Sends e-mails to users." "Spring Bean"
31+
}
32+
database = container "Database" "Stores user registration information, hashed authentication credentials, access logs, etc." "Oracle Database Schema" "Database"
33+
}
34+
}
35+
36+
# relationships between people and software systems
37+
customer -> internetBankingSystem "Views account balances, and makes payments using"
38+
internetBankingSystem -> mainframe "Gets account information from, and makes payments using"
39+
internetBankingSystem -> email "Sends e-mail using"
40+
email -> customer "Sends e-mails to"
41+
customer -> supportStaff "Asks questions to" "Telephone"
42+
supportStaff -> mainframe "Uses"
43+
customer -> atm "Withdraws cash using"
44+
atm -> mainframe "Uses"
45+
backoffice -> mainframe "Uses"
46+
47+
# relationships to/from containers
48+
customer -> webApplication "Visits bigbank.com/ib using" "HTTPS"
49+
customer -> singlePageApplication "Views account balances, and makes payments using"
50+
customer -> mobileApp "Views account balances, and makes payments using"
51+
webApplication -> singlePageApplication "Delivers to the customer's web browser"
52+
53+
# relationships to/from components
54+
singlePageApplication -> signinController "Makes API calls to" "JSON/HTTPS"
55+
singlePageApplication -> accountsSummaryController "Makes API calls to" "JSON/HTTPS"
56+
singlePageApplication -> resetPasswordController "Makes API calls to" "JSON/HTTPS"
57+
mobileApp -> signinController "Makes API calls to" "JSON/HTTPS"
58+
mobileApp -> accountsSummaryController "Makes API calls to" "JSON/HTTPS"
59+
mobileApp -> resetPasswordController "Makes API calls to" "JSON/HTTPS"
60+
signinController -> securityComponent "Uses"
61+
accountsSummaryController -> mainframeBankingSystemFacade "Uses"
62+
resetPasswordController -> securityComponent "Uses"
63+
resetPasswordController -> emailComponent "Uses"
64+
securityComponent -> database "Reads from and writes to" "SQL/TCP"
65+
mainframeBankingSystemFacade -> mainframe "Makes API calls to" "XML/HTTPS"
66+
emailComponent -> email "Sends e-mail using"
67+
68+
deploymentEnvironment "Development" {
69+
deploymentNode "Developer Laptop" "" "Microsoft Windows 10 or Apple macOS" {
70+
deploymentNode "Web Browser" "" "Chrome, Firefox, Safari, or Edge" {
71+
developerSinglePageApplicationInstance = containerInstance singlePageApplication
72+
}
73+
deploymentNode "Docker Container - Web Server" "" "Docker" {
74+
deploymentNode "Apache Tomcat" "" "Apache Tomcat 8.x" {
75+
developerWebApplicationInstance = containerInstance webApplication
76+
developerApiApplicationInstance = containerInstance apiApplication
77+
}
78+
}
79+
deploymentNode "Docker Container - Database Server" "" "Docker" {
80+
deploymentNode "Database Server" "" "Oracle 12c" {
81+
developerDatabaseInstance = containerInstance database
82+
}
83+
}
84+
}
85+
deploymentNode "Big Bank plc" "" "Big Bank plc data center" "" {
86+
deploymentNode "bigbank-dev001" "" "" "" {
87+
softwareSystemInstance mainframe
88+
}
89+
}
90+
91+
}
92+
93+
deploymentEnvironment "Live" {
94+
deploymentNode "Customer's mobile device" "" "Apple iOS or Android" {
95+
liveMobileAppInstance = containerInstance mobileApp
96+
}
97+
deploymentNode "Customer's computer" "" "Microsoft Windows or Apple macOS" {
98+
deploymentNode "Web Browser" "" "Chrome, Firefox, Safari, or Edge" {
99+
liveSinglePageApplicationInstance = containerInstance singlePageApplication
100+
}
101+
}
102+
103+
deploymentNode "Big Bank plc" "" "Big Bank plc data center" {
104+
deploymentNode "bigbank-web***" "" "Ubuntu 16.04 LTS" "" 4 {
105+
deploymentNode "Apache Tomcat" "" "Apache Tomcat 8.x" {
106+
liveWebApplicationInstance = containerInstance webApplication
107+
}
108+
}
109+
deploymentNode "bigbank-api***" "" "Ubuntu 16.04 LTS" "" 8 {
110+
deploymentNode "Apache Tomcat" "" "Apache Tomcat 8.x" {
111+
liveApiApplicationInstance = containerInstance apiApplication
112+
}
113+
}
114+
115+
deploymentNode "bigbank-db01" "" "Ubuntu 16.04 LTS" {
116+
primaryDatabaseServer = deploymentNode "Oracle - Primary" "" "Oracle 12c" {
117+
livePrimaryDatabaseInstance = containerInstance database
118+
}
119+
}
120+
deploymentNode "bigbank-db02" "" "Ubuntu 16.04 LTS" "Failover" {
121+
secondaryDatabaseServer = deploymentNode "Oracle - Secondary" "" "Oracle 12c" "Failover" {
122+
liveSecondaryDatabaseInstance = containerInstance database "Failover"
123+
}
124+
}
125+
deploymentNode "bigbank-prod001" "" "" "" {
126+
softwareSystemInstance mainframe
127+
}
128+
}
129+
130+
primaryDatabaseServer -> secondaryDatabaseServer "Replicates data to"
131+
}
132+
}
133+
134+
views {
135+
systemlandscape "SystemLandscape" {
136+
include *
137+
autoLayout
138+
}
139+
140+
systemcontext internetBankingSystem "SystemContext" {
141+
include *
142+
animation {
143+
internetBankingSystem
144+
customer
145+
mainframe
146+
email
147+
}
148+
autoLayout
149+
description "The system context diagram for the Internet Banking System."
150+
properties {
151+
structurizr.groups false
152+
}
153+
}
154+
155+
container internetBankingSystem "Containers" {
156+
include *
157+
animation {
158+
customer mainframe email
159+
webApplication
160+
singlePageApplication
161+
mobileApp
162+
apiApplication
163+
database
164+
}
165+
autoLayout
166+
description "The container diagram for the Internet Banking System."
167+
}
168+
169+
component apiApplication "Components" {
170+
include *
171+
animation {
172+
singlePageApplication mobileApp database email mainframe
173+
signinController securityComponent
174+
accountsSummaryController mainframeBankingSystemFacade
175+
resetPasswordController emailComponent
176+
}
177+
autoLayout
178+
description "The component diagram for the API Application."
179+
}
180+
181+
image mainframeBankingSystemFacade "MainframeBankingSystemFacade" {
182+
image https://raw.githubusercontent.com/structurizr/examples/main/dsl/big-bank-plc/internet-banking-system/mainframe-banking-system-facade.png
183+
title "[Code] Mainframe Banking System Facade"
184+
}
185+
186+
dynamic apiApplication "SignIn" "Summarises how the sign in feature works in the single-page application." {
187+
singlePageApplication -> signinController "Submits credentials to"
188+
signinController -> securityComponent "Validates credentials using"
189+
securityComponent -> database "select * from users where username = ?"
190+
database -> securityComponent "Returns user data to"
191+
securityComponent -> signinController "Returns true if the hashed password matches"
192+
signinController -> singlePageApplication "Sends back an authentication token to"
193+
autoLayout
194+
description "Summarises how the sign in feature works in the single-page application."
195+
}
196+
197+
deployment internetBankingSystem "Development" "DevelopmentDeployment" {
198+
include *
199+
animation {
200+
developerSinglePageApplicationInstance
201+
developerWebApplicationInstance developerApiApplicationInstance
202+
developerDatabaseInstance
203+
}
204+
autoLayout
205+
description "An example development deployment scenario for the Internet Banking System."
206+
}
207+
208+
deployment internetBankingSystem "Live" "LiveDeployment" {
209+
include *
210+
animation {
211+
liveSinglePageApplicationInstance
212+
liveMobileAppInstance
213+
liveWebApplicationInstance liveApiApplicationInstance
214+
livePrimaryDatabaseInstance
215+
liveSecondaryDatabaseInstance
216+
}
217+
autoLayout
218+
description "An example live deployment scenario for the Internet Banking System."
219+
}
220+
221+
styles {
222+
element "Person" {
223+
color #ffffff
224+
fontSize 22
225+
shape Person
226+
}
227+
element "Customer" {
228+
background #08427b
229+
}
230+
element "Bank Staff" {
231+
background #999999
232+
}
233+
element "Software System" {
234+
background #1168bd
235+
color #ffffff
236+
}
237+
element "Existing System" {
238+
background #999999
239+
color #ffffff
240+
}
241+
element "Container" {
242+
background #438dd5
243+
color #ffffff
244+
}
245+
element "Web Browser" {
246+
shape WebBrowser
247+
}
248+
element "Mobile App" {
249+
shape MobileDeviceLandscape
250+
}
251+
element "Database" {
252+
shape Cylinder
253+
}
254+
element "Component" {
255+
background #85bbf0
256+
color #000000
257+
}
258+
element "Failover" {
259+
opacity 25
260+
}
261+
}
262+
}
263+
}

0 commit comments

Comments
 (0)