# acelikesghosts/snpext architecture

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

- Interactive diagram: https://gitdiagram.com/acelikesghosts/snpext
- Repository: https://github.com/acelikesghosts/snpext

## Overview

##### Main Components Identification
The system appears to be a browser extension with several distinct layers:

a) Core Extension Infrastructure
- Entry point system
- Plugin system
- Webpack module system
- Utilities layer

b) Plugin Architecture
- Core plugins
- Feature plugins
- Plugin API

**┌─ Browser Extension Host ─┐**
- (Chrome/Firefox)        │
- ┘

**┌─ Extension Core ────────────────────────────────┐**
- ┌─ Plugin System ─┐ ┌─ Webpack Module System ─┐ │

- ┘ └─────────────────────────┘ │
- ┌─ Reactive Store ┐ ┌─ Utilities Layer ──────┐ │

- ┘ └─────────────────────────┘ │
- ┘

**┌─ Plugins ────────────────────────────────────────┐**
- ┌─ Core Plugins ─┐ ┌─ Feature Plugins ────────┐ │
- NoTrack     │ │ - PlatformSpoofer        │ │
- Settings    │ │ - RemoveBanner           │ │
- RemoveBlockers         │ │
- SaveImages             │ │
- ┘ └────────────────────────────┘ │
- ┘

##### Important Relationships to Highlight

- How the entry point (src/entry.ts) initializes the plugin system
- Demonstrate the plugin API's relationship with individual plugins
- How the webpack module system interfaces with Snapchat's web client
- Reactive store's connection to the settings system

##### Technical Details

- TypeScript as the primary language
- React integration for settings UI
- Webpack module manipulation system
- Storage and state management through reactive store

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Browser["Browser Extension Host"]
        Chrome["Chrome/Firefox"]
    end

    subgraph Core["Extension Core"]
        Entry["Entry Point"]:::core
        PluginSystem["Plugin System"]:::core
        WebpackSystem["Webpack Module System"]:::webpack
        ReactiveStore["Reactive Store"]:::store
        Utils["Utilities Layer"]:::utils
    end

    subgraph Plugins["Plugin Layer"]
        direction TB
        subgraph CorePlugins["Core Plugins"]
            NoTrack["NoTrack"]:::plugin
            Settings["Settings"]:::plugin
        end

        subgraph FeaturePlugins["Feature Plugins"]
            PlatformSpoofer["Platform Spoofer"]:::plugin
            RemoveBanner["Remove Banner"]:::plugin
            RemoveBlockers["Remove Blockers"]:::plugin
            SaveImages["Save Images"]:::plugin
        end
    end

    subgraph Build["Build System"]
        BuildScript["Build Script"]:::build
        ManifestGen["Manifest Generator"]:::build
        PluginScripts["Plugin Scripts"]:::build
        SettingsGen["Settings Generator"]:::build
    end

    %% Relationships
    Chrome --> Entry
    Entry --> PluginSystem
    Entry --> WebpackSystem
    Entry --> ReactiveStore
    
    PluginSystem --> CorePlugins
    PluginSystem --> FeaturePlugins
    
    ReactiveStore --> Settings
    Utils --> PluginSystem
    Utils --> WebpackSystem

    BuildScript --> ManifestGen
    BuildScript --> PluginScripts
    BuildScript --> SettingsGen

    %% Click Events
    click Entry "https://github.com/acelikesghosts/snpext/blob/master/src/entry.ts"
    click PluginSystem "https://github.com/acelikesghosts/snpext/tree/master/src/plugins/api/"
    click NoTrack "https://github.com/acelikesghosts/snpext/blob/master/src/plugins/_core/NoTrack.ts"
    click Settings "https://github.com/acelikesghosts/snpext/blob/master/src/plugins/_core/settings.tsx"
    click PlatformSpoofer "https://github.com/acelikesghosts/snpext/blob/master/src/plugins/PlatformSpoofer.ts"
    click RemoveBanner "https://github.com/acelikesghosts/snpext/blob/master/src/plugins/RemoveBanner.ts"
    click RemoveBlockers "https://github.com/acelikesghosts/snpext/blob/master/src/plugins/RemoveBlockers.ts"
    click SaveImages "https://github.com/acelikesghosts/snpext/blob/master/src/plugins/SaveImages.ts"
    click WebpackSystem "https://github.com/acelikesghosts/snpext/blob/master/src/webpack/index.ts"
    click ReactiveStore "https://github.com/acelikesghosts/snpext/blob/master/src/utils/reactiveStore/store.ts"
    click Utils "https://github.com/acelikesghosts/snpext/tree/master/src/utils"
    click BuildScript "https://github.com/acelikesghosts/snpext/blob/master/scripts/build.ts"
    click ManifestGen "https://github.com/acelikesghosts/snpext/blob/master/scripts/manifest.ts"
    click PluginScripts "https://github.com/acelikesghosts/snpext/blob/master/scripts/plugins.ts"
    click SettingsGen "https://github.com/acelikesghosts/snpext/blob/master/scripts/settings.ts"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef plugin fill:#4CAF50,stroke:#2E7D32,color:white
    classDef webpack fill:#FF9800,stroke:#EF6C00,color:white
    classDef store fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef utils fill:#795548,stroke:#4E342E,color:white
    classDef build fill:#607D8B,stroke:#37474F,color:white

    %% Legend
    subgraph Legend
        L1["Core Component"]:::core
        L2["Plugin"]:::plugin
        L3["Webpack System"]:::webpack
        L4["Store"]:::store
        L5["Utilities"]:::utils
        L6["Build System"]:::build
    end
```
