Skip to content

Commit 2240f72

Browse files
Initial pattern catalog.
1 parent 41712d1 commit 2240f72

36 files changed

Lines changed: 799 additions & 0 deletions
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
workspace extends https://docs.structurizr.com/dsl/patterns/workspace.dsl {
2+
3+
model {
4+
ss = softwareSystem "Name" {
5+
ui = container "UI" {
6+
technology "JavaScript"
7+
}
8+
service1 = container "Service 1" {
9+
technology "Java and Spring Boot"
10+
}
11+
service2 = container "Service 2" {
12+
technology "Java and Spring Boot"
13+
}
14+
15+
ui -> service1 "Makes API calls to"
16+
ui -> service2 "Makes API calls to"
17+
}
18+
19+
env = deploymentEnvironment "Environment" {
20+
deploymentNode "User's Computer" {
21+
deploymentNode "Web Browser" {
22+
instanceOf ss.ui
23+
}
24+
}
25+
26+
apiGatewayServer = deploymentNode "API Gateway Server" {
27+
apiGateway = infrastructureNode "API Gateway"
28+
}
29+
30+
server1 = deploymentNode "Server 1" {
31+
deploymentNode "Java Virtual Machine" {
32+
technology "Eclipse Temurin"
33+
34+
instanceof ss.service1
35+
}
36+
}
37+
38+
server2 = deploymentNode "Server 2" {
39+
deploymentNode "Java Virtual Machine" {
40+
technology "Eclipse Temurin"
41+
42+
instanceof ss.service2
43+
}
44+
}
45+
46+
ss.ui -/> ss.service1 {
47+
ss.ui -> apiGatewayServer.apiGateway
48+
apiGatewayServer.apiGateway -> ss.service1
49+
}
50+
51+
ss.ui -/> ss.service2 {
52+
apiGatewayServer.apiGateway -> ss.service2
53+
}
54+
}
55+
}
56+
57+
views {
58+
deployment * env {
59+
include *
60+
autolayout lr 100 100 100
61+
}
62+
63+
styles {
64+
element "Infrastructure Node" {
65+
shape ellipse
66+
}
67+
}
68+
}
69+
70+
}
258 KB
Loading
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
workspace extends https://docs.structurizr.com/dsl/patterns/workspace.dsl {
2+
3+
model {
4+
ss = softwareSystem "Name" {
5+
ui = container "UI" {
6+
technology "JavaScript"
7+
}
8+
service1 = container "Service 1" {
9+
technology "Java and Spring Boot"
10+
}
11+
service2 = container "Service 2" {
12+
technology "Java and Spring Boot"
13+
}
14+
15+
ui -> service1 "Makes API calls to"
16+
ui -> service2 "Makes API calls to"
17+
}
18+
19+
env = deploymentEnvironment "Environment" {
20+
deploymentNode "User's Computer" {
21+
deploymentNode "Web Browser" {
22+
instanceOf ss.ui
23+
}
24+
}
25+
26+
server1 = deploymentNode "Server 1" {
27+
deploymentNode "Java Virtual Machine" {
28+
technology "Eclipse Temurin"
29+
30+
instanceof ss.service1
31+
}
32+
}
33+
34+
server2 = deploymentNode "Server 2" {
35+
deploymentNode "Java Virtual Machine" {
36+
technology "Eclipse Temurin"
37+
38+
instanceof ss.service2
39+
}
40+
}
41+
42+
43+
!relationships "ss.ui -> ss.service1" {
44+
technology "via API Gateway"
45+
}
46+
47+
!relationships "ss.ui -> ss.service2" {
48+
technology "via API Gateway"
49+
}
50+
}
51+
}
52+
53+
views {
54+
deployment * env {
55+
include *
56+
autolayout lr 100 100 100
57+
}
58+
59+
styles {
60+
element "Infrastructure Node" {
61+
shape ellipse
62+
}
63+
}
64+
}
65+
66+
}
201 KB
Loading

