# myudak/siapdips architecture

> Architecture diagram of the GitHub repository myudak/siapdips, 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/myudak/siapdips
- Repository: https://github.com/myudak/siapdips

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Browser Extension Components:
- Background Script (src/background.ts)
- Content Script (src/content.js)
- Popup Interface (index.html)
- Options Page (option.html)

b) Frontend Architecture:
- React Components Layer
- Theme System
- UI Components Library
- Hooks Layer

##### Component Relationships

**[Chrome Browser]**

- [Extension Components]
- [Background Script]
- [Content Script]
- [Popup/Options Interface]

- [React Application]
- [Components Layer]
- [Navbar]
- [HidePopupcard]
- [Ipkstatus]
- [Navcard]
- [Themecard]

- [UI Component Library]
- [Shadcn/UI Components]

- [Theme System]
- [Theme Provider]

- [Hooks]
- [useThemeTransition]

##### Flow Representation

- Double lines: Two-way communication

##### Important Architectural Notes

- Separation between extension-specific code and React application
- Theme system's global influence
- Component hierarchy in the React application
- Entry points (main.tsx, background.ts, content.js)

##### Technical Stack Indicators

A tech stack section showing:
- Vite
- React
- TypeScript
- Tailwind CSS
- Shadcn/UI

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L1[Component]:::component --- L2[/Script/]:::script
        L2 --- L3[(Storage)]:::storage
        L3 --- L4{{UI Element}}:::ui
        L4 --- L5([Service]):::service
        
        classDef component fill:#a8d1ff,stroke:#000
        classDef script fill:#ffb366,stroke:#000
        classDef storage fill:#d1c4e9,stroke:#000
        classDef ui fill:#c8e6c9,stroke:#000
        classDef service fill:#ffcdd2,stroke:#000
        classDef react fill:#81c784,stroke:#000
    end

    subgraph "Chrome Browser"
        subgraph "Extension Components"
            BS[/Background Script/]:::script
            CS[/Content Script/]:::script
            PI{{Popup Interface}}:::ui
            OP{{Options Page}}:::ui
            
            click BS "https://github.com/myudak/siapdips/blob/main/src/background.ts"
            click CS "https://github.com/myudak/siapdips/blob/main/src/content.js"
            click PI "https://github.com/myudak/siapdips/blob/main/index.html"
            click OP "https://github.com/myudak/siapdips/blob/main/option.html"
        end

        subgraph "React Application"
            ME["Main Entry"]:::react
            AC["App Component"]:::react
            
            click ME "https://github.com/myudak/siapdips/blob/main/src/pages/main/main.tsx"
            click AC "https://github.com/myudak/siapdips/blob/main/src/pages/main/App.tsx"

            subgraph "Components Layer"
                NB["Navbar"]:::react
                HP["HidePopupcard"]:::react
                IS["Ipkstatus"]:::react
                NC["Navcard"]:::react
                TC["Themecard"]:::react
                TT["Theme Toggle"]:::react
                
                click NB "https://github.com/myudak/siapdips/blob/main/src/components/Navbar/Navbar.tsx"
                click HP "https://github.com/myudak/siapdips/blob/main/src/components/HidePopupcard/HidePopupcard.tsx"
                click IS "https://github.com/myudak/siapdips/blob/main/src/components/Ipkstatus/Ipkstatus.tsx"
                click NC "https://github.com/myudak/siapdips/blob/main/src/components/Navcard/Navcard.tsx"
                click TC "https://github.com/myudak/siapdips/blob/main/src/components/Themecard/Themecard.tsx"
                click TT "https://github.com/myudak/siapdips/blob/main/src/components/Navbar/ModeToggle/ModeToggle.tsx"
            end

            subgraph "UI Library"
                UI["Shadcn/UI Components"]:::ui
                click UI "https://github.com/myudak/siapdips/tree/main/src/components/ui"
            end

            subgraph "Theme System"
                TP["Theme Provider"]:::service
                click TP "https://github.com/myudak/siapdips/blob/main/src/components/theme-provider.tsx"
            end

            subgraph "Hooks Layer"
                TH["useThemeTransition"]:::service
                click TH "https://github.com/myudak/siapdips/blob/main/src/hooks/useThemeTransition.ts"
            end
        end
    end

    %% Relationships
    BS <--> CS
    CS <--> PI
    CS <--> OP
    
    ME --> AC
    AC --> NB & HP & IS & NC & TC
    NB --> TT
    
    UI --> NB & HP & IS & NC & TC
    TP --> AC
    TH --> TP
    
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef section fill:#f5f5f5,stroke:#666,stroke-width:2px
```
