# torizon/vscode-torizon-templates architecture

> Architecture diagram of the GitHub repository torizon/vscode-torizon-templates, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/torizon/vscode-torizon-templates
- Repository: https://github.com/torizon/vscode-torizon-templates

## Overview

##### Main Components
- Template Categories: Notice that there are many top-level directories (for example, aspnetBlazor, cppConsole, cppQML, dotnetConsole, dartFlutter, nodeJSTypeScript, etc.). These represent the various development templates grouped by language and runtime.
- CI/CD and Build Automation: The repository includes a .github/workflows folder with multiple YAML files for building and publishing across different technology stacks (e.g., build-dotnet.yaml, build-python.yaml, build-rust.yaml). Additionally, there are scripts under scripts/ that manage containerization and deployment.
- Shared Assets and Configurations: The assets directory houses images and JSON configurations (like tasks.schema.json, torizonPackages.json), which are used by the extension and for documentation. There are also shared configuration files (e.g., .gitignore, CODE_OF_CONDUCT.md, CONTRIBUTING.md) that serve as a backbone for repository practices.
- Developer Tools Integration: The repository serves as the “template backend” for the VS Code Torizon templates extension, which means that there’s an integration flow between the developer’s IDE, these templates, and the CI/CD pipelines that build and deploy them.

##### Relationships and Interactions
- The central “Templates Repository” is the host for all template projects. Each template subdirectory is an independent module with its own build and runtime dependencies. They may all follow similar patterns (Dockerfiles, docker-compose.yml, build scripts) to streamline deployment.
- The CI/CD workflows (in .github/workflows and scripts) are linked to these project directories. They are triggered automatically via version control events (pushes, pull requests) and are configured to test, build, and sometimes publish container images.
- The assets (images, JSON configuration files) connect to both the README (for documentation) and the distributed extension for rendering UI elements (like thumbnails for each template).
- The VS Code Torizon extension interacts with this repository to offer these templates to developers, so there is an integration point between the extension’s logic and how it pulls/updates the templates.

##### Architectural Patterns and Design Principles
- Modularity: The repository is organized in a modular fashion with each template self-contained. This allows independent evolution and ease of maintenance.
- DevOps Integration: Extensive use of CI/CD pipelines demonstrates automation and continuous testing/builds, which is crucial for a project supporting multi-platform templates.
- Extensibility: Community-supported templates and partner templates indicate that the architecture is designed to be extensible. New directories representing additional templates can be added without affecting existing ones.
- Consistent Configuration: Use of shared configuration files and scripts simplifies dependency management and enforces standards across all templates.

##### Relevant Technologies and Frameworks
- Build/Automation: GitHub Actions, GitLab CI (observed via assets/gitlab), Docker (Dockerfiles and docker-compose), and various build systems such as CMake, Makefile, and others.
- Programming Languages/Runtimes: C/C++, C#, Python, Dart, Rust, Node.js, and Zig among others.
- Containerization: Docker is heavily used for deployment and testing across all templates.
- Developer Environment: Integration with VS Code via the Torizon IDE extension.

## Diagram (Mermaid)

