# tervicke/mindwave architecture

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

- Interactive diagram: https://gitdiagram.com/tervicke/mindwave
- Repository: https://github.com/tervicke/mindwave

## Overview

##### Main Components

A. Core Application Layer:
- Main Application (Mindwave.py) as the central component
- UI Components:
- EditorWidget
- MenuBar
- SideMenu
- SettingsPanel
- TagsPanel

B. Data Storage Layer:
- Journal entries (journals/*.json)
- Configuration files:
- settings.json
- tags.json

C. Template System:
- Various journal templates (DaySnap, FutureEcho, etc.)

**┌─────────────────────────────────────────┐**
- UI Layer                   │
- ┤
- Application Core              │
- ┤
- Data Storage                 │
- ┘

##### Detailed Component Breakdown

UI Layer (Blue):
**┌─────────────────┐    ┌─────────────────┐**
- MenuBar      │    │    SideMenu     │
- ┘    └─────────────────┘
**┌─────────────────┐    ┌─────────────────┐**
- EditorWidget   │    │  SettingsPanel  │
- ┘    └─────────────────┘
- ┌─────────────────┐
- TagsPanel    │
- ┘

##### Key Interactions to Highlight

- How Mindwave.py orchestrates all components
- How journal entries are saved to JSON files
- Demonstrate template selection and application
- Settings and tags management flow

##### Implementation Details

**[UI Components] ←→ [Mindwave Core] ←→ [Data Storage]**
- ↑
- [Template System]

##### Additional Elements

- Component types (UI, Core, Storage, Templates)
- File formats (JSON, MD)

##### The settings and customization capabilities

Remember to maintain a balance between showing the overall architecture while including enough detail to understand the application's structure and data flow.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef core fill:#98fb98,stroke:#333,stroke-width:2px
    classDef storage fill:#ffeb99,stroke:#333,stroke-width:2px
    classDef template fill:#dda0dd,stroke:#333,stroke-width:2px

    %% UI Layer
    subgraph UI
        MenuBar["MenuBar"]
        EditorWidget["EditorWidget"]
        SideMenu["SideMenu"]
        SettingsPanel["SettingsPanel"]
        TagsPanel["TagsPanel"]
    end

    %% Core Layer
    subgraph Core
        Mindwave["Mindwave Core"]
        AppSettings["App Settings Handler"]
    end

    %% Storage Layer
    subgraph Storage
        Settings["Settings Config"]
        Tags["Tags Config"]
        Journals["Journal Entries"]
    end

    %% Template System
    subgraph Templates
        TemplateSystem["Template System"]
        DaySnap["DaySnap"]
        FutureEcho["FutureEcho"]
        GymWarrior["GymWarrior"]
        MelodyMemo["MelodyMemo"]
        MindfulMemo["MindfulMemo"]
    end

    %% Relationships
    Mindwave --> MenuBar
    Mindwave --> EditorWidget
    Mindwave --> SideMenu
    Mindwave --> SettingsPanel
    Mindwave --> TagsPanel
    Mindwave --> AppSettings
    
    AppSettings --> Settings
    AppSettings --> Tags
    
    Mindwave --> Journals
    Mindwave --> TemplateSystem
    
    TemplateSystem --> DaySnap
    TemplateSystem --> FutureEcho
    TemplateSystem --> GymWarrior
    TemplateSystem --> MelodyMemo
    TemplateSystem --> MindfulMemo

    %% Style Applications
    class MenuBar,EditorWidget,SideMenu,SettingsPanel,TagsPanel ui
    class Mindwave,AppSettings core
    class Settings,Tags,Journals storage
    class TemplateSystem,DaySnap,FutureEcho,GymWarrior,MelodyMemo,MindfulMemo template

    %% Click Events
    click Mindwave "https://github.com/tervicke/mindwave/blob/main/src/Mindwave.py"
    click EditorWidget "https://github.com/tervicke/mindwave/blob/main/src/EditorWidget.py"
    click MenuBar "https://github.com/tervicke/mindwave/blob/main/src/MenuBar.py"
    click SideMenu "https://github.com/tervicke/mindwave/blob/main/src/SideMenu.py"
    click SettingsPanel "https://github.com/tervicke/mindwave/blob/main/src/SettingsPanel.py"
    click TagsPanel "https://github.com/tervicke/mindwave/blob/main/src/TagsPanel.py"
    click Settings "https://github.com/tervicke/mindwave/blob/main/src/settings.json"
    click Tags "https://github.com/tervicke/mindwave/blob/main/src/tags.json"
    click Journals "https://github.com/tervicke/mindwave/tree/main/journals/"
    click TemplateSystem "https://github.com/tervicke/mindwave/tree/main/templates/"
    click DaySnap "https://github.com/tervicke/mindwave/blob/main/templates/DaySnap.md"
    click FutureEcho "https://github.com/tervicke/mindwave/blob/main/templates/FutureEcho.md"
    click GymWarrior "https://github.com/tervicke/mindwave/blob/main/templates/GymWarrior.md"
    click MelodyMemo "https://github.com/tervicke/mindwave/blob/main/templates/MelodyMemo.md"
    click MindfulMemo "https://github.com/tervicke/mindwave/blob/main/templates/MindfulMemo.md"
    click AppSettings "https://github.com/tervicke/mindwave/blob/main/src/app_settings.py"
```
