Giter VIP home page Giter VIP logo

bitsmuggler / arc42-c4-software-architecture-documentation-example Goto Github PK

View Code? Open in Web Editor NEW
93.0 3.0 17.0 3.85 MB

This example shows how you can use arc42 in combination with the C4 model and the Documentation as Code technique.

Home Page: https://bitsmuggler.github.io/arc42-c4-software-architecture-documentation-example/

Groovy 47.72% Shell 52.28%
arc42 c4 c4-model docsascode documentation-as-code

arc42-c4-software-architecture-documentation-example's Introduction

Software Architecture Documentation Example with arc42 and C4 Model

This example shows how to use arc42 in combination with the C4 model with the Documentation as Code technique.

It shows how to use the techniques described in The ultimate Guide to Software Architecture Documentation.

Check out the deployed HTML build provided on GitHub Pages.

Technologies involved:

  • arc42 to get the structure for the software architecture documentation

  • C4 Model an "abstraction-first" approach to diagramming software architecture, based upon abstractions that reflect how software architects and developers think about and build software.

  • Structurizr DSL to describe the C4 Model of the software system

  • Structurizr CLI a command line utility for Structurizr to export the PlantUML diagrams from the C4 Model described in the Structurizr DSL

  • AsciiDoc as format to write the software architecture documentation

  • docToolchain to generate the representations of the software architecture documentation written in AsciiDoc. docToolchain makes use of Asciidoctor.

  • Kroki to generate diagrams

  • adr-tools to generate and manage Architecture Decision Records (ADRs)

For more tech inspiration take a look at the Documentation as Code Technology Radar

Prerequisites

Generate PlantUML Diagrams from the C4 Model

With the Structurizr CLI via Docker Image

docker run -it --rm -v $PWD:/usr/local/structurizr structurizr/cli export -w documentation/bank.dsl -format plantuml/structurizr -output documentation/diagrams

With a local installed Structurizr CLI

Download the structurizr-cli, unzip and move it into ./bin/structurizr-cli or use the latest Docker Image

curl --show-error --location https://github.com/structurizr/cli/releases/download/v{selected-version}/structurizr-cli-{selected-version}.zip  -o tmp.zip && unzip -d bin/structurizr-cli/. tmp.zip && rm tmp.zip

Generate the diagrams from the structurizr workspace model

./bin/structurizr-cli/structurizr.sh export -w documentation/bank.dsl -format plantuml/structurizr -output documentation/diagrams

With the docToolchain

docToolchain uses the Structurizr CLI to generate the PlantUML diagrams from the C4 Model described in the Structurizr DSL.

./dtcw exportStructurizr

Migrate markdown based ADRs from adr-tools to AsciiDoc

Install and configure adr-tools

  1. Install adr-tools

  2. Configure the adr template with the following header config

adr config

Replace the content of the template.md file with the following content:

### TITLE

Date: DATE

#### Status

STATUS

#### Context

The issue motivating this decision, and any context that influences or constrains the decision.

#### Decision

The change that we're proposing or have agreed to implement.

#### Consequences

What becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated.

Migrate the generated markdown based decisions with the docker-asciidoctor image under Linux

./dtcw exportMarkdown && cp ./build/adrs/*.adoc ./documentation/adrs/

Generate the software architecture documentation representations

Note
these examples use the public kroki.io instance to generate the diagrams. For your own documentation, replace the references to kroki.io with your own kroki instance.

Generate the documentation as HTML representation

./dtcw generateHTML

Generate the documentation as PDF representation

./dtcw generatePDF

Generate the documentation as Microsite

./dtcw generateSite

arc42-c4-software-architecture-documentation-example's People

Contributors

bitsmuggler avatar rdmueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

arc42-c4-software-architecture-documentation-example's Issues

problem installing structurizr-cli

it seems that not every version of tar can handle .zip files

> curl --show-error --location https://static.structurizr.com/download/structurizr-cli.zip | tar -xf - -C bin/structurizr-cli
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0tar: This does not look like a tar archive
tar: Skipping to next header
100 81.4M  100 81.4M    0     0   171M      0 --:--:-- --:--:-- --:--:--  170M
tar: Exiting with failure status due to previous errors

The following line works for me:

curl --show-error --location https://static.structurizr.com/download/structurizr-cli.zip  -o tmp.zip && unzip -d bin/structurizr-cli/. tmp.zip && rm tmp.zip

Add GitHub actions

  • Build the documentation
  • Upload & version the artifacts
  • Deploy the HTML Artifact to Netlify or Vercel

Example with docToolchain

since I really like yout structurizr example, I refactored it a bit to use docToolchain:
https://github.com/docToolchain/arc42-c4-software-architecture-documentation-example/tree/doctoolchain

This can now also generate a microsite.

Even if you don't like to use docToolchain in you example, there are some small refactorings for your example:

  • use of kroki.io for more diagrams-as-code features
  • :toc: left for single-page-HTML
  • :doctype: book to render a title page for the PDF

PS: since you already introduced {selected-version} as attribute, I now set :selected-version: 1.25.0 and configured the code block to substitute the attribute :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.