# nguyenvanduocit/obsidian-open-gate architecture

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

- Interactive diagram: https://gitdiagram.com/nguyenvanduocit/obsidian-open-gate
- Repository: https://github.com/nguyenvanduocit/obsidian-open-gate

## Overview

##### Main Components

a. Core Plugin Components:
- It to multiple View Controllers:
- GateView
- Modal Components (ModalEditGate, ModalInsertLink, ModalListGates, ModalOnboarding)
- Settings Tab

b. Feature Services Layer:
- Gate Management (registerGate, createEmptyGateOption)
- View Management (openView, unloadView)
- Web Integration (createIframe, createWebviewTag)
- Link Management (setupInsertLinkMenu, setupLinkConvertMenu)

c. External Integration Points:
- Obsidian API Interface
- Web Content Interface
- User Interface Components

##### Component Relationships

- User Interface → Modal Components → Core Plugin
- Core Plugin → Feature Services
- Feature Services → External Integrations
- Settings → Gate Options → Web Integration

##### Specific Implementation Details

- Blue: Core plugin components
- Green: User interface elements
- Orange: External integrations
- Purple: Feature services

##### Architecture Patterns

Following patterns:
- Modal-View pattern for UI components
- Service-based architecture for feature implementation
- Plugin-host architecture showing Obsidian integration

**┌─ User Interface Layer ─────────────────────┐**
- (Modals, Views, Settings)                  │
- Core Plugin Layer ──────────────────────┐ │
- (Main Plugin, Gate Management)           │ │
- Feature Services Layer ─────────────────┤ │
- (Web Integration, Link Management)       │ │
- External Integration Layer ─────────────┤ │
- (Obsidian API, Web Content)             │ │
- ┘

Important Elements to Include:

## Diagram (Mermaid)

```mermaid
graph TB
    %% Layers
    subgraph UI["User Interface Layer"]
        GateView["Gate View Controller"]
        Modals["Modal Components"]
        Settings["Settings Tab"]
        
        subgraph ModalComponents["Modal Components Detail"]
            EditModal["Edit Gate Modal"]
            InsertModal["Insert Link Modal"]
            ListModal["List Gates Modal"]
            OnboardModal["Onboarding Modal"]
        end
    end

    subgraph Core["Core Plugin Layer"]
        Main["Plugin Core"]
        Config["Configuration Types"]
    end

    subgraph Services["Feature Services Layer"]
        GateMgmt["Gate Management"]
        ViewMgmt["View Management"]
        WebInt["Web Integration"]
        LinkMgmt["Link Management"]
    end

    subgraph External["External Integration Layer"]
        ObsidianAPI["Obsidian API"]
        WebContent["Web Content"]
        Styles["Custom Styling"]
        Docs["Documentation"]
    end

    %% Relationships
    Main --> GateView
    Main --> Modals
    Main --> Settings
    
    Modals --> ModalComponents
    ModalComponents --> Main
    
    Main --> GateMgmt
    Main --> ViewMgmt
    Main --> WebInt
    Main --> LinkMgmt
    
    GateMgmt --> ObsidianAPI
    ViewMgmt --> WebContent
    WebInt --> WebContent
    LinkMgmt --> ObsidianAPI
    
    Config --> GateMgmt
    Config --> WebInt
    
    %% Styling
    classDef core fill:#2b6cb0
    classDef ui fill:#48bb78
    classDef service fill:#805ad5
    classDef external fill:#ed8936
    
    class Main,Config core
    class GateView,Modals,Settings,ModalComponents,EditModal,InsertModal,ListModal,OnboardModal ui
    class GateMgmt,ViewMgmt,WebInt,LinkMgmt service
    class ObsidianAPI,WebContent,Styles,Docs external

    %% Click Events
    click Main "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/main.ts"
    click GateView "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/GateView.ts"
    click EditModal "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/ModalEditGate.ts"
    click InsertModal "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/ModalInsertLink.ts"
    click ListModal "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/ModalListGates.ts"
    click OnboardModal "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/ModalOnboarding.ts"
    click Settings "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/SetingTab.ts"
    click GateMgmt "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/fns/registerGate.ts"
    click ViewMgmt "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/fns/openView.ts"
    click WebInt "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/fns/createIframe.ts"
    click LinkMgmt "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/fns/setupInsertLinkMenu.ts"
    click Config "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/src/GateOptions.d.ts"
    click Docs "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/docs/.vitepress"
    click Styles "https://github.com/nguyenvanduocit/obsidian-open-gate/blob/main/styles.css"

    %% Legend
    subgraph Legend
        CoreLegend["Core Components"]:::core
        UILegend["UI Components"]:::ui
        ServiceLegend["Services"]:::service
        ExtLegend["External Systems"]:::external
    end
```
