-
Notifications
You must be signed in to change notification settings - Fork 2
/
workspace.dsl
248 lines (223 loc) · 9.88 KB
/
workspace.dsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
workspace "Government Body" "This is an example workspace to illustrate the key features of Structurizr, via the DSL, based around a fictional online banking system." {
!docs workspace-docs
!adrs workspace-adrs
model {
citizen = person "Citizen" "A member of the public" "Person"
email = softwaresystem "GovNotify" "The Government Service for sending e-maills." "Existing System"
group "Government Body" {
supportStaff = person "Citizen Service Staff" "Citizen service staff within the Government." "Civil Servant Staff" {
properties {
"Location" "Customer Services"
}
}
backoffice = person "Back Office Staff" "Administration and support staff within the bank." "Bank Staff" {
properties {
"Location" "Internal Services"
}
}
bankingSystem = softwaresystem "Banking System" "Stores all of the core banking information about citizens, accounts, transactions, etc." "Existing System"
!include department/department.dsl
}
# relationships between people and software systems
citizen -> department "Views account balances, and makes payments using"
department -> bankingSystem "Gets account information from, and makes payments using"
department -> email "Sends e-mail using"
email -> citizen "Sends e-mails to"
citizen -> supportStaff "Asks questions to" "Telephone"
supportStaff -> bankingSystem "Uses"
backoffice -> bankingSystem "Uses"
# relationships to/from containers
citizen -> webApplication "Visits someservice.gov.uk using" "HTTPS"
citizen -> singlePageApplication "Views account balances, and makes payments using"
citizen -> mobileApp "Views account balances, and makes payments using"
webApplication -> singlePageApplication "Delivers to the citizen's web browser"
# relationships to/from components
singlePageApplication -> signinController "Makes API calls to" "JSON/HTTPS"
singlePageApplication -> accountsSummaryController "Makes API calls to" "JSON/HTTPS"
singlePageApplication -> resetPasswordController "Makes API calls to" "JSON/HTTPS"
mobileApp -> signinController "Makes API calls to" "JSON/HTTPS"
mobileApp -> accountsSummaryController "Makes API calls to" "JSON/HTTPS"
mobileApp -> resetPasswordController "Makes API calls to" "JSON/HTTPS"
signinController -> securityComponent "Uses"
accountsSummaryController -> bankingSystemFacade "Uses"
resetPasswordController -> securityComponent "Uses"
resetPasswordController -> emailComponent "Uses"
securityComponent -> database "Reads from and writes to" "JDBC"
bankingSystemFacade -> bankingSystem "Makes API calls to" "XML/HTTPS"
emailComponent -> email "Sends e-mail using" "JSON/HTTPS"
deploymentEnvironment "Development" {
deploymentNode "Developer Laptop" "" "Microsoft Windows 10 or Apple macOS" {
deploymentNode "Web Browser" "" "Chrome, Firefox, Safari, or Edge" {
developerSinglePageApplicationInstance = containerInstance singlePageApplication
}
deploymentNode "Docker Container - Web Server" "" "Docker" {
deploymentNode "Apache Tomcat" "" "Apache Tomcat 8.x" {
developerWebApplicationInstance = containerInstance webApplication
developerApiApplicationInstance = containerInstance apiApplication
}
}
deploymentNode "Docker Container - Database Server" "" "Docker" {
deploymentNode "Database Server" "" "Oracle 12c" {
developerDatabaseInstance = containerInstance database
}
}
}
deploymentNode "Bank" "" "Bank data center" "" {
deploymentNode "bank-dev001" "" "" "" {
softwareSystemInstance bankingSystem
}
}
}
deploymentEnvironment "Live" {
deploymentNode "Citizen's mobile device" "" "Apple iOS or Android" {
liveMobileAppInstance = containerInstance mobileApp
}
deploymentNode "Citizen's computer" "" "Microsoft Windows or Apple macOS" {
deploymentNode "Web Browser" "" "Chrome, Firefox, Safari, or Edge" {
liveSinglePageApplicationInstance = containerInstance singlePageApplication
}
}
deploymentNode "Bank" "" "Bank data center" {
deploymentNode "bank-web***" "" "Ubuntu 16.04 LTS" "" 4 {
deploymentNode "Apache Tomcat" "" "Apache Tomcat 8.x" {
liveWebApplicationInstance = containerInstance webApplication
}
}
deploymentNode "bank-api***" "" "Ubuntu 16.04 LTS" "" 8 {
deploymentNode "Apache Tomcat" "" "Apache Tomcat 8.x" {
liveApiApplicationInstance = containerInstance apiApplication
}
}
deploymentNode "bank-db01" "" "Ubuntu 16.04 LTS" {
primaryDatabaseServer = deploymentNode "Oracle - Primary" "" "Oracle 12c" {
livePrimaryDatabaseInstance = containerInstance database
}
}
deploymentNode "bank-db02" "" "Ubuntu 16.04 LTS" "Failover" {
secondaryDatabaseServer = deploymentNode "Oracle - Secondary" "" "Oracle 12c" "Failover" {
liveSecondaryDatabaseInstance = containerInstance database "Failover"
}
}
deploymentNode "bank-prod001" "" "" "" {
softwareSystemInstance bankingSystem
}
}
primaryDatabaseServer -> secondaryDatabaseServer "Replicates data to"
}
}
views {
properties {
"c4plantuml.elementProperties" "true"
"structurizr.style.colors.primary" "#485fc7"
"structurizr.style.colors.secondary" "#ffffff"
"structurizr.style.favicon.path" "site/made-tech-logo.png"
"structurizr.style.logo.path" "site/made-tech-logo.png"
}
systemlandscape "SystemLandscape" {
include *
autoLayout
}
systemcontext department "SystemContext" {
include *
animation {
department
citizen
bankingSystem
email
}
autoLayout
}
container department "Containers" {
include *
animation {
citizen bankingSystem email
webApplication
singlePageApplication
mobileApp
apiApplication
database
}
autoLayout
}
component apiApplication "Components" {
include *
animation {
singlePageApplication mobileApp database email bankingSystem
signinController securityComponent
accountsSummaryController bankingSystemFacade
resetPasswordController emailComponent
}
autoLayout
}
dynamic apiApplication "SignIn" "Summarises how the sign in feature works in the single-page application." {
singlePageApplication -> signinController "Submits credentials to"
signinController -> securityComponent "Validates credentials using"
securityComponent -> database "select * from users where username = ?"
database -> securityComponent "Returns user data to"
securityComponent -> signinController "Returns true if the hashed password matches"
signinController -> singlePageApplication "Sends back an authentication token to"
autoLayout
}
deployment department "Development" "DevelopmentDeployment" {
include *
animation {
developerSinglePageApplicationInstance
developerWebApplicationInstance developerApiApplicationInstance
developerDatabaseInstance
}
autoLayout
}
deployment department "Live" "LiveDeployment" {
include *
animation {
liveSinglePageApplicationInstance
liveMobileAppInstance
liveWebApplicationInstance liveApiApplicationInstance
livePrimaryDatabaseInstance
liveSecondaryDatabaseInstance
}
autoLayout
}
styles {
element "Person" {
color #ffffff
fontSize 22
shape Person
}
element "Citizen" {
background #08427b
}
element "Bank Staff" {
background #999999
}
element "Software System" {
background #1168bd
color #ffffff
}
element "Existing System" {
background #999999
color #ffffff
}
element "Container" {
background #438dd5
color #ffffff
}
element "Web Browser" {
shape WebBrowser
}
element "Mobile App" {
shape MobileDeviceLandscape
}
element "Database" {
shape Cylinder
}
element "Component" {
background #85bbf0
color #000000
}
element "Failover" {
opacity 25
}
}
}
}