# githubocto/repo-visualizer architecture

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

- Interactive diagram: https://gitdiagram.com/githubocto/repo-visualizer
- Repository: https://github.com/githubocto/repo-visualizer

## Overview

##### Main Components Identification

a) Input Processing Layer
b) Repository Scanner
c) Visualization Generator
d) Output Handler

##### Component Details

**[GitHub Actions Runtime] → [Input Configuration Handler]**
- output_file
- excluded_paths
- excluded_globs
- other configs...

**[Input Configuration Handler] → [Path Processing Engine]**
- process-dir.js
- should-exclude-path.ts
- utils.ts

**[Path Processing Engine] → [Visualization Engine]**
- Tree.tsx
- CircleText.tsx

**[Visualization Engine] → [Output Management System]**
- SVG Generation
- Artifact Creation
- Git Operations

##### Important Implementation Details to Highlight

- React components separately as they handle rendering
- Configuration validation flow
- Error handling paths
- Demonstrate the three possible output paths (file, artifact, commit)

##### Technical Stack Indicators

Technology badges or labels for:
- Node.js runtime
- React for SVG generation
- TypeScript for type safety
- GitHub Actions integration points

##### Additional Elements

- A callout showing the SVG generation process
- A note about the artifact creation option
- Git commit process when should_push is true

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "GitHub Actions Runtime"
        GHA["GitHub Actions Environment"]
        AC["action.yml"]:::config
        IDX["index.js"]:::entry
    end

    subgraph "Input Processing Layer"
        ICH["Input Configuration Handler"]
        CV["Configuration Validator"]
    end

    subgraph "Repository Scanner"
        PD["Process Directory"]:::scanner
        SEP["Path Exclusion System"]:::scanner
        UT["Utility Functions"]:::scanner
    end

    subgraph "Visualization Generator"
        VE["Visualization Engine"]
        TREE["Tree Component"]:::react
        CT["Circle Text Component"]:::react
        LC["Language Colors"]:::data
    end

    subgraph "Output Management"
        SVG["SVG Generation"]
        ART["Artifact Creation"]
        GIT["Git Operations"]
    end

    subgraph "Build & Test"
        TS["TypeScript Config"]:::config
        JEST["Jest Config"]:::config
        PKG["Package Config"]:::config
        CICD["CI/CD Pipeline"]:::config
    end

    %% Relationships
    GHA --> AC
    AC --> IDX
    IDX --> ICH
    ICH --> CV
    CV --> PD
    PD --> SEP
    PD --> UT
    SEP --> VE
    VE --> TREE
    VE --> CT
    VE --> LC
    TREE --> SVG
    CT --> SVG
    SVG --> ART
    SVG --> GIT

    %% Click Events
    click AC "https://github.com/githubocto/repo-visualizer/blob/main/action.yml"
    click IDX "https://github.com/githubocto/repo-visualizer/blob/main/index.js"
    click PD "https://github.com/githubocto/repo-visualizer/blob/main/src/process-dir.js"
    click SEP "https://github.com/githubocto/repo-visualizer/blob/main/src/should-exclude-path.ts"
    click UT "https://github.com/githubocto/repo-visualizer/blob/main/src/utils.ts"
    click TREE "https://github.com/githubocto/repo-visualizer/blob/main/src/Tree.tsx"
    click CT "https://github.com/githubocto/repo-visualizer/blob/main/src/CircleText.tsx"
    click LC "https://github.com/githubocto/repo-visualizer/blob/main/src/language-colors.json"
    click TS "https://github.com/githubocto/repo-visualizer/blob/main/tsconfig.json"
    click JEST "https://github.com/githubocto/repo-visualizer/blob/main/jest.config.cjs"
    click PKG "https://github.com/githubocto/repo-visualizer/blob/main/package.json"
    click CICD "https://github.com/githubocto/repo-visualizer/blob/main/.github/workflows/test.yaml"

    %% Styling
    classDef config fill:#f9f,stroke:#333
    classDef entry fill:#ffa,stroke:#333
    classDef scanner fill:#aff,stroke:#333
    classDef react fill:#9cf,stroke:#333
    classDef data fill:#fd9,stroke:#333

    %% Legend
    subgraph Legend
        L1["Configuration File"]:::config
        L2["Entry Point"]:::entry
        L3["Scanner Component"]:::scanner
        L4["React Component"]:::react
        L5["Data Store"]:::data
    end
```
