Home

Awesome

opengeh-arch-diagrams

This repository contains C4 models and diagrams.

Table of contents

  1. Folders structure
  2. DataHub base model

Folder structure

This repository is structured according to the following sketch:

.
├── .github/
│   ├── actions/
│   ├── workflows/
│   └── CODEOWNERS
│
├── .vscode/
│
├── docs/
│   └── diagrams/
│      └── c4-model/
│         ├── views/
│         ├── dh-base-model.dsl
│         ├── views.dsl
│         └── views.json
│
├── .editorconfig
├── .gitignore
├── LICENSE
└── README.md

DataHub base model

The DataHub base model is a C4 model that describes the big picture of systems in the DataHub company.

This is a public repository so be conscious of any information that is added to the model.

The dh-base-model.dsl file contains the following:

The views.dsl file contains the following:

In domain repositories developers should extend on the workspace in dh-base-model.dsl to be able to add additional elements within e.g. software systems, to define relationships with elements, or to simply reuse styles.

The C4 model and rendered diagrams are located in the folder hierarchy docs/diagrams/c4-model and consists of:

Maintenance of the C4 model should be performed using VS Code and a local version of Structurizr Lite running in Docker.

Prerequisites

Open Structurizr Lite in workspace

It is possible to view a single diagram at a time in VS Code using the "C4 DSL Extension". But the support for viewing diagrams is better with Structurizr Lite, which also allows us to perform manual layout.

To launch Structurizr Lite from within VS Code do the following:

This will:

To view it in a browser, use the Docker extension pane and right-click the structurizr/lite container and select "Open in browser".

Modeling

Use VS Code with the "C4 DSL Extension" to update the model file dh-base-model.dsl or views file views.dsl as necessary.

It is possible to view a single diagram in VS Code using the "C4 DSL Extension", but it has its limitations, so its usage is primarily for the editing support.

After editing in the model or views, refresh the browser running Structurizr Lite to reload the views. Note that unfortunately added boxes may be hidden behind existing ones, in that case you can drag boxes manually to fix the layout.

If autolayout is not enabled, it is possible to perform manual layout of elements in the model. Layout informations are saved in a views.json file. There are situations where the layout might be lost, or changed. See also Structurizr - Troubleshooting.