# dinhhuy258/qmk-config architecture

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

- Interactive diagram: https://gitdiagram.com/dinhhuy258/qmk-config
- Repository: https://github.com/dinhhuy258/qmk-config

## Overview

##### Main Components
- QMK Firmware Core: Represent the underlying QMK platform that this external userspace overlays.
- Keyboard-Specific Configurations:
- The “keyboards” directory contains firmware tailored for specific keyboards (e.g., the crkbd, which is further divided into keymaps and board-specific configurations).
- The “layouts” directory holds keymap layouts (for example, under “ergodox”) which might be used for visualizing or further customizing the key arrangement.
- User Custom Code and Features:
- The “users” directory is where the bulk of custom code resides. Include subcomponents for
- General configuration files (config.h)
- Custom keymap definitions (keymap_introspection.c, keymap blocks)
- Feature implementations such as combos, tapdance, tap hold, and swapper.
- OLED display modules with different animations (bongocat, luna, etc.)
- Build and Configuration: Identify build related files such as Makefile, configuration files (e.g., .clang-format, .editorconfig) and the YAML configuration in keymap-drawer. These indicate the build process and coding standards that tie everything together.

##### Relationships and Interactions
- External QMK Userspace is a plugin to the QMK Firmware Core, meaning that when a user initiates a build (via a Makefile command), the QMK build system pulls in configuration and custom keymaps from this repository.
- The “keyboards” and “layouts” components each provide the device-specific keymap and layout configurations, which feed into the firmware that runs on the target hardware.
- The “users” component interacts with the core firmware by providing low-level customizations (for example, defining additional keycodes, custom features, and extended functionalities like OLED handling).
- The Keymap Drawer can be viewed as a supporting tool that takes the keymap layout definitions and produces a visual representation, assisting in debugging or design iteration.

##### Architectural Patterns and Design Principles
- Modular Design: The repository is clearly modular, with distinct directories for physical keyboard configurations, layout representations, and advanced user functionalities. This separation enables isolated development and testing.
- External Integration: The system uses an external userspace overlay, which is a design pattern that promotes reusability and separation between platform code (QMK) and customizations.
- Feature Extensibility: The “users” directory is organized into submodules (e.g., features and definitions) that can be independently extended, hinting at principles of separation of concerns and extensibility.

##### Relevant Technologies and Tools
- QMK Firmware: Since this is a QMK userspace project, the QMK ecosystem is at the core.
- Build System: The Makefile and build flags (like USE_SERIAL_PIN_D3, USE_RGB_LIGHTING, TAPPING_TERM) are prominent, so include an indication of the build process.
- Development Tools: Files like .clang-format, .clangd, and .editorconfig imply a standardized coding style enforced through common IDE integrations.
- YAML configuration (in keymap-drawer) shows utilization of configuration management for graphical tooling.

## Diagram (Mermaid)

```mermaid
graph TD
    A["Developer/Build Environment"]:::dev
    A --> B["QMK Build System"]:::build
    B --> C["Firmware for Target Keyboard"]:::firmwa

    D["QMK Firmware Core"]:::core

    subgraph "External QMK Userspace Overlay"
        E0["Overlay Repository"]:::overlay
        E1["Keyboard Configurations (crkbd)"]:::keyboard
        E2["Layouts for Ergodox"]:::layout
        E3["User Custom Code & Features"]:::users
        E4["Keymap Visualization Tool"]:::tool
        E5["Build & Config Files"]:::buildFiles
    end

    E0 -->|"integrates"| D:::integration
    E1 --> B
    E2 --> B
    E3 --> B
    E4 --> B
    E5 --> B

    click E0 "https://github.com/dinhhuy258/qmk-config/tree/master/Makefile"
    click E1 "https://github.com/dinhhuy258/qmk-config/tree/master/keyboards/crkbd"
    click E2 "https://github.com/dinhhuy258/qmk-config/tree/master/layouts/ergodox/dinhhuy258"
    click E3 "https://github.com/dinhhuy258/qmk-config/tree/master/users/dinhhuy258"
    click E4 "https://github.com/dinhhuy258/qmk-config/tree/master/keymap-drawer"

    classDef dev fill:#e0bbf4,stroke:#8e44ad,stroke-width:2px;
    classDef build fill:#aed6f1,stroke:#2e86c1,stroke-width:2px;
    classDef firmwa fill:#abebc6,stroke:#27ae60,stroke-width:2px;
    classDef core fill:#f9e79f,stroke:#f1c40f,stroke-width:2px;
    classDef overlay fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef keyboard fill:#f5cba7,stroke:#e67e22,stroke-width:2px;
    classDef layout fill:#fadbd8,stroke:#e74c3c,stroke-width:2px;
    classDef users fill:#d6eaf8,stroke:#3498db,stroke-width:2px;
    classDef tool fill:#d2b4de,stroke:#8e44ad,stroke-width:2px;
    classDef buildFiles fill:#f6ddcc,stroke:#d35400,stroke-width:2px;
    classDef integration fill:#fcf3cf,stroke:#f39c12,stroke-width:2px;
```
