# binary-ho/quick-memo architecture

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

- Interactive diagram: https://gitdiagram.com/binary-ho/quick-memo
- Repository: https://github.com/binary-ho/quick-memo

## Overview

##### Main Components

A. User Interface Layer:
- MemoToolWindow (main container)
- Components:
- MemoList
- MemoEditor
- MemoToolbar
- ToastPopup (for notifications)

B. Action Layer:
- OpenMemoAction (handles keyboard shortcuts)
- MemoActionManager (manages memo-related actions)

C. Application Layer:
- MemoService (business logic)
- MemoRepository (data access interface)

D. Infrastructure Layer:
- MemoState (persistence state)
- MemoStateRepository (state management)
- MemoMapper (data transformation)
- SavedMemos (storage implementation)

- UI Layer (Top)
- ↓
- Action Layer
- ↓
- Application Layer
- ↓
- Infrastructure Layer (Bottom)

##### Key Elements to Highlight

a) Plugin Integration:
- Integration point with IDE (plugin.xml configuration)
- OpenMemoAction as the main entry point

b) Data Flow:
- Memo creation/update/delete operations
- State persistence flow
- UI update mechanisms

c) Important Constraints:
- 20 memos limit
- 64KB per memo limit

##### Specific Implementation Details

**[MemoToolWindowFactory] → [MemoToolWindow]**
- ↓
**[MemoList] ← [MemoEditor] ← [MemoToolbar]**
- ↓
**[MemoService] → [MemoRepository]**
- ↓
**[MemoStateRepository] → [MemoState]**

##### Technical Stack Indicators

- JetBrains Platform SDK integration
- Kotlin build system (Gradle)
- Persistence mechanisms (IDE's built-in state management)

Remember to include annotations for:
- Entry points (keyboard shortcuts)
- User interaction flows
- Data persistence paths
- Error handling paths (e.g., MemoLimitExceededException)

This will provide a comprehensive view of how the plugin integrates with the IDE and manages its internal operations.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef action fill:#90EE90,stroke:#333,stroke-width:2px
    classDef application fill:#FFB347,stroke:#333,stroke-width:2px
    classDef infrastructure fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef data fill:#FFE5B4,stroke:#333,stroke-width:2px

    %% UI Layer
    subgraph UI
        MTW[MemoToolWindow]:::ui
        ML[MemoList]:::ui
        ME[MemoEditor]:::ui
        MT[MemoToolbar]:::ui
        TP[ToastPopup]:::ui
    end

    %% Action Layer
    subgraph Actions
        OMA[OpenMemoAction]:::action
        MAM[MemoActionManager]:::action
    end

    %% Application Layer
    subgraph Application
        MS[MemoService]:::application
        MR[MemoRepository]:::application
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        MST[MemoState]:::infrastructure
        MSTR[MemoStateRepository]:::infrastructure
        MM[MemoMapper]:::infrastructure
        SM[SavedMemos]:::infrastructure
    end

    %% Data Models
    M[Memo]:::data
    MLE[MemoLimitExceededException]:::data

    %% Relationships
    MTW --> ML & ME & MT
    ML <--> MAM
    ME <--> MAM
    MT <--> MAM
    
    OMA --> MAM
    MAM --> MS
    MS <--> MR
    MR <--> MSTR
    MSTR <--> MST
    MST --> SM
    MM --> MST
    
    MS --> MLE
    MLE --> TP
    
    %% Click Events
    click MTW "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/window/MemoToolWindow.java"
    click ML "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/window/component/MemoList.java"
    click ME "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/window/component/MemoEditor.java"
    click MT "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/window/component/MemoToolbar.java"
    click TP "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/ui/ToastPopup.java"
    click OMA "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/action/OpenMemoAction.java"
    click MAM "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/window/action/MemoActionManager.java"
    click MS "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/application/MemoService.java"
    click MR "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/application/MemoRepository.java"
    click MST "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/infrastructure/MemoState.java"
    click MSTR "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/infrastructure/MemoStateRepository.java"
    click MM "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/infrastructure/MemoMapper.java"
    click SM "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/infrastructure/SavedMemos.java"
    click M "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/memo/Memo.java"
    click MLE "https://github.com/binary-ho/quick-memo/blob/develop/src/main/java/com/quickmemo/plugin/memo/MemoLimitExceededException.java"

    %% Legend
    subgraph Legend
        UI_L[UI Components]:::ui
        Action_L[Actions]:::action
        App_L[Application Services]:::application
        Infra_L[Infrastructure]:::infrastructure
        Data_L[Data Models]:::data
    end
```
