Skip to content

Commit 88d44d0

Browse files
Address code review feedback: update branding and fix indentation
Co-authored-by: reindervdw-cmi <200102462+reindervdw-cmi@users.noreply.github.com>
1 parent 7cdfc27 commit 88d44d0

3 files changed

Lines changed: 57 additions & 10 deletions

File tree

.github/workflows/d2-diagrams.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,21 @@ jobs:
6060
// Create comment body with embedded SVG
6161
const commentBody = `## 🏗️ Architecture Diagram Updated
6262
63-
The D2 architecture diagram has been regenerated based on the changes in this PR.
63+
The D2 architecture diagram has been regenerated based on the changes in this PR.
6464

65-
### Production Architecture
65+
### Production Architecture
6666

67-
<details>
68-
<summary>Click to view diagram</summary>
67+
<details>
68+
<summary>Click to view diagram</summary>
6969

70-
${svgContent}
70+
${svgContent}
7171

72-
</details>
72+
</details>
7373

74-
---
74+
---
7575

76-
📥 You can also download the diagram from the [workflow artifacts](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}).
77-
`;
76+
📥 You can also download the diagram from the [workflow artifacts](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}).
77+
`;
7878
7979
// Find existing comment
8080
const comments = await github.rest.issues.listComments({

diagrams/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Architecture Diagrams
2+
3+
This directory contains [D2](https://d2lang.com/) diagrams that document the Azure infrastructure for the CTK project.
4+
5+
## Overview
6+
7+
The diagrams are organized into modular files, each representing a specific component of the architecture:
8+
9+
- **`main.d2`** - The main diagram that imports and connects all components
10+
- **`shared.d2`** - Shared resources (Container Registry)
11+
- **`network.d2`** - Virtual Network and subnets
12+
- **`database.d2`** - Cosmos PostgreSQL database with private endpoint
13+
- **`container_environment.d2`** - Container App Environment
14+
- **`container_apps.d2`** - All container applications (webapp, cloai_service, ctk_functions, languagetool)
15+
- **`supporting_services.d2`** - Supporting services (Key Vault, Storage Account, Log Analytics, Application Insights)
16+
- **`identity.d2`** - Azure Active Directory authentication
17+
18+
## Building Diagrams
19+
20+
The diagrams are automatically built by the GitHub Actions workflow whenever D2 files are modified. The workflow:
21+
22+
1. Installs the D2 CLI
23+
2. Compiles `main.d2` to `architecture.svg`
24+
3. Uploads the SVG as a workflow artifact
25+
4. Posts the diagram as a comment on pull requests
26+
27+
To build locally, install [D2](https://d2lang.com/) and run:
28+
29+
```bash
30+
d2 diagrams/main.d2 diagrams/output/architecture.svg
31+
```
32+
33+
## Architecture Notes
34+
35+
- These diagrams focus on the **production environment** only
36+
- Icons are from [Terrastruct Icons](https://icons.terrastruct.com/)
37+
- Only the most important connections between services are shown for clarity
38+
- The diagrams provide a high-level overview, not an exhaustive representation
39+
40+
## Updating Diagrams
41+
42+
When making infrastructure changes:
43+
44+
1. Update the relevant D2 file(s) in this directory
45+
2. Commit and push your changes
46+
3. The workflow will automatically regenerate the diagram
47+
4. Review the updated diagram in the PR comment or workflow artifacts

diagrams/identity.d2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Identity and Authentication
22

3-
azure_ad: Azure Active Directory\nApp Registration {
3+
azure_ad: Microsoft Entra ID\nApp Registration {
44
icon: https://icons.terrastruct.com/azure%2FIdentity%2F10221-icon-service-Azure-Active-Directory.svg
55
}

0 commit comments

Comments
 (0)