{"id":18514984,"url":"https://github.com/bensmithett/structurizr-mini","last_synced_at":"2025-07-21T23:33:49.505Z","repository":{"id":218353259,"uuid":"611516220","full_name":"bensmithett/structurizr-mini","owner":"bensmithett","description":"A static site for C4 diagrams from a Structurizr workspace","archived":false,"fork":false,"pushed_at":"2024-11-09T22:47:12.000Z","size":1808,"stargazers_count":29,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-16T19:06:55.517Z","etag":null,"topics":["c4","c4-model","diagram-generator","diagramming","structurizr","structurizr-dsl"],"latest_commit_sha":null,"homepage":"https://bensmithett.github.io/structurizr-mini/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bensmithett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T01:26:31.000Z","updated_at":"2025-05-21T21:06:31.000Z","dependencies_parsed_at":"2024-11-06T15:56:51.151Z","dependency_job_id":"dced8db9-bb1d-425b-b95c-b3be2e9d4541","html_url":"https://github.com/bensmithett/structurizr-mini","commit_stats":null,"previous_names":["bensmithett/structurizr-mini"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bensmithett/structurizr-mini","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bensmithett%2Fstructurizr-mini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bensmithett%2Fstructurizr-mini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bensmithett%2Fstructurizr-mini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bensmithett%2Fstructurizr-mini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bensmithett","download_url":"https://codeload.github.com/bensmithett/structurizr-mini/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bensmithett%2Fstructurizr-mini/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266403125,"owners_count":23923404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c4","c4-model","diagram-generator","diagramming","structurizr","structurizr-dsl"],"created_at":"2024-11-06T15:46:10.341Z","updated_at":"2025-07-21T23:33:49.480Z","avatar_url":"https://github.com/bensmithett.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src='./docs/banner.webp' width='512' alt='Structurizr Mini' /\u003e\n\nA static site for C4 diagrams from a [Structurizr](https://structurizr.com) workspace. 👉 [Demo](https://bensmithett.github.io/structurizr-mini/) 👈\n\n## Features\n\n- Real Structurizr diagrams — uses the [same diagram renderer](https://github.com/structurizr/ui) as the [official tools](https://docs.structurizr.com/products)\n- [Themes](https://structurizr.com/help/themes) just work\n- Zoom and pan with mousewheel or trackpad (like Google Maps, Lucidchart, Miro, etc)\n- Simplified UI with [quick navigation](https://docs.structurizr.com/ui/quick-navigation) and [fuzzy search](https://github.com/farzher/fuzzysort)\n- PNG export\n- Just the diagrams — [docs](https://docs.structurizr.com/dsl/docs) and [ADRs](https://docs.structurizr.com/dsl/adrs) in the workspace are ignored\n- Customisable nav — link to your own supplemental docs, ADRs, source code, etc\n\n## Instructions\n\n1. Download and unzip the latest [release](https://github.com/bensmithett/structurizr-mini/releases) somewhere that can serve static files over HTTP\n2. Replace `workspace.json` and (optionally) `nav.json` with your own.\n3. Go to `http://[YOUR SERVER]/index.html`\n\nHow you get a `workspace.json` depends on your workflow, and the extent to which you're using Structurizr [Cloud](https://docs.structurizr.com/cloud) or [On-Premises](https://docs.structurizr.com/onpremises).\n\n## Structurizr Cloud/On-Premises workflow\n\nUse Structurizr CLI's [`pull`](https://docs.structurizr.com/cli/pull) to export a `workspace.json` that includes diagram layout information.\n\n## Structurizr Mini workflow\n\n1. Author a `workspace.dsl` locally, using [Structurizr Lite](https://structurizr.com/help/lite) or the [web DSL Editor](https://structurizr.com/dsl) to preview the resulting diagrams.\n2. Generate a `workspace.json` based on your `workspace.dsl`\n3. Publish diagrams to a static Structurizr Mini site (e.g. as part of a CI build)\n\n⚠️ Note: while the Structurizr CLI can [export](https://docs.structurizr.com/cli/export) your local `workspace.dsl` to JSON, **it will not include any diagram layout info.** The following steps explain how to get a `workspace.json` that includes diagram layout info.\n\n### Where does your diagram layout info come from?\n\nDiagram layout is defined two ways: **automatically** and **manually**.\n\n#### Automatic layout (i.e. `autoLayout`)\n\nTo get the actual layout information for your `autoLayout` views, Structurizr Lite/Cloud/On-Premises run [Graphviz](https://graphviz.org) on the server when you view a diagram.\n\n```mermaid\nsequenceDiagram\n  Browser-\u003e\u003eServer: Get layout information\n  Server-\u003e\u003eServer: Apply Graphviz\n  Server-\u003e\u003eBrowser: Return layout information\n  Browser-\u003e\u003eBrowser: Render diagram\n```\n\nAs a static site without a server runtime, Mini can't do that. Luckily there's an [easy way](https://github.com/structurizr/cli/issues/62#issuecomment-999623728) to generate automatic layout information at build time:\n\n1. [Install Graphviz](https://graphviz.org/download/) so the `dot` command is available\n2. Create a wrapper DSL file (e.g. `graphviz.dsl`) that extends your JSON workspace, and applies graphviz.\n```\nworkspace extends workspace.json {\n  !script groovy {\n    new com.structurizr.autolayout.graphviz.GraphvizAutomaticLayout().apply(workspace);\n  }\n}\n```\n3. Use the CLI to export *that* workspace to JSON\n```bash\nstructurizr-cli export -workspace graphviz.dsl -format json\n```\n\nThis JSON workspace will have all the layout information that Structurizr Mini needs to render your `autoLayout` diagrams.\n\n#### Manual layout\n\nIf you use Lite to locally edit the layout of non-`autoLayout` diagrams, Lite [auto-saves](https://docs.structurizr.com/lite/usage#auto-save) those edits to a local `workspace.json`.\n\nYou may wish to commit this file to version control. It's a `workspace.json` complete with layout information that Mini can use directly.\n\n⚠️ Remember that layout info for a diagram only updates in Lite's `workspace.json` when you *actually view the individual diagram* in the browser. Things can get messy if you have many diagrams, or multiple people contributing changes, each updating their own local `workspace.json` according to which diagrams they view or edit.\n\nIf your workspace has a mix of automatic and manual layouts, you can still use the method above to generate automatic layout information for all diagrams based on the latest `workspace.dsl`, regardless of which individual diagrams contributors have viewed recently.\n\nPersonally, I just rely on `autoLayout` and `.gitignore` the `workspace.json` generated by Lite. If you really need manual layout with multiple contributors, you should use Structurizr's Cloud/On-Prem services — they do lots of [clever](https://docs.structurizr.com/cloud/workspace-locking) [things](https://docs.structurizr.com/cli/push) to enable it.\n\n## Thanks\n\n- [@simonbrowndotje](https://github.com/simonbrowndotje) for the C4 model, and for open sourcing [structurizr/ui](https://github.com/structurizr/ui) with plenty of examples so I could build a diagram renderer without writing any diagram rendering code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbensmithett%2Fstructurizr-mini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbensmithett%2Fstructurizr-mini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbensmithett%2Fstructurizr-mini/lists"}