diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..c816c8b --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,38 @@ +name: Deploy Documentation to GitHub Pages + +on: + push: + branches: + - main # Trigger the workflow on push to the main branch + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Generate PlantUML diagrams + run: docker-compose run --rm generate-diagrams + + - name: Generate HTML documentation + run: docker-compose run --rm generate-docs + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/docs + diff --git a/README.md b/README.md new file mode 100644 index 0000000..97dec4c --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# Software Architecture Documentation with arc42 and C4 Model + +This repository provides an example of generating architecture documentation using the arc42 template and the C4 model, with the help of Structurizr CLI and Asciidoctor. The documentation includes various architectural views and diagrams, generated automatically using Docker and Docker Compose. + +## Overview + +The repository demonstrates how to: +1. Define architecture using Structurizr DSL. +2. Generate PlantUML diagrams using Structurizr CLI. +3. Generate HTML documentation using Asciidoctor. +4. Serve the documentation using Nginx or GitHub Pages. + +## Prerequisites + +- Docker +- Docker Compose + +## Usage + +Follow these steps to generate and serve the architecture documentation. + +### 1. Generate PlantUML diagrams + +Run the following command to generate PlantUML diagrams from the Structurizr DSL: + +```sh +docker-compose run --rm generate-diagrams +``` +### 2. Generate HTML documentation +Run the following command to generate the HTML documentation: + +````sh +docker-compose run --rm generate-docs +```` +### 3. Serve the documentation +Run the following command to serve the documentation using Nginx: + +````sh +docker-compose up serve-docs +```` + +### 4. View the documentation +Open your browser and go to http://localhost:8080 to view the generated documentation. + +## GitHub Pages Demo +You can view the demo of this documentation on GitHub Pages at the following [URL](https://.github.io//). + +## Explanation of Key Files +- src/docs/structurizr/structurizr.dsl: Defines the architecture using Structurizr DSL. +- src/docs/asciidoc/index.adoc: Main AsciiDoc file that includes other sections. +- src/docs/asciidoc/sections/: Directory containing individual AsciiDoc section files. +- docker-compose.yml: Docker Compose configuration to orchestrate the generation and serving of documentation. + +## Customization +You can customize the Structurizr DSL file (structurizr.dsl) to reflect your own system's architecture. Similarly, you can edit the AsciiDoc files in the sections directory to include more detailed information about your system. + +## License + +This project is licensed under the MIT License - see the LICENSE file for details. + diff --git a/build/docs/.asciidoctor/diagram/structurizr-Component-001.png.cache b/build/docs/.asciidoctor/diagram/structurizr-Component-001.png.cache new file mode 100644 index 0000000..0f183a3 --- /dev/null +++ b/build/docs/.asciidoctor/diagram/structurizr-Component-001.png.cache @@ -0,0 +1 @@ +{"checksum":"plantuml-md5-be4964e4a52214fa7c6a3f1c7982c5ff","options":{"size_limit":"4096"},"width":344,"height":345} \ No newline at end of file diff --git a/build/docs/.asciidoctor/diagram/structurizr-Container-001.png.cache b/build/docs/.asciidoctor/diagram/structurizr-Container-001.png.cache new file mode 100644 index 0000000..4aa4b33 --- /dev/null +++ b/build/docs/.asciidoctor/diagram/structurizr-Container-001.png.cache @@ -0,0 +1 @@ +{"checksum":"plantuml-md5-472c1c2cff83c3fd62b54c68a4637fa9","options":{"size_limit":"4096"},"width":726,"height":202} \ No newline at end of file diff --git a/build/docs/.asciidoctor/diagram/structurizr-Deployment-001.png.cache b/build/docs/.asciidoctor/diagram/structurizr-Deployment-001.png.cache new file mode 100644 index 0000000..c815d13 --- /dev/null +++ b/build/docs/.asciidoctor/diagram/structurizr-Deployment-001.png.cache @@ -0,0 +1 @@ +{"checksum":"plantuml-md5-1222f37eb53c06b1a65b3c7ac23fabc7","options":{"size_limit":"4096"},"width":517,"height":193} \ No newline at end of file diff --git a/build/docs/.asciidoctor/diagram/structurizr-SystemContext-001.png.cache b/build/docs/.asciidoctor/diagram/structurizr-SystemContext-001.png.cache new file mode 100644 index 0000000..e09b8e6 --- /dev/null +++ b/build/docs/.asciidoctor/diagram/structurizr-SystemContext-001.png.cache @@ -0,0 +1 @@ +{"checksum":"plantuml-md5-ad6f96440bf1d5d50a427c16ed0d32a2","options":{"size_limit":"4096"},"width":378,"height":180} \ No newline at end of file diff --git a/build/docs/index.html b/build/docs/index.html new file mode 100644 index 0000000..3185d41 --- /dev/null +++ b/build/docs/index.html @@ -0,0 +1,707 @@ + + + + + + + + +Software Architecture Documentation Template + + + + + +
+
+

