@diagrammo/dgmo 0.8.3 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/dgmo-diagram-this.md +60 -0
- package/.claude/commands/dgmo-document-project.md +128 -0
- package/.claude/commands/dgmo.md +452 -50
- package/.cursorrules +32 -37
- package/.github/copilot-instructions.md +35 -44
- package/.windsurfrules +32 -37
- package/README.md +4 -4
- package/dist/cli.cjs +188 -185
- package/dist/editor.cjs +338 -0
- package/dist/editor.cjs.map +1 -0
- package/dist/editor.d.cts +27 -0
- package/dist/editor.d.ts +27 -0
- package/dist/editor.js +307 -0
- package/dist/editor.js.map +1 -0
- package/dist/highlight.cjs +560 -0
- package/dist/highlight.cjs.map +1 -0
- package/dist/highlight.d.cts +32 -0
- package/dist/highlight.d.ts +32 -0
- package/dist/highlight.js +530 -0
- package/dist/highlight.js.map +1 -0
- package/dist/index.cjs +3467 -1078
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +3466 -1078
- package/dist/index.js.map +1 -1
- package/docs/language-reference.md +46 -37
- package/gallery/fixtures/arc.dgmo +18 -0
- package/gallery/fixtures/area.dgmo +19 -0
- package/gallery/fixtures/bar-stacked.dgmo +10 -0
- package/gallery/fixtures/bar.dgmo +10 -0
- package/gallery/fixtures/c4-full.dgmo +52 -0
- package/gallery/fixtures/c4.dgmo +17 -0
- package/gallery/fixtures/chord.dgmo +12 -0
- package/gallery/fixtures/class-basic.dgmo +14 -0
- package/gallery/fixtures/class-full.dgmo +43 -0
- package/gallery/fixtures/doughnut.dgmo +8 -0
- package/gallery/fixtures/flowchart-basic.dgmo +3 -0
- package/gallery/fixtures/flowchart-colors.dgmo +5 -0
- package/gallery/fixtures/flowchart-complex.dgmo +17 -0
- package/gallery/fixtures/flowchart-decision.dgmo +5 -0
- package/gallery/fixtures/flowchart-full.dgmo +13 -0
- package/gallery/fixtures/flowchart-groups.dgmo +10 -0
- package/gallery/fixtures/flowchart-loop.dgmo +7 -0
- package/gallery/fixtures/flowchart-nested.dgmo +7 -0
- package/gallery/fixtures/flowchart-shapes.dgmo +5 -0
- package/gallery/fixtures/function.dgmo +8 -0
- package/gallery/fixtures/funnel.dgmo +7 -0
- package/gallery/fixtures/gantt-full.dgmo +49 -0
- package/gallery/fixtures/gantt.dgmo +42 -0
- package/gallery/fixtures/heatmap.dgmo +8 -0
- package/gallery/fixtures/infra-full.dgmo +78 -0
- package/gallery/fixtures/infra-overload.dgmo +25 -0
- package/gallery/fixtures/infra.dgmo +47 -0
- package/gallery/fixtures/initiative-status-full.dgmo +46 -0
- package/gallery/fixtures/initiative-status-phases.dgmo +29 -0
- package/gallery/fixtures/initiative-status.dgmo +9 -0
- package/gallery/fixtures/line.dgmo +19 -0
- package/gallery/fixtures/multi-line.dgmo +11 -0
- package/gallery/fixtures/org-basic.dgmo +16 -0
- package/gallery/fixtures/org-full.dgmo +69 -0
- package/gallery/fixtures/org-teams.dgmo +25 -0
- package/gallery/fixtures/pie.dgmo +9 -0
- package/gallery/fixtures/polar-area.dgmo +8 -0
- package/gallery/fixtures/quadrant.dgmo +18 -0
- package/gallery/fixtures/radar.dgmo +8 -0
- package/gallery/fixtures/sankey.dgmo +31 -0
- package/gallery/fixtures/scatter.dgmo +21 -0
- package/gallery/fixtures/sequence-tags-protocols.dgmo +45 -0
- package/gallery/fixtures/sequence-tags.dgmo +41 -0
- package/gallery/fixtures/sequence.dgmo +35 -0
- package/gallery/fixtures/sitemap-basic.dgmo +12 -0
- package/gallery/fixtures/sitemap-full.dgmo +156 -0
- package/gallery/fixtures/slope.dgmo +9 -0
- package/gallery/fixtures/spr-eras.dgmo +62 -0
- package/gallery/fixtures/state.dgmo +30 -0
- package/gallery/fixtures/timeline-intraday.dgmo +14 -0
- package/gallery/fixtures/timeline.dgmo +32 -0
- package/gallery/fixtures/venn.dgmo +10 -0
- package/gallery/fixtures/wordcloud.dgmo +24 -0
- package/package.json +71 -2
- package/src/c4/layout.ts +372 -90
- package/src/c4/parser.ts +100 -55
- package/src/chart.ts +91 -28
- package/src/class/parser.ts +41 -12
- package/src/cli.ts +211 -62
- package/src/completion.ts +378 -183
- package/src/d3.ts +1044 -303
- package/src/dgmo-mermaid.ts +16 -13
- package/src/dgmo-router.ts +69 -23
- package/src/echarts.ts +646 -153
- package/src/editor/dgmo.grammar +69 -0
- package/src/editor/dgmo.grammar.d.ts +2 -0
- package/src/editor/dgmo.grammar.js +18 -0
- package/src/editor/dgmo.grammar.terms.d.ts +5 -0
- package/src/editor/dgmo.grammar.terms.js +35 -0
- package/src/editor/highlight-api.ts +444 -0
- package/src/editor/highlight.ts +36 -0
- package/src/editor/index.ts +28 -0
- package/src/editor/keywords.ts +222 -0
- package/src/editor/tokens.ts +30 -0
- package/src/er/parser.ts +48 -14
- package/src/er/renderer.ts +112 -53
- package/src/gantt/calculator.ts +91 -29
- package/src/gantt/parser.ts +197 -71
- package/src/gantt/renderer.ts +1120 -350
- package/src/graph/flowchart-parser.ts +46 -25
- package/src/graph/state-parser.ts +47 -17
- package/src/index.ts +96 -31
- package/src/infra/parser.ts +157 -53
- package/src/infra/renderer.ts +723 -271
- package/src/initiative-status/parser.ts +138 -44
- package/src/kanban/parser.ts +25 -14
- package/src/org/layout.ts +111 -44
- package/src/org/parser.ts +69 -22
- package/src/palettes/index.ts +3 -2
- package/src/sequence/parser.ts +193 -61
- package/src/sitemap/parser.ts +65 -29
- package/src/utils/arrows.ts +2 -22
- package/src/utils/duration.ts +39 -21
- package/src/utils/legend-constants.ts +0 -2
- package/src/utils/parsing.ts +75 -31
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
infra Microservice Overload Demo
|
|
2
|
+
direction-tb
|
|
3
|
+
|
|
4
|
+
edge
|
|
5
|
+
rps: 8000
|
|
6
|
+
-> Gateway
|
|
7
|
+
|
|
8
|
+
Gateway
|
|
9
|
+
ratelimit-rps: 5000
|
|
10
|
+
-> AuthProxy
|
|
11
|
+
|
|
12
|
+
AuthProxy
|
|
13
|
+
cache-hit: 60%
|
|
14
|
+
-> [Services]
|
|
15
|
+
|
|
16
|
+
[Services]
|
|
17
|
+
OrderAPI
|
|
18
|
+
instances: 2
|
|
19
|
+
max-rps: 400
|
|
20
|
+
latency-ms: 80
|
|
21
|
+
cb-error-threshold: 60%
|
|
22
|
+
PaymentAPI
|
|
23
|
+
instances: 1
|
|
24
|
+
max-rps: 200
|
|
25
|
+
latency-ms: 150
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
infra Production Traffic Flow
|
|
2
|
+
|
|
3
|
+
tag Team alias t
|
|
4
|
+
Backend(blue)
|
|
5
|
+
Platform(teal)
|
|
6
|
+
|
|
7
|
+
edge
|
|
8
|
+
rps: 10000
|
|
9
|
+
-> CloudFront
|
|
10
|
+
|
|
11
|
+
CloudFront is a network | t: Platform
|
|
12
|
+
description: CDN — edge cache for assets and API responses
|
|
13
|
+
cache-hit: 80%
|
|
14
|
+
-> CloudArmor
|
|
15
|
+
|
|
16
|
+
CloudArmor is a gateway | t: Platform
|
|
17
|
+
description: WAF — blocks bots and malicious traffic
|
|
18
|
+
firewall-block: 5%
|
|
19
|
+
-> ALB
|
|
20
|
+
|
|
21
|
+
ALB is a gateway | t: Platform
|
|
22
|
+
-/api-> [API Pods] | split: 60%
|
|
23
|
+
-/purchase-> [Commerce Pods] | split: 30%
|
|
24
|
+
-/static-> StaticServer | split: 10%
|
|
25
|
+
|
|
26
|
+
[API Pods]
|
|
27
|
+
APIServer is a service | t: Backend
|
|
28
|
+
description: Core REST API — auth, orders, user profiles
|
|
29
|
+
instances: 3
|
|
30
|
+
max-rps: 500
|
|
31
|
+
latency-ms: 45
|
|
32
|
+
cb-error-threshold: 50%
|
|
33
|
+
~events~> MessageQueue
|
|
34
|
+
|
|
35
|
+
[Commerce Pods]
|
|
36
|
+
PurchaseMS is a service
|
|
37
|
+
description: Checkout and payment processing
|
|
38
|
+
instances: 1-8
|
|
39
|
+
max-rps: 300
|
|
40
|
+
latency-ms: 120
|
|
41
|
+
|
|
42
|
+
MessageQueue is a queue | t: Platform
|
|
43
|
+
description: Async event bus for order notifications
|
|
44
|
+
|
|
45
|
+
StaticServer is a storage | t: Platform
|
|
46
|
+
description: Serves static assets (JS, CSS, images)
|
|
47
|
+
latency-ms: 5
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
initiative-status Platform Modernization — Full Status
|
|
2
|
+
|
|
3
|
+
tag Phase alias p
|
|
4
|
+
Discovery(green) default
|
|
5
|
+
Build(blue)
|
|
6
|
+
Launch(orange)
|
|
7
|
+
Maintenance(purple)
|
|
8
|
+
|
|
9
|
+
tag Team alias t
|
|
10
|
+
Frontend(blue)
|
|
11
|
+
Backend(green)
|
|
12
|
+
Platform(teal)
|
|
13
|
+
Data(purple)
|
|
14
|
+
|
|
15
|
+
[Identity] | t: Backend
|
|
16
|
+
Auth Service | done, p: Build
|
|
17
|
+
SSO Integration | doing, p: Build
|
|
18
|
+
-> Auth Service | done
|
|
19
|
+
MFA Rollout | blocked, p: Launch
|
|
20
|
+
-> SSO Integration | doing
|
|
21
|
+
|
|
22
|
+
[Payments] | t: Platform
|
|
23
|
+
Payment Gateway | doing, p: Build
|
|
24
|
+
Billing UI | todo, p: Build, t: Frontend
|
|
25
|
+
-> Payment Gateway | doing
|
|
26
|
+
Invoice API | todo, p: Launch
|
|
27
|
+
-> Payment Gateway | doing
|
|
28
|
+
-> Billing UI | todo
|
|
29
|
+
|
|
30
|
+
[Search] | t: Backend
|
|
31
|
+
Search API | done, p: Build
|
|
32
|
+
Search UI | doing, p: Build, t: Frontend
|
|
33
|
+
-> Search API | done
|
|
34
|
+
Search Analytics | na, p: Maintenance, t: Data
|
|
35
|
+
|
|
36
|
+
[Observability] | t: Platform
|
|
37
|
+
Metrics Pipeline | done, p: Discovery
|
|
38
|
+
Alert Rules | done, p: Build
|
|
39
|
+
-> Metrics Pipeline | done
|
|
40
|
+
Dashboard | doing, p: Build, t: Frontend
|
|
41
|
+
-> Metrics Pipeline | done
|
|
42
|
+
-> Alert Rules | done
|
|
43
|
+
|
|
44
|
+
Auth Service -> Payment Gateway: validates | done
|
|
45
|
+
SSO Integration -> Search API: provides identity | done
|
|
46
|
+
Metrics Pipeline -> Search API: monitors | done
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
initiative-status Platform Migration
|
|
2
|
+
|
|
3
|
+
tag Phase alias p
|
|
4
|
+
Discovery default
|
|
5
|
+
Build
|
|
6
|
+
Launch
|
|
7
|
+
|
|
8
|
+
tag Team alias t
|
|
9
|
+
Frontend
|
|
10
|
+
Backend
|
|
11
|
+
Platform
|
|
12
|
+
|
|
13
|
+
[Identity]
|
|
14
|
+
Auth Service | done, p: Discovery, t: Backend
|
|
15
|
+
SSO Integration | doing, p: Build, t: Backend
|
|
16
|
+
-> Auth Service | done
|
|
17
|
+
|
|
18
|
+
[Payments]
|
|
19
|
+
Payment Gateway | doing, p: Build, t: Platform
|
|
20
|
+
Billing UI | todo, p: Build, t: Frontend
|
|
21
|
+
-> Payment Gateway | doing
|
|
22
|
+
|
|
23
|
+
[Search]
|
|
24
|
+
Search API | todo, p: Launch, t: Backend
|
|
25
|
+
Search UI | todo, p: Launch, t: Frontend
|
|
26
|
+
-> Search API
|
|
27
|
+
|
|
28
|
+
Auth Service -> Payment Gateway: validates | done
|
|
29
|
+
SSO Integration -> Search API: provides identity | todo
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
line Daily Active Users (Q1 2025)
|
|
2
|
+
x-label Week
|
|
3
|
+
y-label Users (thousands)
|
|
4
|
+
|
|
5
|
+
era Week 1 -> Week 6 Phase 1 (blue)
|
|
6
|
+
era Week 6 -> Week 12 Phase 2 (green)
|
|
7
|
+
|
|
8
|
+
Week 1 12.4
|
|
9
|
+
Week 2 13.1
|
|
10
|
+
Week 3 14.8
|
|
11
|
+
Week 4 13.9
|
|
12
|
+
Week 5 16.2
|
|
13
|
+
Week 6 17.5
|
|
14
|
+
Week 7 18.1
|
|
15
|
+
Week 8 19.3
|
|
16
|
+
Week 9 21.0
|
|
17
|
+
Week 10 22.4
|
|
18
|
+
Week 11 24.1
|
|
19
|
+
Week 12 23.8
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
multi-line Quarterly Revenue vs Operating Cost
|
|
2
|
+
x-label Quarter
|
|
3
|
+
y-label Amount ($M)
|
|
4
|
+
|
|
5
|
+
series Revenue (blue), Operating Cost (red), Net Profit (green)
|
|
6
|
+
Q1 2023 4.2, 3.1, 1.1
|
|
7
|
+
Q2 2023 4.8, 3.3, 1.5
|
|
8
|
+
Q3 2023 5.1, 3.5, 1.6
|
|
9
|
+
Q4 2023 5.9, 3.7, 2.2
|
|
10
|
+
Q1 2024 6.3, 3.9, 2.4
|
|
11
|
+
Q2 2024 7.1, 4.2, 2.9
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
org Acme Corp
|
|
2
|
+
|
|
3
|
+
tag Location
|
|
4
|
+
NY(blue)
|
|
5
|
+
LA(yellow)
|
|
6
|
+
CO(green)
|
|
7
|
+
Remote(purple)
|
|
8
|
+
|
|
9
|
+
tag Status
|
|
10
|
+
FTE(green)
|
|
11
|
+
Contractor(orange)
|
|
12
|
+
|
|
13
|
+
Jane Smith
|
|
14
|
+
role: CEO
|
|
15
|
+
location: NY
|
|
16
|
+
status: FTE
|
|
17
|
+
|
|
18
|
+
Alex Chen
|
|
19
|
+
role: CTO
|
|
20
|
+
location: LA
|
|
21
|
+
status: FTE
|
|
22
|
+
|
|
23
|
+
[Platform Team]
|
|
24
|
+
goal: Core infrastructure and APIs
|
|
25
|
+
charter: Platform reliability and developer experience
|
|
26
|
+
|
|
27
|
+
Alice Park
|
|
28
|
+
role: Senior Engineer
|
|
29
|
+
focus: APIs
|
|
30
|
+
location: NY
|
|
31
|
+
status: FTE
|
|
32
|
+
Bob Torres
|
|
33
|
+
role: Junior Engineer
|
|
34
|
+
location: CO
|
|
35
|
+
status: FTE
|
|
36
|
+
|
|
37
|
+
[Frontend Team]
|
|
38
|
+
goal: Ship new design system by Q3
|
|
39
|
+
|
|
40
|
+
Carol Wu
|
|
41
|
+
role: Senior Engineer
|
|
42
|
+
location: Remote
|
|
43
|
+
status: FTE
|
|
44
|
+
Dave Kim
|
|
45
|
+
role: Junior Engineer
|
|
46
|
+
location: LA
|
|
47
|
+
status: Contractor
|
|
48
|
+
|
|
49
|
+
Maria Lopez
|
|
50
|
+
role: Head of Design
|
|
51
|
+
location: LA
|
|
52
|
+
status: FTE
|
|
53
|
+
|
|
54
|
+
Frank Lee
|
|
55
|
+
role: Senior Designer
|
|
56
|
+
location: Remote
|
|
57
|
+
status: Contractor
|
|
58
|
+
|
|
59
|
+
Sam Wilson
|
|
60
|
+
role: VP of Sales
|
|
61
|
+
location: NY
|
|
62
|
+
status: FTE
|
|
63
|
+
|
|
64
|
+
Tom Brown
|
|
65
|
+
role: Account Executive
|
|
66
|
+
location: NY
|
|
67
|
+
Lisa Park
|
|
68
|
+
role: Account Executive
|
|
69
|
+
location: CO
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
org Engineering Division
|
|
2
|
+
|
|
3
|
+
Alex Chen
|
|
4
|
+
role: CTO
|
|
5
|
+
|
|
6
|
+
[Platform Team]
|
|
7
|
+
goal: Core infrastructure and APIs
|
|
8
|
+
charter: Platform reliability and developer experience
|
|
9
|
+
|
|
10
|
+
Alice Park | role: Senior Engineer | location: NY
|
|
11
|
+
Bob Torres | role: Junior Engineer | location: CO
|
|
12
|
+
|
|
13
|
+
[Frontend Team]
|
|
14
|
+
goal: Ship new design system by Q3
|
|
15
|
+
|
|
16
|
+
Carol Wu
|
|
17
|
+
role: Senior Engineer
|
|
18
|
+
Dave Kim
|
|
19
|
+
role: Junior Engineer
|
|
20
|
+
|
|
21
|
+
[Data Team]
|
|
22
|
+
goal: ML pipeline and analytics
|
|
23
|
+
|
|
24
|
+
Eve Martinez
|
|
25
|
+
role: Data Scientist
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
quadrant Feature Prioritization Matrix
|
|
2
|
+
|
|
3
|
+
x-label Low Effort, High Effort
|
|
4
|
+
y-label Low Impact, High Impact
|
|
5
|
+
|
|
6
|
+
top-left Quick Wins
|
|
7
|
+
top-right Major Projects
|
|
8
|
+
bottom-left Fill-ins
|
|
9
|
+
bottom-right Avoid
|
|
10
|
+
|
|
11
|
+
Dark Mode (blue) 0.25, 0.85
|
|
12
|
+
API v2 (red) 0.8, 0.9
|
|
13
|
+
Fix Typos 0.1, 0.15
|
|
14
|
+
SSO Integration 0.75, 0.7
|
|
15
|
+
Export CSV 0.3, 0.6
|
|
16
|
+
Refactor Auth 0.85, 0.3
|
|
17
|
+
Add Tooltips 0.15, 0.45
|
|
18
|
+
Mobile App 0.9, 0.95
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
sankey Website Traffic Flow
|
|
2
|
+
|
|
3
|
+
// Source channels — colored by type
|
|
4
|
+
Organic Search (green)
|
|
5
|
+
Landing Page 450
|
|
6
|
+
Paid Ads (orange)
|
|
7
|
+
Landing Page 280
|
|
8
|
+
Social Media (blue)
|
|
9
|
+
Landing Page 180
|
|
10
|
+
Email (purple)
|
|
11
|
+
Landing Page 120
|
|
12
|
+
Direct (teal)
|
|
13
|
+
Landing Page 90
|
|
14
|
+
|
|
15
|
+
// Engagement & Conversion
|
|
16
|
+
Landing Page
|
|
17
|
+
Sign Up 340
|
|
18
|
+
Browse Products 520
|
|
19
|
+
Bounce 260 (red)
|
|
20
|
+
|
|
21
|
+
Sign Up
|
|
22
|
+
Free Trial 240
|
|
23
|
+
Paid Plan 100
|
|
24
|
+
|
|
25
|
+
Browse Products
|
|
26
|
+
Add to Cart 310
|
|
27
|
+
Exit 210 (red)
|
|
28
|
+
|
|
29
|
+
Add to Cart
|
|
30
|
+
Purchase (green) 220
|
|
31
|
+
Abandon 90 (red)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
scatter Startup Funding vs Revenue
|
|
2
|
+
x-label Funding ($M)
|
|
3
|
+
y-label Annual Revenue ($M)
|
|
4
|
+
|
|
5
|
+
[SaaS](blue)
|
|
6
|
+
Acme Cloud 12, 8.5
|
|
7
|
+
DataSync 5.2, 3.1
|
|
8
|
+
CloudOps 25, 18.4
|
|
9
|
+
PlatformX 8, 5.7
|
|
10
|
+
NexGen 3.5, 1.2
|
|
11
|
+
|
|
12
|
+
[Fintech](green)
|
|
13
|
+
PayFlow 45, 32
|
|
14
|
+
LendTech 18, 12.5
|
|
15
|
+
CoinBase+ 60, 41
|
|
16
|
+
QuickPay 9, 6.8
|
|
17
|
+
|
|
18
|
+
[HealthTech](red)
|
|
19
|
+
MediScan 15, 7.2
|
|
20
|
+
HealthAI 22, 14.1
|
|
21
|
+
CareLink 7, 3.8
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
sequence Order Fulfillment — Protocols & Ownership
|
|
2
|
+
active-tag Protocol
|
|
3
|
+
|
|
4
|
+
tag Protocol alias p
|
|
5
|
+
REST(blue)
|
|
6
|
+
gRPC(green)
|
|
7
|
+
Async(orange)
|
|
8
|
+
SQL(purple)
|
|
9
|
+
|
|
10
|
+
tag Owner alias o
|
|
11
|
+
Checkout(teal)
|
|
12
|
+
Fulfillment(orange)
|
|
13
|
+
Payments(red)
|
|
14
|
+
Data(blue)
|
|
15
|
+
|
|
16
|
+
Buyer is an actor
|
|
17
|
+
CheckoutSvc is a service | o: Checkout
|
|
18
|
+
InventorySvc is a service | o: Fulfillment
|
|
19
|
+
PaymentSvc is a service | o: Payments
|
|
20
|
+
OrderDB is a database | o: Data
|
|
21
|
+
EventBus is a queue
|
|
22
|
+
|
|
23
|
+
== Place Order ==
|
|
24
|
+
Buyer -POST /checkout-> CheckoutSvc | p: REST
|
|
25
|
+
CheckoutSvc -reserveItems(skus)-> InventorySvc | p: gRPC
|
|
26
|
+
InventorySvc -UPDATE stock-> OrderDB | p: SQL
|
|
27
|
+
OrderDB -ok-> InventorySvc
|
|
28
|
+
InventorySvc -reserved-> CheckoutSvc
|
|
29
|
+
|
|
30
|
+
== Payment ==
|
|
31
|
+
CheckoutSvc -charge(amount)-> PaymentSvc | p: REST
|
|
32
|
+
PaymentSvc -confirmed-> CheckoutSvc
|
|
33
|
+
|
|
34
|
+
== Fulfillment ==
|
|
35
|
+
CheckoutSvc -INSERT order-> OrderDB | p: SQL
|
|
36
|
+
CheckoutSvc ~OrderPlaced~> EventBus | p: Async
|
|
37
|
+
|
|
38
|
+
parallel Notify
|
|
39
|
+
EventBus ~fulfill~> InventorySvc | p: Async
|
|
40
|
+
EventBus ~analytics~> OrderDB | p: Async
|
|
41
|
+
|
|
42
|
+
InventorySvc -createShipment-> InventorySvc
|
|
43
|
+
InventorySvc ~ShipmentCreated~> EventBus | p: Async
|
|
44
|
+
EventBus ~shipment update~> CheckoutSvc | p: Async
|
|
45
|
+
CheckoutSvc -shipment confirmation-> Buyer | p: REST
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
sequence API Gateway — Infrastructure Concerns
|
|
2
|
+
active-tag Concern
|
|
3
|
+
|
|
4
|
+
tag Concern alias c
|
|
5
|
+
Caching(blue)
|
|
6
|
+
Auth(green)
|
|
7
|
+
RateLimiting(orange)
|
|
8
|
+
BusinessLogic(purple) default
|
|
9
|
+
|
|
10
|
+
tag Team alias t
|
|
11
|
+
Platform(teal)
|
|
12
|
+
Product(orange)
|
|
13
|
+
Security(red)
|
|
14
|
+
|
|
15
|
+
Mobile is an actor
|
|
16
|
+
Gateway is a gateway | t: Platform
|
|
17
|
+
Redis is a cache | c: Caching, t: Platform
|
|
18
|
+
|
|
19
|
+
[Backend] | t: Product
|
|
20
|
+
UserAPI is a service
|
|
21
|
+
OrderAPI is a service
|
|
22
|
+
DB is a database
|
|
23
|
+
|
|
24
|
+
== Authentication ==
|
|
25
|
+
Mobile -POST /orders-> Gateway
|
|
26
|
+
Gateway -verify token-> Gateway | c: Auth
|
|
27
|
+
Gateway -check rate limit-> Redis | c: RateLimiting
|
|
28
|
+
|
|
29
|
+
== Business Logic ==
|
|
30
|
+
Gateway -POST /orders-> OrderAPI
|
|
31
|
+
OrderAPI -getUser(id)-> UserAPI
|
|
32
|
+
UserAPI -SELECT user-> DB
|
|
33
|
+
DB -user-> UserAPI
|
|
34
|
+
UserAPI -user-> OrderAPI
|
|
35
|
+
OrderAPI -INSERT order-> DB
|
|
36
|
+
DB -ok-> OrderAPI
|
|
37
|
+
OrderAPI -201 Created-> Gateway
|
|
38
|
+
|
|
39
|
+
== Response ==
|
|
40
|
+
Gateway -cache response-> Redis | c: Caching
|
|
41
|
+
Gateway -201 Created-> Mobile
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
sequence E-Commerce Checkout
|
|
2
|
+
|
|
3
|
+
User is an actor
|
|
4
|
+
App is a frontend
|
|
5
|
+
API is a gateway
|
|
6
|
+
Orders is a service
|
|
7
|
+
Payments is an external aka Stripe
|
|
8
|
+
DB is a database
|
|
9
|
+
|
|
10
|
+
[Place Order]
|
|
11
|
+
User -click checkout-> App
|
|
12
|
+
App -POST /orders-> API
|
|
13
|
+
API -createOrder(items)-> Orders
|
|
14
|
+
|
|
15
|
+
if items in stock
|
|
16
|
+
Orders -reserveStock(skus)-> DB
|
|
17
|
+
DB -ok-> Orders
|
|
18
|
+
Orders -POST /charges-> Payments
|
|
19
|
+
Payments -charge_id-> Orders
|
|
20
|
+
|
|
21
|
+
parallel Notify
|
|
22
|
+
Orders ~UPDATE analytics~> DB
|
|
23
|
+
Orders ~emit OrderPlaced~> API
|
|
24
|
+
|
|
25
|
+
API -order confirmation-> App
|
|
26
|
+
App -receipt page-> User
|
|
27
|
+
else
|
|
28
|
+
Orders -409 Out of Stock-> API
|
|
29
|
+
API -error-> App
|
|
30
|
+
App -items unavailable-> User
|
|
31
|
+
|
|
32
|
+
[Fulfillment]
|
|
33
|
+
loop Retry up to 3 times
|
|
34
|
+
API -reconcileCharge(id)-> Payments
|
|
35
|
+
Payments -status-> API
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
sitemap Grand Slam Tickets
|
|
2
|
+
direction-tb
|
|
3
|
+
|
|
4
|
+
tag Auth
|
|
5
|
+
Public(green)
|
|
6
|
+
Required(blue)
|
|
7
|
+
Admin(red)
|
|
8
|
+
|
|
9
|
+
tag Type
|
|
10
|
+
Landing(purple)
|
|
11
|
+
Form(orange)
|
|
12
|
+
Content(cyan)
|
|
13
|
+
Transactional(yellow)
|
|
14
|
+
|
|
15
|
+
Home
|
|
16
|
+
Auth: Public
|
|
17
|
+
Type: Landing
|
|
18
|
+
-browse-> Game Schedule
|
|
19
|
+
-search-> Search
|
|
20
|
+
-sign in-> Login
|
|
21
|
+
-my tickets-> My Account
|
|
22
|
+
|
|
23
|
+
[Browse & Discovery]
|
|
24
|
+
Game Schedule
|
|
25
|
+
Auth: Public
|
|
26
|
+
Type: Content
|
|
27
|
+
-select game-> Game Detail
|
|
28
|
+
-filter-> Search
|
|
29
|
+
|
|
30
|
+
Search
|
|
31
|
+
Auth: Public
|
|
32
|
+
Type: Form
|
|
33
|
+
-results-> Game Detail
|
|
34
|
+
-no results-> Game Schedule
|
|
35
|
+
|
|
36
|
+
Game Detail
|
|
37
|
+
Auth: Public
|
|
38
|
+
Type: Content
|
|
39
|
+
-buy tickets-> Seat Picker
|
|
40
|
+
-view promotions-> Promotions
|
|
41
|
+
-back-> Game Schedule
|
|
42
|
+
|
|
43
|
+
Promotions
|
|
44
|
+
Auth: Public
|
|
45
|
+
Type: Content
|
|
46
|
+
-select deal-> Game Detail
|
|
47
|
+
|
|
48
|
+
[Purchase Flow]
|
|
49
|
+
Seat Picker
|
|
50
|
+
Auth: Public
|
|
51
|
+
Type: Form
|
|
52
|
+
-select seats-> Cart
|
|
53
|
+
-back-> Game Detail
|
|
54
|
+
|
|
55
|
+
Cart
|
|
56
|
+
Auth: Public
|
|
57
|
+
Type: Transactional
|
|
58
|
+
-checkout-> Login
|
|
59
|
+
-add more-> Seat Picker
|
|
60
|
+
-apply promo-> Cart
|
|
61
|
+
|
|
62
|
+
Checkout
|
|
63
|
+
Auth: Required
|
|
64
|
+
Type: Form
|
|
65
|
+
-submit-> Payment
|
|
66
|
+
-edit cart-> Cart
|
|
67
|
+
|
|
68
|
+
Payment
|
|
69
|
+
Auth: Required
|
|
70
|
+
Type: Transactional
|
|
71
|
+
-success-> Confirmation
|
|
72
|
+
-declined-> Payment
|
|
73
|
+
-cancel-> Cart
|
|
74
|
+
|
|
75
|
+
Confirmation
|
|
76
|
+
Auth: Required
|
|
77
|
+
Type: Transactional
|
|
78
|
+
-view tickets-> My Tickets
|
|
79
|
+
-buy more-> Game Schedule
|
|
80
|
+
|
|
81
|
+
[Account]
|
|
82
|
+
Login
|
|
83
|
+
Auth: Public
|
|
84
|
+
Type: Form
|
|
85
|
+
-success-> My Account
|
|
86
|
+
-forgot password-> Reset Password
|
|
87
|
+
-create account-> Register
|
|
88
|
+
|
|
89
|
+
Register
|
|
90
|
+
Auth: Public
|
|
91
|
+
Type: Form
|
|
92
|
+
-success-> My Account
|
|
93
|
+
-already have account-> Login
|
|
94
|
+
|
|
95
|
+
Reset Password
|
|
96
|
+
Auth: Public
|
|
97
|
+
Type: Form
|
|
98
|
+
-submitted-> Login
|
|
99
|
+
|
|
100
|
+
My Account
|
|
101
|
+
Auth: Required
|
|
102
|
+
Type: Landing
|
|
103
|
+
-view tickets-> My Tickets
|
|
104
|
+
-edit profile-> Profile
|
|
105
|
+
-payment methods-> Payment Methods
|
|
106
|
+
|
|
107
|
+
My Tickets
|
|
108
|
+
Auth: Required
|
|
109
|
+
Type: Content
|
|
110
|
+
-transfer-> Ticket Transfer
|
|
111
|
+
-sell-> Ticket Resale
|
|
112
|
+
-view detail-> Ticket Detail
|
|
113
|
+
|
|
114
|
+
Ticket Detail
|
|
115
|
+
Auth: Required
|
|
116
|
+
Type: Content
|
|
117
|
+
-download-> Ticket Detail
|
|
118
|
+
-add to wallet-> Ticket Detail
|
|
119
|
+
-get directions-> Stadium Map
|
|
120
|
+
|
|
121
|
+
Ticket Transfer
|
|
122
|
+
Auth: Required
|
|
123
|
+
Type: Form
|
|
124
|
+
-sent-> My Tickets
|
|
125
|
+
|
|
126
|
+
Ticket Resale
|
|
127
|
+
Auth: Required
|
|
128
|
+
Type: Form
|
|
129
|
+
-listed-> My Tickets
|
|
130
|
+
|
|
131
|
+
Profile
|
|
132
|
+
Auth: Required
|
|
133
|
+
Type: Form
|
|
134
|
+
-saved-> My Account
|
|
135
|
+
|
|
136
|
+
Payment Methods
|
|
137
|
+
Auth: Required
|
|
138
|
+
Type: Form
|
|
139
|
+
-saved-> My Account
|
|
140
|
+
|
|
141
|
+
[Stadium Info]
|
|
142
|
+
Stadium Map
|
|
143
|
+
Auth: Public
|
|
144
|
+
Type: Content
|
|
145
|
+
-find food-> Concessions
|
|
146
|
+
-find parking-> Parking
|
|
147
|
+
|
|
148
|
+
Concessions
|
|
149
|
+
Auth: Public
|
|
150
|
+
Type: Content
|
|
151
|
+
-pre-order-> Cart
|
|
152
|
+
|
|
153
|
+
Parking
|
|
154
|
+
Auth: Public
|
|
155
|
+
Type: Content
|
|
156
|
+
-buy pass-> Cart
|