This template repo is meant to be used as a basis for writing architecture documentation. You can follow these steps to add the documentation to your repo:
In the root folder of your repo
git clone [email protected]:Swiss-Digital-Assets-Institute/hashgraph-arch-doc-template.git docs
rm -rf docs/.git
cd docs
git add .
git commit -m "documentation template"This repository contains the architecture documentation for the Managed Transaction gateway. The documentation is written in AsciiDoc and can be converted to HTML or PDF using Docker and docker-compose.
The docs directory contains the architecture documentation for the project, following the THA template:
- Introduction and Goals: Overview, requirements, and stakeholders.
- Architecture Constraints: Technical and organizational constraints.
- System Scope and Context: Business and technical context.
- Solution Strategy: Fundamental decisions and solution strategies.
- Building Block View: Static decomposition of the system.
- Runtime View: Dynamic aspects and key scenarios.
- Deployment View: Technical infrastructure and deployment.
- Cross-cutting Concepts: Overarching concepts and patterns.
- Architecture Decisions: Key architectural decisions (ADRs).
- Quality Requirements: Quality tree and quality scenarios.
- Risks and Technical Debt: Known risks and technical debt.
- Glossary: Domain and technical terms.
To build the documentation, you need:
- Docker: Install Docker from docker.com
- Docker Compose: Usually comes with Docker Desktop for Windows and Mac. For Linux, you might need to install it separately.
We use a docker-compose-arch.yml file to define the build process for both HTML and PDF outputs.
docker compose -f docker-compose-arch.yml up --no-recreate build-htmldocker-compose -f docker-compose-arch.yml up --no-recreate build-htmlThis will generate index.html in the docs/architecture/build-html directory.
docker compose -f docker-compose-arch.yml up --no-recreate build-pdfdocker-compose -f docker-compose-arch.yml up --no-recreate build-pdfThis will generate index.pdf in the docs/architecture/build-pdf directory.
We use Confluence Publisher to automatically publish the AsciiDoc documentation to a Confluence space.
You can manually publish the documentation to Confluence by running the following command:
docker-compose -f docker-compose-arch.yml run publish-confluenceBefore running the publish confluence command, ensure the following environment variables are set:
ROOT_CONFLUENCE_URL: Base URL for your Confluence instance.USERNAME: Confluence username (or API token for cloud instances).PASSWORD: Confluence password (or API token for cloud instances).SPACE_KEY: Confluence space key where the documentation will be published.ANCESTOR_ID: ID of the parent (ancestor) page under which the documentation will be published.PAGE_TITLE_PREFIX: (Optional) Prefix for page titles.PAGE_TITLE_SUFFIX: (Optional) Suffix for page titles.PROJECT_VERSION: Version of the project, included in the version message.
export ROOT_CONFLUENCE_URL="https://your-confluence-instance.com"
export USERNAME="your-username"
export PASSWORD="your-api-token"
export SPACE_KEY="YOUR_SPACE_KEY"
export ANCESTOR_ID="12345678"
export PAGE_TITLE_PREFIX="Draft - "
export PAGE_TITLE_SUFFIX=" - Architecture"
export PROJECT_VERSION="0.0.1"
docker-compose -f docker-compose-arch.yml run publish-confluenceThe docker-compose-arch.yml file is set up to use the asciidoctor/docker-asciidoctor image, which includes support for diagrams. If you need to customize the build process:
- Modify the
commandsection in thedocker-compose-arch.ymlfile. - Add any necessary volumes or environment variables.
We use GitHub Actions to automatically build and publish the documentation to GitHub Pages:
- The documentation is built automatically when changes are pushed to the main branch.
- GitHub Actions uses the
docker-compose-arch.ymlfile to generate the HTML and PDF versions. - The generated files are then published to GitHub Pages.
Note: There's no need to commit the generated index.html or index.pdf files. The GitHub Action handles the build and publish process.
When contributing to the documentation:
- Write your content in the appropriate
.adocfiles within thedocs/architecturedirectory. - Use AsciiDoc syntax for formatting.
- If adding diagrams, ensure they are in a format supported by asciidoctor-diagram.
- You can build the documentation locally using the docker-compose commands to verify your changes before pushing.
- Submit a pull request with your updates.