```mermaid
flowchart TD
    R["VS Code Torizon Templates Repository"]:::core

    subgraph "Template Modules"
        A1["aspnetBlazor"]:::template
        A2["cppConsole"]:::template
        A3["cppQML"]:::template
        A4["dotnetConsole"]:::template
        A5["dartFlutter"]:::template
        A6["nodeJSTypeScript"]:::template
        A7["python3Console"]:::template
        A8["rustSlint"]:::template
        A9["zigConsole"]:::template
        A10["cmakeConsole"]:::template
        A11["cmakeGTK3"]:::template
        A12["cmakeGTK4"]:::template
        A13["genericTemplate"]:::template
    end

    subgraph "CI/CD & Build Automation"
        B1["GitHub Workflows"]:::ci
        B2["Build Scripts"]:::ci
    end

    subgraph "Shared Assets & Configurations"
        C1["Assets"]:::asset
        C2["Shared Config Files"]:::asset
    end

    subgraph "IDE Integration"
        D1["VS Code Integration"]:::integration
    end

    R -->|"contains"| A1
    R -->|"contains"| B1
    R -->|"provides"| C1
    R -->|"integrates"| D1

    %% Template Modules trigger CI/CD builds
    A1 -->|"triggers"| B1
    A2 -->|"triggers"| B1
    A3 -->|"triggers"| B1
    A4 -->|"triggers"| B1
    A5 -->|"triggers"| B1
    A6 -->|"triggers"| B1
    A7 -->|"triggers"| B1
    A8 -->|"triggers"| B1
    A9 -->|"triggers"| B1
    A10 -->|"triggers"| B1
    A11 -->|"triggers"| B1
    A12 -->|"triggers"| B1
    A13 -->|"triggers"| B1

    %% Template Modules use Build Scripts
    A1 -->|"uses"| B2
    A2 -->|"uses"| B2
    A3 -->|"uses"| B2
    A4 -->|"uses"| B2
    A5 -->|"uses"| B2
    A6 -->|"uses"| B2
    A7 -->|"uses"| B2
    A8 -->|"uses"| B2
    A9 -->|"uses"| B2
    A10 -->|"uses"| B2
    A11 -->|"uses"| B2
    A12 -->|"uses"| B2
    A13 -->|"uses"| B2

    %% CI/CD components read shared configs
    B1 -->|"reads"| C2
    B2 -->|"reads"| C2

    %% Template Modules use shared assets
    A1 -->|"uses"| C1
    A2 -->|"uses"| C1
    A3 -->|"uses"| C1
    A4 -->|"uses"| C1
    A5 -->|"uses"| C1
    A6 -->|"uses"| C1
    A7 -->|"uses"| C1
    A8 -->|"uses"| C1
    A9 -->|"uses"| C1
    A10 -->|"uses"| C1
    A11 -->|"uses"| C1
    A12 -->|"uses"| C1
    A13 -->|"uses"| C1

    %% VS Code Integration pulls template information
    D1 -->|"pulls"| A1
    D1 -->|"pulls"| A2
    D1 -->|"pulls"| A3
    D1 -->|"pulls"| A4
    D1 -->|"pulls"| A5
    D1 -->|"pulls"| A6
    D1 -->|"pulls"| A7
    D1 -->|"pulls"| A8
    D1 -->|"pulls"| A9
    D1 -->|"pulls"| A10
    D1 -->|"pulls"| A11
    D1 -->|"pulls"| A12
    D1 -->|"pulls"| A13

    %% Click Events for Component Mapping
    click A1 "https://github.com/torizon/vscode-torizon-templates/tree/dev/aspnetBlazor"
    click A2 "https://github.com/torizon/vscode-torizon-templates/tree/dev/cppConsole"
    click A3 "https://github.com/torizon/vscode-torizon-templates/tree/dev/cppQML"
    click A4 "https://github.com/torizon/vscode-torizon-templates/tree/dev/dotnetConsole"
    click A5 "https://github.com/torizon/vscode-torizon-templates/tree/dev/dartFlutter"
    click A6 "https://github.com/torizon/vscode-torizon-templates/tree/dev/nodeJSTypeScript"
    click A7 "https://github.com/torizon/vscode-torizon-templates/tree/dev/python3Console"
    click A8 "https://github.com/torizon/vscode-torizon-templates/tree/dev/rustSlint"
    click A9 "https://github.com/torizon/vscode-torizon-templates/tree/dev/zigConsole"
    click A10 "https://github.com/torizon/vscode-torizon-templates/tree/dev/cmakeConsole"
    click A11 "https://github.com/torizon/vscode-torizon-templates/tree/dev/cmakeGTK3"
    click A12 "https://github.com/torizon/vscode-torizon-templates/tree/dev/cmakeGTK4"
    click A13 "https://github.com/torizon/vscode-torizon-templates/tree/dev/genericTemplate"
    click B1 "https://github.com/torizon/vscode-torizon-templates/tree/dev/.github/workflows"
    click B2 "https://github.com/torizon/vscode-torizon-templates/tree/dev/scripts"
    click C1 "https://github.com/torizon/vscode-torizon-templates/tree/dev/assets"
    click C2 "https://github.com/torizon/vscode-torizon-templates/blob/dev/.gitignore"
    click D1 "https://github.com/torizon/vscode-torizon-templates/blob/dev/.vscode"

    %% Styles
    classDef core fill:#f9e79f,stroke:#6e2c00,stroke-width:2px;
    classDef template fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef ci fill:#a9dfbf,stroke:#27ae60,stroke-width:2px;
    classDef asset fill:#fadbd8,stroke:#c0392b,stroke-width:2px;
    classDef integration fill:#d2b4de,stroke:#8e44ad,stroke-width:2px;
```
