# jinbekim/gitlab-pn architecture

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

- Interactive diagram: https://gitdiagram.com/jinbekim/gitlab-pn
- Repository: https://github.com/jinbekim/gitlab-pn

## Overview

Project Type: Browser Extension (Chrome Extension)
This is a browser extension project specifically designed for GitLab, likely for customizing notification or text display functionality.

##### Browser Context Components
a) Content Script Context (inject/)
b) Popup Context (popup/)

##### Extension Architecture
- Create three main sections:
a) User Interface Layer (Popup)
- Popup/index.html
- Popup/index.css for styling
- Popup/index.ts for popup logic

b) Content Script Layer (Inject)
- Inject/index.ts which interacts with the webpage

c) Shared Utilities
- Utils/index.ts as a shared module

##### Communication Flow
- Popup <-> Chrome Extension API
- Content Script <-> Webpage DOM
- Popup <-> Content Script (via Chrome messaging)

##### Technical details
- TypeScript compilation flow (*.ts -> dist/*.js)
- manifest.json as the configuration hub
- Chrome Extension API integration points

Layout Guidelines:

##### Top Section
- Relationship with Chrome Extension API

##### Middle Section
- Content script interaction with webpage
- Message passing between components

##### Bottom Section
- Shared utilities and build artifacts

Additional Considerations:

##### Build Process
- TypeScript compilation flow
- How dist/ folder is generated

##### Configuration
- Manifest.json role
- Permissions and content script injection points

##### Asset Management
- Img/ directory for extension resources

Remember to:
- Use consistent styling for similar components
- Version information if relevant
- Clear boundaries between extension contexts

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Browser
        subgraph "Extension Components"
            direction TB
            manifest["Extension Manifest"]:::config
            click manifest "https://github.com/jinbekim/gitlab-pn/blob/main/manifest.json"
            
            subgraph "Popup Context"
                direction TB
                PopupHTML["Popup HTML"]:::ui
                click PopupHTML "https://github.com/jinbekim/gitlab-pn/blob/main/popup/index.html"
                PopupCSS["Popup Styles"]:::ui
                click PopupCSS "https://github.com/jinbekim/gitlab-pn/blob/main/popup/index.css"
                PopupTS["Popup Logic (TS)"]:::ui
                click PopupTS "https://github.com/jinbekim/gitlab-pn/blob/main/popup/index.ts"
                PopupJS["Compiled Popup (JS)"]:::compiled
                click PopupJS "https://github.com/jinbekim/gitlab-pn/blob/main/dist/popup/index.js"
                
                PopupHTML --> PopupCSS
                PopupTS --> PopupJS
                PopupHTML --> PopupTS
            end
            
            subgraph "Content Script Context"
                direction TB
                ContentTS["Content Script (TS)"]:::content
                click ContentTS "https://github.com/jinbekim/gitlab-pn/blob/main/inject/index.ts"
                ContentJS["Compiled Content Script (JS)"]:::compiled
                click ContentJS "https://github.com/jinbekim/gitlab-pn/blob/main/dist/inject/index.js"
                
                ContentTS --> ContentJS
            end
            
            subgraph "Shared Resources"
                direction TB
                Utils["Shared Utilities"]:::util
                click Utils "https://github.com/jinbekim/gitlab-pn/blob/main/utils/index.ts"
                Assets["Extension Assets"]:::resource
                click Assets "https://github.com/jinbekim/gitlab-pn/tree/main/img/"
                TSConfig["TypeScript Config"]:::config
                click TSConfig "https://github.com/jinbekim/gitlab-pn/blob/main/tsconfig.json"
                PackageJSON["Package Config"]:::config
                click PackageJSON "https://github.com/jinbekim/gitlab-pn/blob/main/package.json"
            end
        end
        
        ChromeAPI["Chrome Extension API"]:::external
        WebpageDOM["GitLab Webpage DOM"]:::external
    end
    
    %% Connections
    PopupContext --> ChromeAPI
    ChromeAPI --> ContentJS
    ContentJS --> WebpageDOM
    Utils --> PopupTS
    Utils --> ContentTS
    manifest --> ChromeAPI
    
    %% Styling
    classDef ui fill:#2196F3,stroke:#1565C0,color:white
    classDef content fill:#4CAF50,stroke:#2E7D32,color:white
    classDef compiled fill:#78909C,stroke:#546E7A,color:white
    classDef util fill:#FFC107,stroke:#FFA000,color:black
    classDef config fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef external fill:#90A4AE,stroke:#607D8B,color:white
    classDef resource fill:#FF9800,stroke:#F57C00,color:white
```