1. Introduction and Goals

+
+
+

This section provides an overview of the system’s goals and stakeholders.

+
+
+
+
+

2. Architecture Constraints

+
+
+

List of technical, organizational, and other constraints.

+
+
+
+
+

3. System Context and Scope

+
+
+

3.1. System Context

+
+
+structurizr SystemContext 001 +
+
+
+
+
+
+

4. Solution Strategy

+
+
+

4.1. Technology

+
+

Which techonologies are used in the solution?

+
+
+
+

4.2. Methods for high-level design

+
+

Which methods are used for high-level design?

+
+
+
+
+
+

5. Building Block View

+
+
+

5.1: System Context

+
+
+structurizr Container 001 +
+
+
+
+

5.2: Container

+
+
+structurizr Component 001 +
+
+
+
+
+
+

6. Runtime View

+
+
+

It shows the behavior of one of several building blocks in the form of essential use cases.

+
+
+

6.1. Login use case

+ +
+
+
+
+

7. Deployment View

+
+
+

This section describes how the software system is deployed, including the hardware, software, and networking components.

+
+
+

7.1. Deployment Diagram

+
+
+structurizr Deployment 001 +
+
+
+
+
+
+

8. Cross-cutting Concepts

+
+
+

Description of cross-cutting concerns such as security, performance, and logging.

+
+
+

8.1. Security

+
+

8.1.1. Authentication

+ +
+
+
+

8.2. Performance

+ +
+
+

8.3. Logging

+ +
+
+
+
+

9. Architecture Decisions Records

+
+
+

9.1. Login decision

+
+

9.1.1. Context and Problem Statement

+
+

We want to enable user login.

+
+
+
+

9.1.2. Considered Options

+
+
    +
  • +

    Option 1

    +
  • +
  • +

    Option 2

    +
  • +
+
+
+
+

9.1.3. Decision Outcome

+
+

We selected option 1, because X.

+
+
+
+
+
+
+

10. Quality Scenarios

+
+
+

10.1. Performance

+
+

TODO: Describe performance-related quality scenarios.

+
+
+
+

10.2. Scalability

+
+

TODO: Describe scalability-related quality scenarios.

+
+
+
+

10.3. Reliability

+
+

TODO: Describe reliability-related quality scenarios.

+
+
+
+

10.4. Availability

+
+

TODO: Describe availability-related quality scenarios.

+
+
+
+

10.5. Security

+
+

TODO: Describe security-related quality scenarios.

+
+
+
+

10.6. Maintainability

+
+

TODO: Describe maintainability-related quality scenarios.

+
+
+
+

10.7. Portability

+
+

TODO: Describe portability-related quality scenarios.

+
+
+
+
+
+

11. Risks and Technical Debt

+
+
+

11.1. Risks

+
+

Identify and describe potential risks.

+
+
+
+

11.2. Technical Debt

+
+

Identify and describe technical debt in the system.

+
+
+
+
+
+

12. Glossary

+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TermDefinition

Term 1

Definition of term 1

Term 2

Definition of term 2

Term 3

Definition of term 3

Term 4

Definition of term 4

Term 5

Definition of term 5

