# dimanikulin/capable-cpp-template architecture

> Architecture diagram of the GitHub repository dimanikulin/capable-cpp-template, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dimanikulin/capable-cpp-template
- Repository: https://github.com/dimanikulin/capable-cpp-template

## Overview

##### Project type and purpose
- There is no “business logic” per se—its core functionality is to serve as a reusable scaffold for any C++ library or application.

a. Developer Environment
- Source code (src/)
- Unit tests (test/)
- CMakeLists.txt, .clang-format, CI config (.github/workflows/)
b. Build System
- CMake → Ninja (with ccache)
c. Static Analysis & Formatting
- CppCheck (via GitHub Action codeChecks.yml)
- clang-tidy (optional stage)
- clang-format (local/scripts)
d. Test & Coverage
- Google Test + CTest
- GCov/LCov → filtered coverage → HTML report
e. Documentation
- Doxygen (configured by doxy.cfg) → GitHub Pages (releaseDocs.yml)
f. Packaging & Release
- 7zip (strip & archive binaries)
- WiX (Windows MSI)
- GitHub Releases (upload artifacts)
g. CI Orchestration
- GitHub Actions workflows:
– codeChecks.yml
– multi-platform-build.yml
– releaseDocs.yml
h. External Services
- GitHub (repo + Actions + Pages + Releases)

##### Component interactions & data flows
1. Developer commits → pushes to GitHub
2. GitHub triggers CI workflows:
- codeChecks → runs CppCheck, formatting checks, optional clang-tidy
- multi-platform-build → invokes CMake & Ninja on Linux, Windows, macOS
– After build: run tests via CTest → upload test results
– Run coverage capture → filter & generate HTML → upload to GitHub
- releaseDocs → run Doxygen → deploy docs to GitHub Pages
3. multi-platform-build also runs packaging:
- Linux/Mac ZIP via 7zip
- Windows MSI via WiX
→ artifacts uploaded to GitHub Releases
4. Developer pulls, iterates locally:
- runs CMake build/test/format via provided scripts
- updates docs/resources in docs/, scripts/, packaging/

##### Architectural patterns & design principles
- Modular separation of concerns: source vs. tests vs. docs vs. packaging
- CI stages as discrete, reusable pipelines
- Feature flags in CMake (e.g., BUILD_TESTS, BUILD_DOCS) to enable/disable functionality
- Extensibility: add new linters, platforms, packaging formats by dropping in new scripts/CI jobs and updating CMake

##### Detail
- CMake as the orchestrator within the build stage, invoking Ninja, GTest, and coverage tools.
- Optional toggles (BUILD_TESTS, BUILD_DOCS) as decision diamonds or annotations.

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% Developer Environment
  subgraph "Developer Environment"
    direction TB
    SC["Source Code (src/)"]:::local
    UT["Unit Tests (test/)"]:::local
    subgraph "Resources"
      direction TB
      ICONS["Icons (resources/icons/)"]:::local
      DOCSRES["Docs (docs/)"]:::local
      SCRIPTS["Scripts (scripts/)"]:::local
      PACKRES["Packaging Resources (packaging/)"]:::local
    end
    CLLIST["Root CMakeLists.txt"]:::local
    DOXYCFG["Doxyfile (doxy.cfg)"]:::local
    CLANGFMT[".clang-format"]:::local
  end

  %% CI Pipelines
  subgraph "CI Pipelines" 
    direction TB
    CC["CodeChecks"]:::ci
    BB["Build+Test"]:::ci
    COV["Coverage"]:::ci
    DOCPIPE["Docs Pipeline"]:::ci
    PKG["Packaging"]:::ci
  end

  %% Artifacts
  subgraph "Artifacts"
    direction TB
    COVERAGEART["Coverage Report"]:::ci
    DOCART["Docs Artifacts"]:::ci
    PKGZIP["ZIP Packages"]:::ci
    MSIART["MSI Package"]:::ci
  end

  %% External Services
  subgraph "External Services"
    direction TB
    GITHUB["GitHub Repo"]:::external
    ACTIONS["GitHub Actions"]:::external
    PAGES["GitHub Pages"]:::external
    RELEASES["GitHub Releases"]:::external
  end

  %% Connections
  SC -->|"commit/push"| GITHUB
  UT -->|"commit/push"| GITHUB
  CLLIST -->|"commit/push"| GITHUB
  DOXYCFG -->|"commit/push"| GITHUB
  CLANGFMT -->|"commit/push"| GITHUB

  GITHUB -->|"trigger workflows"| ACTIONS
  ACTIONS -->|"run codeChecks.yml"| CC
  ACTIONS -->|"run multi-platform-build.yml"| BB
  ACTIONS -->|"run multi-platform-build.yml"| COV
  ACTIONS -->|"run releaseDocs.yml"| DOCPIPE
  ACTIONS -->|"run multi-platform-build.yml"| PKG

  BB -->|"run CMake & Ninja"| BB
  BB -->|"run CTest"| BB
  BB -->|"invoke Coverage"| COV

  COV -->|"generate HTML"| COVERAGEART
  COVERAGEART -->|"upload coverage"| RELEASES

  DOCPIPE -->|"run Doxygen"| DOCART
  DOCART -->|"deploy docs"| PAGES

  PKG -->|"create ZIP"| PKGZIP
  PKG -->|"create MSI"| MSIART
  PKGZIP -->|"upload artifacts"| RELEASES
  MSIART -->|"upload artifacts"| RELEASES

  %% Click Events
  click SC "https://github.com/dimanikulin/capable-cpp-template/tree/main/src/"
  click UT "https://github.com/dimanikulin/capable-cpp-template/tree/main/test/"
  click ICONS "https://github.com/dimanikulin/capable-cpp-template/tree/main/resources/icons/"
  click DOCSRES "https://github.com/dimanikulin/capable-cpp-template/tree/main/docs/"
  click SCRIPTS "https://github.com/dimanikulin/capable-cpp-template/tree/main/scripts/"
  click PACKRES "https://github.com/dimanikulin/capable-cpp-template/tree/main/packaging/"
  click CLLIST "https://github.com/dimanikulin/capable-cpp-template/blob/main/CMakeLists.txt"
  click DOXYCFG "https://github.com/dimanikulin/capable-cpp-template/blob/main/doxy.cfg"
  click CLANGFMT "https://github.com/dimanikulin/capable-cpp-template/blob/main/.clang-format"
  click CC "https://github.com/dimanikulin/capable-cpp-template/blob/main/.github/workflows/codeChecks.yml"
  click BB "https://github.com/dimanikulin/capable-cpp-template/blob/main/.github/workflows/multi-platform-build.yml"
  click COV "https://github.com/dimanikulin/capable-cpp-template/blob/main/.github/workflows/multi-platform-build.yml"
  click DOCPIPE "https://github.com/dimanikulin/capable-cpp-template/blob/main/.github/workflows/releaseDocs.yml"
  click PKG "https://github.com/dimanikulin/capable-cpp-template/blob/main/.github/workflows/multi-platform-build.yml"

  %% Styles
  classDef local fill:#D6EAF8,stroke:#1B4F72,color:#1B2631
  classDef ci fill:#D5F5E3,stroke:#196F3D,color:#145A32
  classDef external fill:#FAD7A0,stroke:#B9770E,color:#7E5109
```
