# seonglae/intuiter architecture

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

- Interactive diagram: https://gitdiagram.com/seonglae/intuiter
- Repository: https://github.com/seonglae/intuiter

## Overview

##### Project Type & Purpose
- Project Type: A desktop application built with Electron, which leverages Nuxt for part of its renderer process and incorporates AutoHotKey scripts to facilitate key remapping and enhanced shortcut functionalities.
- Purpose: It targets both developers and regular users by substituting complex tools like Vim/Emacs with a more user-friendly method of managing key shortcuts. The system also integrates support for dynamic AHK compilation and Windows mouse API calls for smooth mouse control.

##### Analyzing the File Structure
- Electron Integration:
– The ".electron-nuxt" directory provides Electron-specific scripts and configuration for running a Nuxt-powered renderer.
– Files like build.js, config.js, dev.js, and index.js indicate that the Electron main process is bootstrapped and configured here.
- Main Process Code:
– Under "src/main", you find scripts such as BrowserWinHandler.js, mainWindow.js, and boot scripts (index.dev.js / index.prod.js) that likely initialize the Electron app, create windows, and manage IPC channels to the renderer.
- Renderer (UI) Process:
– "src/renderer" contains assets (CSS), Vue components, layouts, and pages (e.g., index.vue) indicating the UI is built with Vue (or Nuxt).
– The presence of a nuxt.config.js and TypeScript configurations (tsconfig.json, store/index.ts) confirms a modern frontend setup.
- AHK Integration:
– The "resources/ahk" directory, with its subfolders and files (executables, libraries, source scripts, and compilers), is the core for handling and compiling AHK scripts dynamically. This integration makes the app not only a UI shell but also an execution engine for system-level scripts.
- Auxiliary Components:
– There are build scripts like builder.config.js, package.json, and various GitHub configuration files (workflows, issue templates) for managing CI/CD and versioning.

##### Main Components & Their Relationships
- Electron Main Process:
– Acts as the application’s backbone, bootstrapping the app, creating the main window, and managing IPC and system calls.
– Initiates and communicates with the renderer process.
- Renderer Process (Nuxt/Vue UI):
– Provides the front-end user interface by displaying the key mapping and other configuration pages.
– May interact with the main process through IPC to trigger system-level functionality.
- AHK Scripting Engine:
– The AHK resources (scripts, compiler, libraries) are integrated so that on-the-fly script compilation and execution can occur as per user actions.
– Communication between Electron’s main process and AHK components is essential (e.g., via child processes or API calls) to execute system-level changes.
- External Dependencies & Windows API:
– The application integrates Windows mouse API DLL for smooth mouse control.

##### Important Architectural Patterns & Design Principles
- Separation of Concerns:
– The design clearly separates the UI (renderer) from the core business logic/system control (main process) and the system integration (AHK/Windows API).
- Layered/Multi-tier Architecture:
- IPC & Modular Communication:
– There is likely robust inter-process communication (IPC) between the main process and the renderer, as well as connections between the main process and the AHK subsystem.
- Use of Modern Frameworks:

##### Additional Elements
- Clear Labels: Use descriptive labels for every component and sub-module (such as Nuxt config, Electron boot scripts, AHK compiler, etc.).
- Technology Highlights: Annotate modules with the main technologies used (e.g., Electron, Nuxt/Vue, AHK, Windows API).
- Extensibility Points: Optionally, note where contributions can be made (UI in src/renderer, AHK scripts in resources/ahk).

##### Final Advice for the Architect
- Don’t shy away from exposing internal structures (for instance, distinguishing between the .electron-nuxt configurations and the src main/renderer distinctions).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Configuration Layer
    subgraph "Build & Configuration Layer"
        EI["Electron Integration"]:::build
        BC["Builder Config"]:::build
    end

    %% Core Application Layer
    subgraph "Core Application Layer"
        EMP["Electron Main Process"]:::electron
        RP["Renderer Process (Nuxt/Vue UI)"]:::renderer
        AHK["AHK Scripting Engine"]:::ahk
        API["Windows API Integration"]:::windows
    end

    %% External Assets Layer
    subgraph "External Assets"
        EA["External Assets (Icons/Images)"]:::assets
    end

    %% Connections between layers
    BC --->|"builds"| EI
    EI --->|"configures"| EMP
    EI --->|"configures"| RP
    RP --->|"IPC_Communication"| EMP
    EMP --->|"AHK_ScriptExecution"| AHK
    AHK --->|"Windows_API_Calls"| API
    EA --->|"provides_assets"| RP

    %% Click Events
    click EI "https://github.com/seonglae/intuiter/blob/main/.electron-nuxt"
    click BC "https://github.com/seonglae/intuiter/blob/main/builder.config.js"
    click EMP "https://github.com/seonglae/intuiter/tree/main/src/main"
    click RP "https://github.com/seonglae/intuiter/tree/main/src/renderer"
    click AHK "https://github.com/seonglae/intuiter/tree/main/resources/ahk"
    click EA "https://github.com/seonglae/intuiter/tree/main/asset"

    %% Styles
    classDef electron fill:#F7DC6F,stroke:#000,stroke-width:2px;
    classDef renderer fill:#AED6F1,stroke:#000,stroke-width:2px;
    classDef ahk fill:#A9DFBF,stroke:#000,stroke-width:2px;
    classDef windows fill:#F5B7B1,stroke:#000,stroke-width:2px;
    classDef build fill:#D7BDE2,stroke:#000,stroke-width:2px;
    classDef assets fill:#F9E79F,stroke:#000,stroke-width:2px;
```
