forked from luantien/c4-as-code-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.dsl
122 lines (110 loc) · 5.83 KB
/
models.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
workspace {
model {
# People/Actors
# <variable> = person <name> <description> <tag>
publicUser = person "Public User" "An anonymous user of the bookstore" "User"
authorizedUser = person "Authorized User" "A registered user of the bookstore, with personal account" "User"
# Software Systems
# <variable> = softwareSystem <name> <description> <tag>
bookstoreSystem = softwareSystem "iBookstore System" "Allows users to view about book, and administrate the book details" "Target System" {
# Level 2: Containers
# <variable> = container <name> <description> <technology> <tag>
searchWebApi = container "Search Web API" "Allows only authorized users searching books records via HTTPS API" "Go"
adminWebApi = container "Admin Web API" "Allows only authorized users administering books details via HTTPS API" "Go" {
# Level 3: Components
# <variable> = component <name> <description> <technology> <tag>
bookService = component "Book Service" "Allows administrating book details" "Go"
authService = component "Authorizer" "Authorize users by using external Authorization System" "Go"
bookEventPublisher = component "Book Events Publisher" "Publishes books-related events to Events Publisher" "Go"
}
publicWebApi = container "Public Web API" "Allows public users getting books information" "Go"
searchDatabase = container "Search Database" "Stores searchable book information" "ElasticSearch" "Database"
bookstoreDatabase = container "Bookstore Database" "Stores book details" "PostgreSQL" "Database"
bookEventStream = container "Book Event Stream" "Handles book-related domain events" "Apache Kafka 3.0"
bookEventConsumer = container "Book Event Consumer" "Listening to domain events and write publisher to Search Database for updating" "Go"
publisherRecurrentUpdater = container "Publisher Recurrent Updater" "Listening to external events from Publisher System, and update book information" "Go"
}
# External Software Systems
authSystem = softwareSystem "Authorization System" "The external Identiy Provider Platform" "External System"
publisherSystem = softwareSystem "Publisher System" "The 3rd party system of publishers that gives details about books published by them" "External System"
# Relationship between People and Software Systems
# <variable> -> <variable> <description> <protocol>
publicUser -> bookstoreSystem "View book information"
authorizedUser -> bookstoreSystem "Search book with more details, administrate books and their details"
bookstoreSystem -> authSystem "Register new user, and authorize user access"
publisherSystem -> bookstoreSystem "Publish events for new book publication, and book information updates" {
tags "Async Request"
}
# Relationship between Containers
publicUser -> publicWebApi "View book information" "JSON/HTTPS"
publicWebApi -> searchDatabase "Retrieve book search data" "ODBC"
authorizedUser -> searchWebApi "Search book with more details" "JSON/HTTPS"
searchWebApi -> authSystem "Authorize user" "JSON/HTTPS"
searchWebApi -> searchDatabase "Retrieve book search data" "ODBC"
authorizedUser -> adminWebApi "Administrate books and their details" "JSON/HTTPS"
adminWebApi -> authSystem "Authorize user" "JSON/HTTPS"
adminWebApi -> bookstoreDatabase "Reads/Write book detail data" "ODBC"
adminWebApi -> bookEventStream "Publish book update events" {
tags "Async Request"
}
bookEventStream -> bookEventConsumer "Consume book update events"
bookEventConsumer -> searchDatabase "Write book search data" "ODBC"
publisherRecurrentUpdater -> adminWebApi "Makes API calls to" "JSON/HTTPS"
# Relationship between Containers and External System
publisherSystem -> publisherRecurrentUpdater "Consume book publication update events" {
tags "Async Request"
}
# Relationship between Components
authorizedUser -> bookService "Administrate book details" "JSON/HTTPS"
publisherRecurrentUpdater -> bookService "Makes API calls to" "JSON/HTTPS"
bookService -> authService "Uses"
bookService -> bookEventPublisher "Uses"
# Relationship between Components and Other Containers
authService -> authSystem "Authorize user permissions" "JSON/HTTPS"
bookService -> bookstoreDatabase "Read/Write data" "ODBC"
bookService -> bookstoreDatabase "Read/Write data" "ODBC"
bookEventPublisher -> bookEventStream "Publish book update events"
}
views {
# Level 1
systemContext bookstoreSystem "SystemContext" {
include *
# default: tb,
# support tb, bt, lr, rl
autoLayout lr
}
# Level 2
container bookstoreSystem "Containers" {
include *
autoLayout lr
}
# Level 3
component adminWebApi "Components" {
include *
autoLayout lr
}
styles {
# element <tag> {}
element "Customer" {
background #08427B
color #ffffff
fontSize 22
shape Person
}
element "External System" {
background #999999
color #ffffff
}
relationship "Relationship" {
dashed false
}
relationship "Async Request" {
dashed true
}
element "Database" {
shape Cylinder
}
}
theme default
}
}