# 0dist/qnotes architecture

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

- Interactive diagram: https://gitdiagram.com/0dist/qnotes
- Repository: https://github.com/0dist/qnotes

## Overview

##### Main Components Identification
The application is a desktop GUI application with these key components:

a. Core Application Layer
- Main Application Entry (main.py)
- Widget Management System
- File System Interface

b. UI Component Layer
- Frameless Window Management
- Tab System
- Sidebar Navigation
- Ribbon Interface
- Text Editor with Markdown Support
- Settings Interface

**┌─ UI Layer ─────────────────────┐**
- Frameless Window            │
- Ribbon Interface            │
- Sidebar                     │
- Tab Management              │
- ┘

**┌─ Core Features ──────────────────┐**
- Text Editor & Markdown Preview │
- File Management               │
- Settings Management           │
- ┘

**┌─ Resource Layer ────────────────┐**
- Material Symbols             │
- Style Definitions (CSS)      │
- File System Interface        │
- ┘

##### Implementation Details

- The modular widget-based architecture (evident from the widget directory)
- The separation between UI components and resource management
- The customization system (style.css and settings)

##### Technical Stack Indicators

Clearly mark:
- PyQt6 as the GUI framework
- Python as the primary language
- CSS for styling

Remember to indicate the extensibility points where future Markdown features (blockquotes, code blocks, tables, task lists) could be implemented.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI_Layer
        FW["Frameless Window"]:::ui
        RI["Ribbon Interface"]:::ui
        SB["Sidebar Navigation"]:::ui
        TM["Tab Management"]:::ui
    end

    subgraph Core_Features
        TE["Text Editor"]:::core
        MP["Markdown Preview"]:::core
        FM["File Management"]:::core
        SM["Settings Management"]:::core
        IS["Icon System"]:::core
    end

    subgraph Resource_Layer
        MS["Material Symbols"]:::resource
        SD["Style Definitions"]:::resource
        FSI["File System Interface"]:::resource
        IC["Icon Configuration"]:::resource
    end

    subgraph External_Dependencies
        PQ["PyQt6"]:::external
        PY["Python"]:::external
    end

    %% Relationships
    FW --> TE
    FW --> TM
    RI --> FM
    RI --> SM
    SB --> FM
    TM --> TE
    TE <--> MP
    FM --> FSI
    SM --> SD
    IS --> MS
    IS --> IC

    %% Core to External Dependencies
    TE --> PQ
    FM --> PQ
    SM --> PQ
    IS --> PQ
    FW --> PQ
    RI --> PQ
    SB --> PQ
    TM --> PQ

    %% Component Mappings with Click Events
    click FW "https://github.com/0dist/qnotes/blob/master/widget/frameless.py"
    click RI "https://github.com/0dist/qnotes/blob/master/widget/ribbon.py"
    click SB "https://github.com/0dist/qnotes/blob/master/widget/sidebar.py"
    click TM "https://github.com/0dist/qnotes/blob/master/widget/tabs.py"
    click TE "https://github.com/0dist/qnotes/blob/master/widget/text.py"
    click SM "https://github.com/0dist/qnotes/blob/master/widget/settings.py"
    click IS "https://github.com/0dist/qnotes/blob/master/widget/icon_picker.py"
    click MS "https://github.com/0dist/qnotes/tree/master/resource/MaterialSymbols"
    click SD "https://github.com/0dist/qnotes/blob/master/resource/style.css"
    click IC "https://github.com/0dist/qnotes/blob/master/resource/MaterialSymbols/MaterialSymbolsOutlined.json"

    %% Styling Classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef resource fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        UI["UI Components"]:::ui
        CORE["Core Features"]:::core
        RES["Resources"]:::resource
        EXT["External"]:::external
    end
```
