# joouha/euporie architecture

> Architecture diagram of the GitHub repository joouha/euporie, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joouha/euporie
- Repository: https://github.com/joouha/euporie

## Overview

##### Main Components Identification
The system should be divided into these major components:

a. Core Applications:
- Console App
- Notebook App
- Preview App
- Hub App

b. Core Infrastructure:
- Kernel Management System
- Command & Control System
- UI/Layout Engine
- Conversion System

**┌─ Applications Layer ─────────────────────────┐**
- Console  │  Notebook  │  Preview  │   Hub   │
- ┴───────────┴───────────┴─────────┘
**┌─ Core Services Layer ──────────────────────────────────────────┐**
- ┌─ UI Components ─┐ ┌─ Kernel Interface ─┐ ┌─ Data Handling ─┐ │
- Widgets      │ │ - Kernel Client    │ │ - Converters    │ │
- Layout      │ │ - Kernel Manager   │ │ - Formatters    │ │
- Key Bindings│ │ - Comm System      │ │ - IO Handlers   │ │
- ┘ └──────────────────────┘ └────────────────┘ │
- ┘
**┌─ Infrastructure Layer ───────────────────────────────────────┐**
- Configuration │ Logging │ Terminal Interface │ File System   │
- ┘

##### Implementation Details

a. Core Services:
- Command system (/core/commands.py)
- Key binding system (/core/key_binding/)
- Widget system (/core/widgets/)
- Conversion system (/core/convert/)

b. Application-Specific Components:
- Console-specific features
- Notebook editor capabilities
- Preview functionality
- Hub server components

##### External Integrations

Connections to:
- Jupyter kernels
- Terminal emulators
- File systems
- SSH for Hub functionality

##### Notes for Implementation

- Clear boundaries between applications
- Shared core functionality
- Version information and Python compatibility

##### Technical Details

- Support for multiple output formats (Sixel, iTerm, Kitty)
- Kernel communication protocols
- Widget interaction system
- Terminal rendering pipeline

- Nested components
- Custom styling
- Export to vector formats
- Easy updates for future modifications

Remember to maintain a balance between showing enough detail to understand the system's complexity while keeping it clear and readable.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Applications
        Console["Console App"]:::app
        Notebook["Notebook App"]:::app
        Preview["Preview App"]:::app
        Hub["Hub App"]:::app
    end

    subgraph "Core Services"
        subgraph "UI Components"
            Layout["Layout Engine"]:::ui
            Widgets["Widget System"]:::ui
            KeyBindings["Key Bindings"]:::ui
            Bars["UI Bars"]:::ui
        end

        subgraph "Kernel Interface"
            KernelManager["Kernel Manager"]:::kernel
            KernelClient["Kernel Client"]:::kernel
            CommSystem["Comm System"]:::kernel
        end

        subgraph "Data Handling"
            Converters["Converters"]:::data
            Formatters["Format Handlers"]:::data
            IOHandlers["IO Handlers"]:::data
        end
    end

    subgraph Infrastructure
        Config["Configuration"]:::infra
        Logging["Logging"]:::infra
        Terminal["Terminal Interface"]:::infra
        FileSystem["File System"]:::infra
        Graphics["Graphics Rendering"]:::infra
    end

    %% Application Dependencies
    Console --> Layout
    Console --> KernelManager
    Notebook --> Layout
    Notebook --> KernelManager
    Preview --> Layout
    Preview --> Converters
    Hub --> KernelManager

    %% Core Service Relationships
    Layout --> Widgets
    Layout --> KeyBindings
    Layout --> Bars
    KernelManager --> KernelClient
    KernelClient --> CommSystem
    Widgets --> CommSystem
    Converters --> Formatters
    Formatters --> IOHandlers

    %% Infrastructure Dependencies
    Layout --> Terminal
    Terminal --> Graphics
    KernelManager --> FileSystem
    Converters --> FileSystem
    Terminal --> Config
    Terminal --> Logging

    %% Styling
    classDef app fill:#2374ab
    classDef ui fill:#57a773
    classDef kernel fill:#ffc857
    classDef data fill:#984447
    classDef infra fill:#808080

    %% Click Events
    click Console "https://github.com/joouha/euporie/blob/dev/euporie/console/app.py"
    click Notebook "https://github.com/joouha/euporie/blob/dev/euporie/notebook/app.py"
    click Preview "https://github.com/joouha/euporie/blob/dev/euporie/preview/app.py"
    click Hub "https://github.com/joouha/euporie/blob/dev/euporie/hub/app.py"
    click KernelManager "https://github.com/joouha/euporie/blob/dev/euporie/core/kernel/manager.py"
    click KernelClient "https://github.com/joouha/euporie/blob/dev/euporie/core/kernel/client.py"
    click KeyBindings "https://github.com/joouha/euporie/tree/dev/euporie/core/key_binding/"
    click Layout "https://github.com/joouha/euporie/tree/dev/euporie/core/layout/"
    click Widgets "https://github.com/joouha/euporie/tree/dev/euporie/core/widgets/"
    click Converters "https://github.com/joouha/euporie/tree/dev/euporie/core/convert/"
    click Formatters "https://github.com/joouha/euporie/tree/dev/euporie/core/convert/formats/"
    click Terminal "https://github.com/joouha/euporie/blob/dev/euporie/core/terminal.py"
    click Graphics "https://github.com/joouha/euporie/blob/dev/euporie/core/graphics.py"
    click Config "https://github.com/joouha/euporie/blob/dev/euporie/core/config.py"
    click Logging "https://github.com/joouha/euporie/blob/dev/euporie/core/log.py"
    click IOHandlers "https://github.com/joouha/euporie/blob/dev/euporie/core/io.py"
    click CommSystem "https://github.com/joouha/euporie/tree/dev/euporie/core/comm/"
    click Bars "https://github.com/joouha/euporie/tree/dev/euporie/core/bars/"
```
