# devoxx/devoxxgenieideaplugin architecture

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

- Interactive diagram: https://gitdiagram.com/devoxx/devoxxgenieideaplugin
- Repository: https://github.com/devoxx/devoxxgenieideaplugin

## Overview

##### Main Components Architecture

The system should be represented in layers, with these key components:

a) UI Layer:
- Tool Window Components (DevoxxGenieToolWindowFactory)
- Settings Panels
- Response Panels
- Input Components

b) Controller Layer:
- PromptExecutionController
- ProjectContextController
- ActionButtonsPanelController
- TokenCalculationController

c) Service Layer:
- Chat Services (ChatService, ChatMemoryService)
- LLM Provider Services (LLMProviderService)
- RAG Services (ProjectIndexerService, SemanticSearchService)
- Git Integration Services (GitMergeService)
- Project Services (ProjectContentService, ProjectScannerService)

d) Model Layer:
- Chat Models
- LLM Provider Models
- Request/Response Models
- Configuration Models

##### Integration Points

Connections with external systems:
- Local LLM Providers (Ollama, LMStudio, GPT4All)
- Cloud LLM Providers (OpenAI, Anthropic, Google, etc.)
- ChromaDB for vector storage
- Docker for RAG infrastructure
- Git for diff/merge functionality

##### Data Flow Representation

**User Input → Prompt Processing → LLM Provider Selection → Model Inference → Response Handling → UI Display**

##### Specific Implementation Details

- RAG Implementation (ChromaDB + Embeddings)
- Git Diff/Merge Integration
- Token Cost Calculator
- Chat Memory Management
- Project Context Management

**┌─────────────────────────────────────────────────────────────────┐**
- UI Layer                                  │
- ┤
- DevoxxGenieToolWindow                                         │
- Settings Panels                                               │
- Response Panels                                               │
- Input Components                                              │
- ┬─────────────────────────────────────┬────────────┘

**┌─────────────▼─────────────────────────────────────▼────────────┐**
- Controller Layer                            │
- ┤
- Prompt Execution                                              │
- Project Context                                               │
- Token Calculation                                             │
- ┬─────────────────────────────────────┬────────────┘

**┌─────────────▼─────────────────────────────────────▼────────────┐**
- Service Layer                               │
- ┤
- Chat Services    │ LLM Services    │ RAG Services │ Git Services│
- ┬─────────────────────────────────────┬────────────┘

**┌─────────────▼─────────────────────────────────────▼────────────┐**
- External Integrations                       │
- ┤
- Local LLMs │ Cloud LLMs │ ChromaDB │ Docker │ Git │            │
- ┘

##### Important Notes

- Bidirectional flows where appropriate
- Error handling paths
- Async operations (streaming responses)
- Security boundaries
- Configuration points
- Scaling components (RAG infrastructure)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#2196F3,stroke:#1565C0,color:white
    classDef controller fill:#4CAF50,stroke:#2E7D32,color:white
    classDef service fill:#FF9800,stroke:#EF6C00,color:white
    classDef model fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef external fill:#607D8B,stroke:#37474F,color:white
    classDef storage fill:#795548,stroke:#3E2723,color:white
    
    subgraph UI["UI Layer"]
        ToolWindow["Tool Window"]:::ui
        Settings["Settings Panels"]:::ui
        Response["Response Panels"]:::ui
        Input["Input Components"]:::ui
    end

    subgraph Controllers["Controller Layer"]
        PromptExec["Prompt Execution"]:::controller
        ProjContext["Project Context"]:::controller
        ActionButtons["Action Buttons"]:::controller
        TokenCalc["Token Calculator"]:::controller
    end

    subgraph Services["Service Layer"]
        ChatServ["Chat Services"]:::service
        LLMServ["LLM Provider Services"]:::service
        RAGServ["RAG Services"]:::service
        GitServ["Git Integration"]:::service
        ProjServ["Project Services"]:::service
    end

    subgraph Models["Model Layer"]
        ChatModels["Chat Models"]:::model
        LLMModels["LLM Provider Models"]:::model
        ReqResModels["Request/Response Models"]:::model
        ConfigModels["Configuration Models"]:::model
    end

    subgraph External["External Integrations"]
        LocalLLM["Local LLMs"]:::external
        CloudLLM["Cloud LLMs"]:::external
        ChromaDB["ChromaDB"]:::storage
        Docker["Docker"]:::external
        Git["Git"]:::external
    end

    %% Connections
    UI --> Controllers
    Controllers --> Services
    Services --> Models
    Services --> External

    %% Click events
    click ToolWindow "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/ui/DevoxxGenieToolWindowFactory.java"
    click Settings "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/ui/settings/"
    click Response "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/ui/panel/ChatResponsePanel.java"
    click Input "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/ui/component/input/"
    click PromptExec "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/controller/PromptExecutionController.java"
    click ProjContext "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/controller/ProjectContextController.java"
    click ActionButtons "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/controller/ActionButtonsPanelController.java"
    click TokenCalc "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/controller/TokenCalculationController.java"
    click ChatServ "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/service/ChatService.java"
    click LLMServ "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/service/LLMProviderService.java"
    click RAGServ "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/service/rag/"
    click GitServ "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/service/gitdiff/GitMergeService.java"
    click ProjServ "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/service/ProjectContentService.java"
    click ChatModels "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/chatmodel/"
    click LLMModels "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/model/"
    click ReqResModels "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/model/request/"
    click ConfigModels "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/core/src/main/java/com/devoxx/genie/model/"
    click LocalLLM "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/chatmodel/local/"
    click CloudLLM "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/chatmodel/cloud/"
    click ChromaDB "https://github.com/devoxx/DevoxxGenieIDEAPlugin/tree/master/src/main/java/com/devoxx/genie/service/chromadb/"
    click Docker "https://github.com/devoxx/DevoxxGenieIDEAPlugin/blob/master/src/main/java/com/devoxx/genie/service/chromadb/ChromaDockerService.java"
```
