# indexxing/polyplus architecture

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

- Interactive diagram: https://gitdiagram.com/indexxing/polyplus
- Repository: https://github.com/indexxing/polyplus

## Overview

##### Main Components

a) Browser Extension Core
- Background Service (background.js)
- Popup Interface (popup.html, popup.js)
- Settings Manager (settings.html, settings.js)

b) Feature Modules (organized by domain)
- Account Management
- Creation Tools
- Forum Enhancement
- Store Features
- Places/Games
- Guild System

c) Shared Resources
- Utilities
- Styling
- Common Components

**[Browser Extension Container]**
- [Core Services Layer]
- Background Service
- Settings Manager
- Popup Interface

- [Feature Modules Layer]
- Account Module
- Creation Module
- Forum Module
- Store Module
- Places Module

- [Resource Layer]
- Utilities
- Styling
- Common Components

- [External Integration]
- Polytoria Website

##### Key Relationships to Highlight

- How the background service communicates with different feature modules
- Interaction between the extension and the Polytoria website
- How shared resources are utilized across different modules
- Settings manager's influence on all feature modules

##### Implementation Details

a) Module Independence:
- Each feature module (account, create, forum, etc.) operates independently
- How they connect through the core services

b) Resource Sharing:
- How utils.js and registerTooltips.js are used across modules
- CSS distribution across different features

c) Data Flow:
- How user settings propagate through the system
- Interaction points with the Polytoria website

##### Technical Details

- Content Script Injection Points
- Background Service Communication Channels
- Storage Management
- Browser API Integration Points

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph BrowserExtension["Browser Extension Container"]
        subgraph CoreServices["Core Services Layer"]
            Background["Background Service"]
            Settings["Settings Manager"]
            Popup["Popup Interface"]
        end

        subgraph FeatureModules["Feature Modules Layer"]
            Account["Account Management"]
            Creation["Creation Tools"]
            Forum["Forum Enhancement"]
            Store["Store Features"]
            Places["Places/Games"]
            Guild["Guild System"]
        end

        subgraph Resources["Resource Layer"]
            Utils["Utilities"]
            Styling["Styling"]
            Common["Common Components"]
        end

        subgraph External["External Integration"]
            Polytoria["Polytoria Website"]
        end

        subgraph AccountFeatures["Account Features"]
            Profile["Profile Management"]
            Inventory["Inventory System"]
            Trade["Trade System"]
            Friends["Friends System"]
        end

        subgraph CreationFeatures["Creation Features"]
            Audio["Audio Management"]
            Image["Image Management"]
            PlaceAccess["Place Access Control"]
        end

        subgraph StoreFeatures["Store Features"]
            ItemView["Item View"]
            StoreBrowse["Store Browse"]
        end
    end

    %% Core Services Relationships
    Background --> Account
    Background --> Creation
    Background --> Forum
    Background --> Store
    Background --> Places
    Background --> Guild
    Settings --> FeatureModules
    Popup --> Settings

    %% Feature Module Relationships
    Account --> AccountFeatures
    Creation --> CreationFeatures
    Store --> StoreFeatures

    %% Resource Usage
    Utils --> CoreServices
    Utils --> FeatureModules
    Styling --> CoreServices
    Styling --> FeatureModules
    Common --> FeatureModules

    %% External Integration
    FeatureModules -.-> Polytoria
    CoreServices -.-> Polytoria

    %% Click Events
    click Background "https://github.com/indexxing/PolyPlus/blob/main/js/background.js"
    click Settings "https://github.com/indexxing/PolyPlus/blob/main/settings.js"
    click Popup "https://github.com/indexxing/PolyPlus/blob/main/popup.js"
    click Account "https://github.com/indexxing/PolyPlus/tree/main/js/account/"
    click Creation "https://github.com/indexxing/PolyPlus/tree/main/js/create/"
    click Forum "https://github.com/indexxing/PolyPlus/tree/main/js/forum/"
    click Store "https://github.com/indexxing/PolyPlus/tree/main/js/store/"
    click Places "https://github.com/indexxing/PolyPlus/tree/main/js/places/"
    click Guild "https://github.com/indexxing/PolyPlus/blob/main/js/guilds.js"
    click Utils "https://github.com/indexxing/PolyPlus/blob/main/resources/utils.js"
    click Styling "https://github.com/indexxing/PolyPlus/blob/main/css/polytoria.css"
    click Common "https://github.com/indexxing/PolyPlus/blob/main/js/sitewide.js"
    click Profile "https://github.com/indexxing/PolyPlus/blob/main/js/account/profile.js"
    click Inventory "https://github.com/indexxing/PolyPlus/blob/main/js/account/inventory.js"
    click Trade "https://github.com/indexxing/PolyPlus/blob/main/js/account/trades-outbound.js"
    click Friends "https://github.com/indexxing/PolyPlus/blob/main/js/account/friends.js"
    click Audio "https://github.com/indexxing/PolyPlus/blob/main/js/create/audio-library.js"
    click Image "https://github.com/indexxing/PolyPlus/blob/main/js/create/image.js"
    click PlaceAccess "https://github.com/indexxing/PolyPlus/blob/main/js/create/place-access.js"
    click ItemView "https://github.com/indexxing/PolyPlus/blob/main/js/store/item-view.js"
    click StoreBrowse "https://github.com/indexxing/PolyPlus/blob/main/js/store/store.js"

    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef feature fill:#4CAF50,stroke:#2E7D32,color:white
    classDef resource fill:#FF9800,stroke:#EF6C00,color:white
    classDef external fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef subfeature fill:#81C784,stroke:#388E3C,color:white

    class Background,Settings,Popup core
    class Account,Creation,Forum,Store,Places,Guild feature
    class Utils,Styling,Common resource
    class Polytoria external
    class Profile,Inventory,Trade,Friends,Audio,Image,PlaceAccess,ItemView,StoreBrowse subfeature
```
