Giter VIP home page Giter VIP logo

structurizr-mkdocs-pages's Introduction

Update Pages

Sample repository showing how to develop version controlled Structurizr C4 model of your architecture locally with resulting diagrams hosted using MkDocs static page generator. This is little more than a bit of glue code to contain everything in a single repo (could be part of your app repo if you want everything together) sprinkled with GitHub automation to host the result as GH Pages, but I hope this can be used to save you a bit of time if you're trying to solve the same problem and, like me a just few days ago, are not familiar with any of the tooling.

You can see the generated documentation here: https://jbrestan.github.io/structurizr-mkdocs-pages/

Why

Tl;dr version: if your organization needs, size and complexity allows it, I recommend giving Structurizr cloud or self-hosted server a go. But if for any reason you can't or don't want to use cloud Structurizr and are looking for local or statically hosted option, read on!

Using Structurizr to describe your app or the whole product landscape in a single place you can generate diagrams from can be a gamechanger if you want to keep your architecure documentation up to date across multiple apps or perspectives. There's a good explanation of the difference between diagramming and modelling on the C4 pages and Structurizr is a great implementation of this approach. However if you don't want to use the cloud or self-hosted Structurizr options and just need the diagrams to show in your documentation while still benefiting from the centralized model, it's usually up to you to figure out the exact tooling and process. This repo is an example of such process, using MkDocs as the static docs generator and GitHub pages as the hosting.

How does it work

MkDocs is a widely used solution to generate static pages from a bit of configuration and a hierarchy of markdown documents. It's a python tool that you can install locally to get started and add plugins to extend the behavior. The two important plugins for us are macros and mermaid2 which allow us to include contents of another file in our docs markdown document and render mermaid syntax as a diagram on the resulting page.

We can get the diagrams in mermaid syntax using Structurizr CLI which offers exporting the model into various other formats.

The rest is just glue to make this work together. As you make changes to the model file, you can either view them locally using Structurizr Lite by starting run-structurizr.sh on your machine and navigating to localhost:8080. To view the full result export the mermaid files using export-structurizr-diagrams.sh script, include them in the documentation with a macro like {% include 'diagrams/structurizr-Diagram1.mmd' %}, build the docs and serve on localhost with mkdocs serve and navigate to localhost:8000 to see the result.

Once you push the changes, GH action will handle the diagram export and GitHub pages update.

structurizr-mkdocs-pages's People

Contributors

jbrestan avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

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.