+
+
+
+ + + \ No newline at end of file diff --git a/build/docs/structurizr-Component-001.png b/build/docs/structurizr-Component-001.png new file mode 100644 index 0000000..584744f Binary files /dev/null and b/build/docs/structurizr-Component-001.png differ diff --git a/build/docs/structurizr-Container-001.png b/build/docs/structurizr-Container-001.png new file mode 100644 index 0000000..214a595 Binary files /dev/null and b/build/docs/structurizr-Container-001.png differ diff --git a/build/docs/structurizr-Deployment-001.png b/build/docs/structurizr-Deployment-001.png new file mode 100644 index 0000000..29ab7d1 Binary files /dev/null and b/build/docs/structurizr-Deployment-001.png differ diff --git a/build/docs/structurizr-SystemContext-001.png b/build/docs/structurizr-SystemContext-001.png new file mode 100644 index 0000000..0e26223 Binary files /dev/null and b/build/docs/structurizr-SystemContext-001.png differ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..929ad70 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +services: + generate-diagrams: + image: structurizr/cli:latest + volumes: + - .:/workspace + working_dir: /workspace + command: ["export", "-workspace", "src/docs/structurizr/structurizr.dsl", "-format", "plantuml"] + + generate-docs: + image: asciidoctor/docker-asciidoctor:latest + volumes: + - .:/workspace + working_dir: /workspace + environment: + - PLANTUML_LIMIT_SIZE=8192 + command: ["asciidoctor", "-r", "asciidoctor-diagram", "-D", "build/docs", "src/docs/asciidoc/index.adoc"] + + serve-docs: + image: nginx:alpine + ports: + - "8080:80" + volumes: + - ./build/docs:/usr/share/nginx/html \ No newline at end of file diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc new file mode 100644 index 0000000..28a11a3 --- /dev/null +++ b/src/docs/asciidoc/index.adoc @@ -0,0 +1,17 @@ += Software Architecture Documentation Template +Version 1.0, June 2024. +:toc: +:toc-placement: preamble + +include::sections/01_introduction_and_goals.adoc[] +include::sections/02_constraints.adoc[] +include::sections/03_context_and_scope.adoc[] +include::sections/04_solution_strategy.adoc[] +include::sections/05_building_block_view.adoc[] +include::sections/06_runtime_view.adoc[] +include::sections/07_deployment_view.adoc[] +include::sections/08_crosscutting_concepts.adoc[] +include::sections/09_decision_log.adoc[] +include::sections/10_quality_scenarios.adoc[] +include::sections/11_risks_and_technical_debt.adoc[] +include::sections/12_glossary.adoc[] \ No newline at end of file diff --git a/src/docs/asciidoc/sections/01_introduction_and_goals.adoc b/src/docs/asciidoc/sections/01_introduction_and_goals.adoc new file mode 100644 index 0000000..958a80e --- /dev/null +++ b/src/docs/asciidoc/sections/01_introduction_and_goals.adoc @@ -0,0 +1,2 @@ +== 1. Introduction and Goals +This section provides an overview of the system's goals and stakeholders. diff --git a/src/docs/asciidoc/sections/02_constraints.adoc b/src/docs/asciidoc/sections/02_constraints.adoc new file mode 100644 index 0000000..71b29ad --- /dev/null +++ b/src/docs/asciidoc/sections/02_constraints.adoc @@ -0,0 +1,3 @@ + +== 2. Architecture Constraints +List of technical, organizational, and other constraints. diff --git a/src/docs/asciidoc/sections/03_context_and_scope.adoc b/src/docs/asciidoc/sections/03_context_and_scope.adoc new file mode 100644 index 0000000..cae6f73 --- /dev/null +++ b/src/docs/asciidoc/sections/03_context_and_scope.adoc @@ -0,0 +1,9 @@ + +== 3. System Context and Scope + +=== 3.1. System Context + +[plantuml, structurizr-SystemContext-001, png] +.... +include::../../structurizr/structurizr-SystemContext-001.puml[] +.... diff --git a/src/docs/asciidoc/sections/04_solution_strategy.adoc b/src/docs/asciidoc/sections/04_solution_strategy.adoc new file mode 100644 index 0000000..22f0377 --- /dev/null +++ b/src/docs/asciidoc/sections/04_solution_strategy.adoc @@ -0,0 +1,10 @@ + +== 4. Solution Strategy + +=== 4.1. Technology + +Which techonologies are used in the solution? + +=== 4.2. Methods for high-level design + +Which methods are used for high-level design? \ No newline at end of file diff --git a/src/docs/asciidoc/sections/05_building_block_view.adoc b/src/docs/asciidoc/sections/05_building_block_view.adoc new file mode 100644 index 0000000..a2e06f4 --- /dev/null +++ b/src/docs/asciidoc/sections/05_building_block_view.adoc @@ -0,0 +1,17 @@ + +== 5. Building Block View + +=== 5.1: System Context + +[plantuml, structurizr-Container-001, png] +.... +include::../../structurizr/structurizr-Container-001.puml[] +.... + +=== 5.2: Container + +[plantuml, structurizr-Component-001, png] +.... +include::../../structurizr/structurizr-Component-001.puml[] +.... + diff --git a/src/docs/asciidoc/sections/06_runtime_view.adoc b/src/docs/asciidoc/sections/06_runtime_view.adoc new file mode 100644 index 0000000..ac2850f --- /dev/null +++ b/src/docs/asciidoc/sections/06_runtime_view.adoc @@ -0,0 +1,6 @@ + +== 6. Runtime View + +It shows the behavior of one of several building blocks in the form of essential use cases. + +=== 6.1. Login use case \ No newline at end of file diff --git a/src/docs/asciidoc/sections/07_deployment_view.adoc b/src/docs/asciidoc/sections/07_deployment_view.adoc new file mode 100644 index 0000000..0f13995 --- /dev/null +++ b/src/docs/asciidoc/sections/07_deployment_view.adoc @@ -0,0 +1,11 @@ + +== 7. Deployment View + +This section describes how the software system is deployed, including the hardware, software, and networking components. + +=== 7.1. Deployment Diagram + +[plantuml, structurizr-Deployment-001, png] +.... +include::../../structurizr/structurizr-Deployment-001.puml[] +.... diff --git a/src/docs/asciidoc/sections/08_crosscutting_concepts.adoc b/src/docs/asciidoc/sections/08_crosscutting_concepts.adoc new file mode 100644 index 0000000..caf575e --- /dev/null +++ b/src/docs/asciidoc/sections/08_crosscutting_concepts.adoc @@ -0,0 +1,12 @@ + +== 8. Cross-cutting Concepts + +Description of cross-cutting concerns such as security, performance, and logging. + +=== 8.1. Security + +==== 8.1.1. Authentication + +=== 8.2. Performance + +=== 8.3. Logging \ No newline at end of file diff --git a/src/docs/asciidoc/sections/09_decision_log.adoc b/src/docs/asciidoc/sections/09_decision_log.adoc new file mode 100644 index 0000000..09d3a9f --- /dev/null +++ b/src/docs/asciidoc/sections/09_decision_log.adoc @@ -0,0 +1,4 @@ + +== 9. Architecture Decisions Records + +include::adrs/0001-login-decision.adoc[] \ No newline at end of file diff --git a/src/docs/asciidoc/sections/10_quality_scenarios.adoc b/src/docs/asciidoc/sections/10_quality_scenarios.adoc new file mode 100644 index 0000000..ed3ce8b --- /dev/null +++ b/src/docs/asciidoc/sections/10_quality_scenarios.adoc @@ -0,0 +1,30 @@ + +== 10. Quality Scenarios + +=== 10.1. Performance + +TODO: Describe performance-related quality scenarios. + +=== 10.2. Scalability + +TODO: Describe scalability-related quality scenarios. + +=== 10.3. Reliability + +TODO: Describe reliability-related quality scenarios. + +=== 10.4. Availability + +TODO: Describe availability-related quality scenarios. + +=== 10.5. Security + +TODO: Describe security-related quality scenarios. + +=== 10.6. Maintainability + +TODO: Describe maintainability-related quality scenarios. + +=== 10.7. Portability + +TODO: Describe portability-related quality scenarios. diff --git a/src/docs/asciidoc/sections/11_risks_and_technical_debt.adoc b/src/docs/asciidoc/sections/11_risks_and_technical_debt.adoc new file mode 100644 index 0000000..d6e5b8b --- /dev/null +++ b/src/docs/asciidoc/sections/11_risks_and_technical_debt.adoc @@ -0,0 +1,10 @@ + +== 11. Risks and Technical Debt + +=== 11.1. Risks + +Identify and describe potential risks. + +=== 11.2. Technical Debt + +Identify and describe technical debt in the system. diff --git a/src/docs/asciidoc/sections/12_glossary.adoc b/src/docs/asciidoc/sections/12_glossary.adoc new file mode 100644 index 0000000..5a1b210 --- /dev/null +++ b/src/docs/asciidoc/sections/12_glossary.adoc @@ -0,0 +1,21 @@ + +== 12. Glossary + +|=== +| Term | Definition + +| Term 1 +| Definition of term 1 + +| Term 2 +| Definition of term 2 + +| Term 3 +| Definition of term 3 + +| Term 4 +| Definition of term 4 + +| Term 5 +| Definition of term 5 +|=== diff --git a/src/docs/asciidoc/sections/adrs/0001-login-decision.adoc b/src/docs/asciidoc/sections/adrs/0001-login-decision.adoc new file mode 100644 index 0000000..524c69c --- /dev/null +++ b/src/docs/asciidoc/sections/adrs/0001-login-decision.adoc @@ -0,0 +1,15 @@ + +=== 9.1. Login decision + +==== 9.1.1. Context and Problem Statement + +We want to enable user login. + +==== 9.1.2. Considered Options + +* Option 1 +* Option 2 + +==== 9.1.3. Decision Outcome + +We selected option 1, because X. \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-Component-001-key.puml b/src/docs/structurizr/structurizr-Component-001-key.puml new file mode 100644 index 0000000..1912e93 --- /dev/null +++ b/src/docs/structurizr/structurizr-Component-001-key.puml @@ -0,0 +1,28 @@ +@startuml +set separator none + +skinparam { + shadowing false + arrowFontSize 15 + defaultTextAlignment center + wrapWidth 100 + maxMessageSize 100 +} +hide stereotype + +skinparam rectangle<<_transparent>> { + BorderColor transparent + BackgroundColor transparent + FontColor transparent +} + +skinparam rectangle<<1>> { + BackgroundColor #85bbf0 + FontColor #000000 + BorderColor #5d82a8 + roundCorner 20 +} +rectangle "==Component" <<1>> + + +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-Component-001.puml b/src/docs/structurizr/structurizr-Component-001.puml new file mode 100644 index 0000000..2f69330 --- /dev/null +++ b/src/docs/structurizr/structurizr-Component-001.puml @@ -0,0 +1,41 @@ +@startuml +set separator none +title System - Web Application - Components + +left to right direction + +skinparam { + arrowFontSize 10 + defaultTextAlignment center + wrapWidth 200 + maxMessageSize 100 +} + +hide stereotype + +skinparam rectangle<> { + BackgroundColor #85bbf0 + FontColor #000000 + BorderColor #5d82a8 + roundCorner 20 + shadowing false +} +skinparam rectangle<> { + BackgroundColor #85bbf0 + FontColor #000000 + BorderColor #5d82a8 + roundCorner 20 + shadowing false +} +skinparam rectangle<> { + BorderColor #2e6295 + FontColor #2e6295 + shadowing false +} + +rectangle "Web Application\n[Container: Java and Spring MVC]" <> { + rectangle "==Component A\n[Component: Spring Bean]\n\nA component within the web application." <> as System.WebApplication.ComponentA + rectangle "==Component B\n[Component: Spring Bean]\n\nAnother component within the web application." <> as System.WebApplication.ComponentB +} + +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-Container-001-key.puml b/src/docs/structurizr/structurizr-Container-001-key.puml new file mode 100644 index 0000000..90f9aa4 --- /dev/null +++ b/src/docs/structurizr/structurizr-Container-001-key.puml @@ -0,0 +1,38 @@ +@startuml +set separator none + +skinparam { + shadowing false + arrowFontSize 15 + defaultTextAlignment center + wrapWidth 100 + maxMessageSize 100 +} +hide stereotype + +skinparam rectangle<<_transparent>> { + BorderColor transparent + BackgroundColor transparent + FontColor transparent +} + +skinparam rectangle<<1>> { + BackgroundColor #438dd5 + FontColor #ffffff + BorderColor #2e6295 + roundCorner 20 +} +rectangle "==Container" <<1>> + +skinparam person<<2>> { + BackgroundColor #08427b + FontColor #ffffff + BorderColor #052e56 +} +person "==Person" <<2>> + +rectangle "." <<_transparent>> as 3 +3 .[#707070,thickness=2].> 3 : "Relationship" + + +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-Container-001.puml b/src/docs/structurizr/structurizr-Container-001.puml new file mode 100644 index 0000000..16356c0 --- /dev/null +++ b/src/docs/structurizr/structurizr-Container-001.puml @@ -0,0 +1,51 @@ +@startuml +set separator none +title System - Containers + +left to right direction + +skinparam { + arrowFontSize 10 + defaultTextAlignment center + wrapWidth 200 + maxMessageSize 100 +} + +hide stereotype + +skinparam rectangle<> { + BackgroundColor #438dd5 + FontColor #ffffff + BorderColor #2e6295 + roundCorner 20 + shadowing false +} +skinparam person<> { + BackgroundColor #08427b + FontColor #ffffff + BorderColor #052e56 + shadowing false +} +skinparam rectangle<> { + BackgroundColor #438dd5 + FontColor #ffffff + BorderColor #2e6295 + roundCorner 20 + shadowing false +} +skinparam rectangle<> { + BorderColor #0b4884 + FontColor #0b4884 + shadowing false +} + +person "==User\n[Person]\n\nA user of the system." <> as User + +rectangle "System\n[Software System]" <> { + rectangle "==Web Application\n[Container: Java and Spring MVC]\n\nThe web application." <> as System.WebApplication + rectangle "==Database\n[Container: MySQL]\n\nThe database." <> as System.Database +} + +User .[#707070,thickness=2].> System.WebApplication : "Uses" +System.WebApplication .[#707070,thickness=2].> System.Database : "Reads from and writes to" +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-Deployment-001-key.puml b/src/docs/structurizr/structurizr-Deployment-001-key.puml new file mode 100644 index 0000000..eca4a03 --- /dev/null +++ b/src/docs/structurizr/structurizr-Deployment-001-key.puml @@ -0,0 +1,39 @@ +@startuml +set separator none + +skinparam { + shadowing false + arrowFontSize 15 + defaultTextAlignment center + wrapWidth 100 + maxMessageSize 100 +} +hide stereotype + +skinparam rectangle<<_transparent>> { + BorderColor transparent + BackgroundColor transparent + FontColor transparent +} + +skinparam rectangle<<1>> { + BackgroundColor #ffffff + FontColor #000000 + BorderColor #888888 + roundCorner 20 +} +rectangle "==Element" <<1>> + +skinparam rectangle<<2>> { + BackgroundColor #438dd5 + FontColor #ffffff + BorderColor #2e6295 + roundCorner 20 +} +rectangle "==Container" <<2>> + +rectangle "." <<_transparent>> as 3 +3 .[#707070,thickness=2].> 3 : "Relationship" + + +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-Deployment-001.puml b/src/docs/structurizr/structurizr-Deployment-001.puml new file mode 100644 index 0000000..605492d --- /dev/null +++ b/src/docs/structurizr/structurizr-Deployment-001.puml @@ -0,0 +1,54 @@ +@startuml +set separator none +title System - Deployment - Live + +left to right direction + +skinparam { + arrowFontSize 10 + defaultTextAlignment center + wrapWidth 200 + maxMessageSize 100 +} + +hide stereotype + +skinparam rectangle<> { + BackgroundColor #438dd5 + FontColor #ffffff + BorderColor #2e6295 + roundCorner 20 + shadowing false +} +skinparam rectangle<> { + BackgroundColor #ffffff + FontColor #000000 + BorderColor #888888 + roundCorner 20 + shadowing false +} +skinparam rectangle<> { + BackgroundColor #438dd5 + FontColor #ffffff + BorderColor #2e6295 + roundCorner 20 + shadowing false +} +skinparam rectangle<> { + BackgroundColor #ffffff + FontColor #000000 + BorderColor #888888 + roundCorner 20 + shadowing false +} + +rectangle "Web Server\n[Deployment Node: Apache Tomcat]" <> as Live.WebServer { + rectangle "==Web Application\n[Container: Java and Spring MVC]\n\nThe web application." <> as Live.WebServer.WebApplication_1 +} + +rectangle "Database Server\n[Deployment Node: MySQL]" <> as Live.DatabaseServer { + rectangle "==Database\n[Container: MySQL]\n\nThe database." <> as Live.DatabaseServer.Database_1 +} + +Live.WebServer.WebApplication_1 .[#707070,thickness=2].> Live.DatabaseServer.Database_1 : "Reads from and writes to" +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-SystemContext-001-key.puml b/src/docs/structurizr/structurizr-SystemContext-001-key.puml new file mode 100644 index 0000000..1d89467 --- /dev/null +++ b/src/docs/structurizr/structurizr-SystemContext-001-key.puml @@ -0,0 +1,38 @@ +@startuml +set separator none + +skinparam { + shadowing false + arrowFontSize 15 + defaultTextAlignment center + wrapWidth 100 + maxMessageSize 100 +} +hide stereotype + +skinparam rectangle<<_transparent>> { + BorderColor transparent + BackgroundColor transparent + FontColor transparent +} + +skinparam person<<1>> { + BackgroundColor #08427b + FontColor #ffffff + BorderColor #052e56 +} +person "==Person" <<1>> + +skinparam rectangle<<2>> { + BackgroundColor #1168bd + FontColor #ffffff + BorderColor #0b4884 + roundCorner 20 +} +rectangle "==Software System" <<2>> + +rectangle "." <<_transparent>> as 3 +3 .[#707070,thickness=2].> 3 : "Relationship" + + +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr-SystemContext-001.puml b/src/docs/structurizr/structurizr-SystemContext-001.puml new file mode 100644 index 0000000..cf9c751 --- /dev/null +++ b/src/docs/structurizr/structurizr-SystemContext-001.puml @@ -0,0 +1,34 @@ +@startuml +set separator none +title System - System Context + +left to right direction + +skinparam { + arrowFontSize 10 + defaultTextAlignment center + wrapWidth 200 + maxMessageSize 100 +} + +hide stereotype + +skinparam rectangle<> { + BackgroundColor #1168bd + FontColor #ffffff + BorderColor #0b4884 + roundCorner 20 + shadowing false +} +skinparam person<> { + BackgroundColor #08427b + FontColor #ffffff + BorderColor #052e56 + shadowing false +} + +person "==User\n[Person]\n\nA user of the system." <> as User +rectangle "==System\n[Software System]\n\nThe system." <> as System + +User .[#707070,thickness=2].> System : "Uses" +@enduml \ No newline at end of file diff --git a/src/docs/structurizr/structurizr.dsl b/src/docs/structurizr/structurizr.dsl new file mode 100644 index 0000000..4d73a9f --- /dev/null +++ b/src/docs/structurizr/structurizr.dsl @@ -0,0 +1,95 @@ +workspace { + + model { + user = person "User" { + description "A user of the system." + } + + system = softwareSystem "System" { + description "The system." + user -> this "Uses" + + webapp = container "Web Application" { + description "The web application." + technology "Java and Spring MVC" + user -> this "Uses" + + componentA = component "Component A" { + description "A component within the web application." + technology "Spring Bean" + } + + componentB = component "Component B" { + description "Another component within the web application." + technology "Spring Bean" + } + } + + database = container "Database" { + description "The database." + technology "MySQL" + webapp -> this "Reads from and writes to" + } + } + + deploymentEnvironment "Live" { + deploymentNode "Web Server" { + technology "Apache Tomcat" + webappInstance = containerInstance webapp + } + + deploymentNode "Database Server" { + technology "MySQL" + databaseInstance = containerInstance database + } + } + } + + views { + systemContext system { + include user + include system + autolayout lr + } + + container system { + include * + autolayout lr + } + + component webapp { + include * + autolayout lr + } + + deployment system "Live" { + include * + autolayout lr + } + + theme default + + styles { + element "Software System" { + background "#1168bd" + color "#ffffff" + } + + element "Person" { + background "#08427b" + color "#ffffff" + shape "person" + } + + element "Container" { + background "#438dd5" + color "#ffffff" + } + + element "Component" { + background "#85bbf0" + color "#000000" + } + } + } +} diff --git a/src/docs/structurizr/structurizr.properties b/src/docs/structurizr/structurizr.properties new file mode 100644 index 0000000..926c290 --- /dev/null +++ b/src/docs/structurizr/structurizr.properties @@ -0,0 +1,3 @@ +structurizr.cli.version=2.1.1 +structurizr.cli.workspace=structurizr.dsl +structurizr.output.dir=src/docs/asciidoc/diagrams