# cyberflood/switchtoopen architecture

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

- Interactive diagram: https://gitdiagram.com/cyberflood/switchtoopen
- Repository: https://github.com/cyberflood/switchtoopen

## Overview

##### Project Type and Purpose
- SwitchToOpen is not a traditional application with a frontend framework and backend API. It is a content-driven static site repository (a documentation site) that aggregates and maintains markdown-based references to open-source tools, organized by category. It leverages GitHub for version control, link validation via CI, and GitHub Pages (or a similar static-site host) for publishing.

##### File Structure Analysis
- Top-level directories:
- .github: GitHub Actions workflows (link-checker).
- Img: image assets (logo, outline tip, etc.).
- metadata: templates and taxonomy definitions (categories.md, tags.md, template files).
- Markdown files at root: each major category (Antivirus.md, Gestion de base de données.md, etc.).
- README.md, CONTRIBUTING.md, LICENSE, and various policy/guide documents.
- No “src” or “build” folder: the markdown is the source; the static-site generator or GitHub Pages reads it directly.

##### Architecture Insights from README
- Content is organized per category, each category page is a markdown file with a table of tools.
- CI ensures link health (“.github/workflows/link-checker.yml”).
- Community contribution model (CONTRIBUTING.md + Discord).
- Deployment target: GitHub Pages (implicit from GitHub repo structure and no custom server code).

##### Core Components
a. Content Repository
- Markdown files (category pages, metadata templates, guides)
- Assets (Img folder)
- Configuration (.github for CI)
b. Continuous Integration
- GitHub Actions workflow runs on push/PR
- Link-checker job validates URLs in markdown
- Optionally, any future build steps (if a static-site generator is added)
c. Static Site Generator / GitHub Pages
- Takes markdown + assets + metadata → transforms into HTML/CSS (via Jekyll, Hugo, or native GitHub Pages)
d. Hosting & Delivery
- GitHub Pages serves static site
- CDN (GitHub’s global edge network) delivers assets to end users
e. Consumers of the Site
- End users (browsers)
- Contributors (via GitHub UI / CLI)

##### Relationships and Interactions
- Developer clones repo → edits or adds markdown → pushes to GitHub.
- GitHub Actions triggers link-checker → feedback in PR.
- On merge to main, Pages build either automatically or via an explicit CI step.
- Generated HTML + assets published to GitHub Pages endpoint.
- End user browser requests pages → served via CDN.

##### Architectural Patterns & Principles
- Content-as-Code: markdown source in Git with code review.
- CI-driven quality: automated link validation to maintain content integrity.
- Single-page vs multi-page static site: one markdown = one page.
- Separation of concerns: content (markdown), metadata (templates), automation (CI), presentation (Pages theme).
- Open Collaboration: community contributions via PRs + issue templates.

##### Technologies & Frameworks
- Git / GitHub (repo, issues, PRs)
- GitHub Actions (link-checker workflow)
- Markdown (content source)
- GitHub Pages (static site hosting; possibly Jekyll under the hood)
- CSS/HTML theme (default or custom)

##### Essential Elements to Capture
- Content-as-code flow
- Automated link checking CI
- Static site generation & hosting
- Community contributions lifecycle
- Delivery to end users

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Content Layer
    subgraph "Content Repository" 
        direction TB
        MR["Root Markdown Files"]:::source
        CS["Cybersécurité Markdown Files"]:::source
        META["Metadata Templates & Taxonomy"]:::source
        ASSETS["Image Assets"]:::source
    end

    %% CI Layer
    subgraph "Continuous Integration" 
        direction TB
        GH_A["GitHub Actions"]:::automation
        LINK["Link-Checker Workflow"]:::automation
    end

    %% Build & Hosting Layer
    subgraph "Build & Hosting" 
        direction TB
        SSG["Static Site Generator"]:::build
        PAGES["GitHub Pages"]:::build
        CDN["CDN (Edge Network)"]:::build
    end

    %% Consumer Layer
    subgraph "Consumers" 
        direction TB
        DEV["Developer"]:::consumer
        CONTRIB["Contributor"]:::consumer
        BROWSER["End-User Browser"]:::consumer
    end

    %% Relationships
    DEV -->|"Commit/PR"| MR
    DEV -->|"Commit/PR"| CS
    DEV -->|"Commit/PR"| META
    DEV -->|"Commit/PR"| ASSETS
    CONTRIB -->|"Commit/PR"| MR
    CONTRIB -->|"Commit/PR"| CS
    CONTRIB -->|"Commit/PR"| META
    CONTRIB -->|"Commit/PR"| ASSETS

    MR -->|"push to repo"| GH_A
    CS -->|"push to repo"| GH_A
    META -->|"push to repo"| GH_A
    ASSETS -->|"push to repo"| GH_A

    GH_A -->|"triggers"| LINK
    LINK -->|"Validation report"| GH_A

    GH_A -->|"Build & deploy"| SSG
    SSG -->|"Generate HTML/CSS"| PAGES
    PAGES -->|"Serve content"| CDN

    BROWSER -->|"HTTP GET"| CDN
    CDN -->|"Fetch static assets"| PAGES

    %% Click Events
    click MR "https://github.com/cyberflood/switchtoopen/blob/dev/Antivirus.md"
    click CS "https://github.com/cyberflood/switchtoopen/tree/dev/Cybersécurité/"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/categories.md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/tags.md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/template_fiche_outil.md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/exemple.md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/exemple2.md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/exemple_trivy.md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/DevSecOps et Sécurité des Conteneurs.md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/Sécurité Défensive (SOC,SIEM).md"
    click META "https://github.com/cyberflood/switchtoopen/blob/dev/metadata/Sécurité Offensive (Pentest).md"
    click ASSETS "https://github.com/cyberflood/switchtoopen/tree/dev/Img/"
    click LINK "https://github.com/cyberflood/switchtoopen/blob/dev/.github/workflows/link-checker.yml"
    click CONTRIB "https://github.com/cyberflood/switchtoopen/blob/dev/CONTRIBUTING.md"
    click CONTRIB "https://github.com/cyberflood/switchtoopen/blob/dev/.github/ISSUE_TEMPLATE/issue_report.md"
    click CONTRIB "https://github.com/cyberflood/switchtoopen/blob/dev/.github/ISSUE_TEMPLATE/proposal.md"
    click CONTRIB "https://github.com/cyberflood/switchtoopen/blob/dev/README.md"

    %% Styles
    classDef source fill:#cce5ff,stroke:#004085,color:#004085;
    classDef automation fill:#ffe5b4,stroke:#cc7a00,color:#cc7a00;
    classDef build fill:#d4edda,stroke:#155724,color:#155724;
    classDef consumer fill:#e2e3e5,stroke:#636d76,color:#636d76;
```