dsl/patterns/api-gateway/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
layout: default
3+
title: API gateway
4+
parent: Pattern catalog
5+
grand_parent: DSL
6+
permalink: /dsl/patterns/api-gateway/
7+
---
8+
9+
# API gateway
10+
11+
- An API gateway is _typically_ a deployment concept and should be modelled in your deployment model.
12+
- API gateways can be modelled as a container when (1) you are building your own API gateway, (2) it's required in your development environment, and (3) it's doing more than rate limiting, routing, authentication, etc.
13+
14+
## Example 1
15+
16+
Model the API gateway as an infrastructure node, intercepting the communication between the UI and the backend services.
17+
18+
[![](example-1.png)](https://playground.structurizr.com?src=https://docs.structurizr.com/dsl/patterns/api-gateway/example-1.dsl)
19+
20+
## Example 2
21+
22+
Model the API gateway as an annotation on the relationship between UI and backend services.
23+
24+
[![](example-2.png)](https://playground.structurizr.com?src=https://docs.structurizr.com/dsl/patterns/api-gateway/example-2.dsl)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
workspace extends https://docs.structurizr.com/dsl/patterns/workspace.dsl {
2+
3+
model {
4+
ss = softwareSystem "Name" {
5+
app = container "Application" {
6+
technology "Java and Spring Boot"
7+
}
8+
}
9+
10+
env = deploymentEnvironment "Environment" {
11+
12+
deploymentNode "Amazon Web Services" {
13+
14+
deploymentNode "App Runner" {
15+
16+
deploymentNode "Docker Container" {
17+
instances 2
18+
properties {
19+
"Image URI" "1234567890.dkr.ecr.eu-west-1.amazonaws.com/example/application:latest"
20+
}
21+
22+
deploymentNode "Java Virtual Machine" {
23+
technology "Eclipse Temurin"
24+
25+
instanceof ss.app
26+
}
27+
}
28+
}
29+
}
30+
}
31+
}
32+
33+
views {
34+
deployment * env {
35+
include *
36+
}
37+
}
38+
39+
}
113 KB
Loading
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
workspace extends https://docs.structurizr.com/dsl/patterns/workspace.dsl {
2+
3+
model {
4+
ss = softwareSystem "Name" {
5+
app = container "Application" {
6+
technology "Java and Spring Boot"
7+
}
8+
}
9+
10+
env = deploymentEnvironment "Environment" {
11+
12+
deploymentNode "Amazon Web Services" {
13+
14+
deploymentNode "eu-west-1" {
15+
16+
deploymentNode "App Runner" {
17+
18+
deploymentNode "Docker Container" {
19+
instances 2
20+
properties {
21+
"Image URI" "1234567890.dkr.ecr.eu-west-1.amazonaws.com/example/application:latest"
22+
}
23+
24+
deploymentNode "Java Virtual Machine" {
25+
technology "Eclipse Temurin"
26+
27+
instanceof ss.app
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}
34+
}
35+
36+
views {
37+
deployment * env {
38+
include *
39+
}
40+
}
41+
42+
}
121 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: default
3+
title: AWS App Runner
4+
parent: Pattern catalog
5+
grand_parent: DSL
6+
permalink: /dsl/patterns/aws-app-runner/
7+
---
8+
9+
# Amazon Web Services App Runner
10+
11+
- App Runner is a deployment concept and should be modelled in your deployment model.
12+
- App Runner should _not_ appear on container views.
13+
14+
## Example 1
15+
16+
Model App Runner and the Docker container as deployment nodes.
17+
18+
[![](example-1.png)](https://playground.structurizr.com?src=https://docs.structurizr.com/dsl/patterns/aws-app-runner/example-1.dsl)
19+
20+
## Example 2
21+
22+
As above, but add the AWS region as a deployment node.
23+
24+
[![](example-2.png)](https://playground.structurizr.com?src=https://docs.structurizr.com/dsl/patterns/aws-app-runner/example-2.dsl)
25+

0 commit comments

Comments
 (0)