# michelcaradec/string-checker-js architecture

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

- Interactive diagram: https://gitdiagram.com/michelcaradec/string-checker-js
- Repository: https://github.com/michelcaradec/string-checker-js

## Overview

##### Main Components Identification

The system can be broken down into these primary components:

a) Core Extension Layer
- Extension entry point (extension.ts)
- Commands handler (commands.ts)
- Constants and enumerations

b) String Detection Engine
- Provider Collection System
- Multiple Detection Providers
- Text Parsing System

c) User Interface Components
- Tree View System
- Stats System

d) User Dictionary System
- Dictionary Items
- Persistence Layer

##### Parser System
- Text Parser
- Token Collection
##### Provider Collection
- Providers (ClassName, Code, Detect, Entropy, Keywords, Language, String)
##### User Dictionary System
- Dictionary Items
- Persistence

d) Storage Layer (Bottom Layer)
- File System (for user dictionary persistence)
- In-memory storage for scan results

##### Interaction Flows

- Command flow from VS Code to the extension
- Text parsing flow through the detection system
- Results flow to the Tree View
- Dictionary updates flow to persistence

Create clear separations between:
- Extension Interface Layer
- Business Logic Layer
- Data Processing Layer
- Storage Layer

##### Additional Elements

Supporting elements:
- Version information
- Key configuration points
- External dependencies (franc, escape-string-regexp)

##### The persistence mechanism for user preferences

Keep the abstraction level focused on the architectural components while showing the relationships between the different detection providers and the core system components. This will help developers understand both the high-level structure and the detailed interaction patterns of the extension.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph VSCode
        VSCodeAPI[VS Code Extension API]
    end

    subgraph CoreLayer
        Extension["Extension Entry Point"]:::core
        Commands["Commands Handler"]:::core
        Constants["Constants & Enums"]:::core
    end

    subgraph UILayer
        TreeView["Tree View System"]:::ui
        Stats["Stats System"]:::ui
    end

    subgraph ProcessingLayer
        subgraph ParserSystem
            TextParser["Text Parser"]:::parser
            TokenCollection["Token Collection"]:::parser
        end

        subgraph ProviderSystem
            ProviderCollection["Provider Collection"]:::provider
            ClassNameProvider["Class Name Provider"]:::detector
            CodeDetect["Code Detector"]:::detector
            DetectProvider["Detect Provider"]:::detector
            EntropyDetect["Entropy Detector"]:::detector
            KeywordsDetect["Keywords Detector"]:::detector
            LanguageDetect["Language Detector"]:::detector
            StringDetect["String Detector"]:::detector
        end

        subgraph DictionarySystem
            DictItems["Dictionary Items"]:::dict
            DictPersist["Dictionary Persistence"]:::dict
        end
    end

    subgraph StorageLayer
        FileSystem["File System"]:::storage
        InMemoryStorage["In-Memory Storage"]:::storage
    end

    %% Connections
    VSCodeAPI --> Extension
    Extension --> Commands
    Extension --> Constants
    Commands --> TreeView
    Commands --> Stats
    Commands --> TextParser
    TextParser --> TokenCollection
    TokenCollection --> ProviderCollection
    ProviderCollection --> |Uses| ClassNameProvider & CodeDetect & DetectProvider & EntropyDetect & KeywordsDetect & LanguageDetect & StringDetect
    ProviderCollection --> DictItems
    DictItems --> DictPersist
    DictPersist --> FileSystem
    TokenCollection --> InMemoryStorage
    InMemoryStorage --> TreeView
    InMemoryStorage --> Stats

    %% Styles
    classDef core fill:#3498db
    classDef ui fill:#f1c40f
    classDef parser fill:#2ecc71
    classDef provider fill:#e67e22
    classDef detector fill:#e67e22
    classDef dict fill:#9b59b6
    classDef storage fill:#95a5a6

    %% Click Events
    click Extension "https://github.com/michelcaradec/string-checker-js/blob/master/src/extension.ts"
    click Commands "https://github.com/michelcaradec/string-checker-js/blob/master/src/commands.ts"
    click Constants "https://github.com/michelcaradec/string-checker-js/blob/master/src/constants.ts"
    click ProviderCollection "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providerCollection.ts"
    click ClassNameProvider "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providers/classNameProvider.ts"
    click CodeDetect "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providers/codeDetect.ts"
    click DetectProvider "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providers/detectProvider.ts"
    click EntropyDetect "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providers/entropyDetect.ts"
    click KeywordsDetect "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providers/keywordsDetect.ts"
    click LanguageDetect "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providers/languageDetect.ts"
    click StringDetect "https://github.com/michelcaradec/string-checker-js/blob/master/src/checker/providers/stringDetect.ts"
    click TextParser "https://github.com/michelcaradec/string-checker-js/blob/master/src/parser/textParser.ts"
    click TokenCollection "https://github.com/michelcaradec/string-checker-js/blob/master/src/parser/textTokenCollection.ts"
    click TreeView "https://github.com/michelcaradec/string-checker-js/blob/master/src/tree/treeProvider.ts"
    click Stats "https://github.com/michelcaradec/string-checker-js/blob/master/src/stats/statsProvider.ts"
    click DictItems "https://github.com/michelcaradec/string-checker-js/tree/master/src/user-dictionary/dictionary-items"
    click DictPersist "https://github.com/michelcaradec/string-checker-js/blob/master/src/user-dictionary/userDictionaryPersist.ts"
```
