{"id":37425424,"url":"https://github.com/cloudflightio/structurizr-autoconfigure","last_synced_at":"2026-01-16T06:13:01.710Z","repository":{"id":41865109,"uuid":"510360393","full_name":"cloudflightio/structurizr-autoconfigure","owner":"cloudflightio","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-26T07:34:42.000Z","size":108,"stargazers_count":3,"open_issues_count":1,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-02T02:08:55.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudflightio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2022-07-04T12:57:51.000Z","updated_at":"2024-07-22T06:41:06.000Z","dependencies_parsed_at":"2024-07-22T08:11:35.287Z","dependency_job_id":null,"html_url":"https://github.com/cloudflightio/structurizr-autoconfigure","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cloudflightio/structurizr-autoconfigure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflightio%2Fstructurizr-autoconfigure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflightio%2Fstructurizr-autoconfigure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflightio%2Fstructurizr-autoconfigure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflightio%2Fstructurizr-autoconfigure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudflightio","download_url":"https://codeload.github.com/cloudflightio/structurizr-autoconfigure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflightio%2Fstructurizr-autoconfigure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-16T06:13:00.460Z","updated_at":"2026-01-16T06:13:01.677Z","avatar_url":"https://github.com/cloudflightio.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Structurizr AutoConfigure with Spring Boot\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Maven Central](https://img.shields.io/maven-central/v/io.cloudflight.structurizr/structurizr-autoconfigure.svg?label=Maven%20Central)](https://search.maven.org/artifact/io.cloudflight.structurizr/structurizr-autoconfigure)\n\nThe purpose of this small utility on top of [the Structurizr Client for Java](https://github.com/structurizr/java) and its\n[Export Library](https://github.com/structurizr/export) is to provide a bit more structure especially for bigger workspaces.\n\nIf you follow the instructions of the default library, you easily end up with classes with 100s of lines of code without any\nstructure. We use Spring Boot here in order to\n\n* cluster your C4 components to chunks of reasonable size\n* separate model and view-generation from each other and ensure that views are only created after the model is fully initialized\n* provide helper-code which allows to export your workspace either to Structurizr Web or to PlantUML files using [C4-PlantUML](https://github.com/plantuml-stdlib/C4-PlantUML).\n\n## The Structurizr Workspace\n\nThis will give you a step-by-step tutorial how to embed this library:\n\n### Embed the library\n\nFirst thing you need to do is to\nadd [this library](https://search.maven.org/artifact/io.cloudflight.structurizr/structurizr-autoconfigure) to your\nproject. With Gradle this is as easy as adding that to your `build.gradle`:\n\n````groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"io.cloudflight.structurizr:structurizr-autoconfigure:1.0.1\")\n}\n````\n\n### Configure the application:\n\nIn your folder `src/main/resources` create a file called `application.yml`.\n\n```yaml\nstructurizr:\n  workspace:\n    name: My project name\n    description: My project description\n```\n\n### Create the main class\n\nWe recommend to use Kotlin to create those architecture models.\n\nLast step is to create your main class, it's as easy as that, simply start the Spring Boot application.\n\n```kotlin\npackage io.cloudflight.architecture\n\nimport io.cloudflight.architecture.structurizr.SpringStructurizr\nimport org.springframework.boot.SpringApplication\n\n@SpringBootApplication\nclass Architecture\n\nfun main(args: Array\u003cString\u003e) {\n    SpringStructurizr.run(Architecture::class.java)\n}\n```\n\n### Fill your model\n\nThen you can create Spring Components to populate your model. The Structurizr classes `Workspace` and `Model` are\navailable in the `ApplicationContext`,\nthus can be injected. Inside your `src`-folder, create a file called `Personas.kt`:\n\n```kotlin\n@Component\nclass Personas(model: Model) {\n    val customer = model.addPerson(\"Customer\", \"Wants to buy articles\");\n    val admin = model.addPerson(\"Admin\", \"Maintains the system\");\n}\n```\n\nYou might then inject those components into other components:\n\n```kotlin\n@Component\nclass WebShop(model: Model, personas: Personas) {\n\n    val webShop = model.addSoftwareSystem(\"WebShop\", \"\") {\n        usedBy(personas.admin, \"maintains the articles\")\n        usedBy(personas.customer, \"buys articles\", Technology.Browser)\n    }\n}\n```\n\nYou might noticed that we connected personas already with our webshop software system. Populate your model as described in the\n[official library](https://github.com/structurizr/java).\n\n### Create Views\n\nImplement the interface `ViewProvider` to create views as soon as your model has been created.\n\n```kotlin\n@Component\nclass WebShop(model: Model, personas: Personas) {\n\n    val webShop = model.addSoftwareSystem(\"WebShop\", \"\") {\n        usedBy(personas.admin, \"maintains the articles\")\n        usedBy(personas.customer, \"buys articles\", Technology.Browser)\n    }\n\n    override fun createViews(viewSet: ViewSet) {\n        viewSet.createContainerView(webShop, \"webshop\", \"WebSatalog Containers\").addAllContainersAndInfluencers()\n    }\n}\n```\n\n## Configure the Export\n\nNow that we have the model and the view, we should export and/or render it. There are two built-in options here, but you\nare free to define your own `io.cloudflight.architecture.structurizr.WorkspaceExportService`. \n\n1. Export to Structurizr\n2. Export as PlantUML files\n\n\n### Export to Structurizr\n\nIf you want to send your workspace to a Structurizr Web Server, then configure your app in the `application.yaml`:\n\n````yaml\nstructurizr:\n   workspace:\n      name: My project name\n      description: My project description\n   export:\n      structurizr:\n         enabled: true\n         id: xxx\n         key: \"any\"\n         secret: \"any\"\n````\n\nThis will configure a `StructurizrClient` as described [in the docs](https://github.com/structurizr/java/blob/master/docs/api-client.md). \nTake the `id`, `key` and `secret` from Structurizr. \n\nThen run your application, your workspace will be synced to Structurizr.\nNo need to create and configure a `StructurizrClient` on your own.\n\n\n### Export as PlantUML files\n\nIf you don't want to use the Structurizr Web Server, you can also export your workspace as PlantML files using \n[Structurizr Export for C4PlantUML](https://github.com/cloudflightio/structurizr-export-c4plantuml). All you need to do is to\nenable the export in your `application.yaml`:\n\n````yaml\nstructurizr:\n   workspace:\n      name: My project name\n      description: My project description\n   export:\n     c4-plant-uml:\n       enabled: true\n````\n\nThis will create one `.puml`-file per view into your folder `build/c4PlantUml` with help of the [C4-PlantUML](https://github.com/plantuml-stdlib/C4-PlantUML). \nUse PlantUML to transform those files into images.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflightio%2Fstructurizr-autoconfigure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudflightio%2Fstructurizr-autoconfigure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflightio%2Fstructurizr-autoconfigure/lists"}