# tsoding/boomer architecture

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

- Interactive diagram: https://gitdiagram.com/tsoding/boomer
- Repository: https://github.com/tsoding/boomer

## Overview

##### Main Components

a) Core Application Layer:
- Main Application (src/boomer.nim)
- Configuration Handler (src/config.nim)
- Navigation System (src/navigation.nim)
- Screenshot Module (src/screenshot.nim)
- Linear Algebra Utilities (src/la.nim)

b) Graphics Pipeline:
- Vertex Shader (src/vert.glsl)
- Fragment Shader (src/frag.glsl)
- OpenGL Context

c) System Integration:
- X11 System Interface
- Graphics Hardware Interface
- File System (Configuration)

##### Component Relationships

**[User Input] → [Main Application]**
- ↓
- ┌───────────────┼────────────────┐
- ↓               ↓                ↓
**[Navigation]    [Screenshot]    [Configuration]**

- → [OpenGL Pipeline] ←────┘
- ↓
- [Graphics Output]

##### Technical Details

a) Input/Output Flow:
- X11 event handling for user input
- Screenshot capture pipeline
- OpenGL rendering pipeline
- Configuration file I/O

b) External Dependencies:
- OpenGL
- X11 and extensions (XRandR, XExt)
- Mesa

##### Implementation Details

- Shader pipeline implementation
- Configuration file location and format
- System call interfaces
- Event handling flow

##### Additional Elements

- System requirements
- Configuration parameters
- Developer vs. production paths

Remember to indicate the asynchronous nature of user input handling and the continuous rendering loop, as this is crucial for understanding the application's behavior.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef system fill:#4CAF50,stroke:#2E7D32,color:white
    classDef io fill:#FF9800,stroke:#EF6C00,color:white
    classDef config fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef critical fill:#F44336,stroke:#C62828,color:white
    classDef shader fill:#795548,stroke:#4E342E,color:white

    %% User Input and System Interface
    UserInput["User Input"]:::io
    X11["X11 System Interface"]:::system
    GraphicsHW["Graphics Hardware"]:::system

    %% Core Application Components
    MainApp["Main Application"]:::core
    Config["Configuration Handler"]:::config
    Nav["Navigation System"]:::core
    Screenshot["Screenshot Module"]:::critical
    LA["Linear Algebra Utils"]:::core

    %% Graphics Pipeline
    subgraph GL ["OpenGL Pipeline"]
        VertShader["Vertex Shader"]:::shader
        FragShader["Fragment Shader"]:::shader
        GLContext["OpenGL Context"]:::system
    end

    %% Build and Package Configuration
    BuildConfig["Build Configuration"]:::config
    NixConfig["Nix Package Config"]:::config

    %% Output
    GraphicsOut["Graphics Output"]:::io

    %% Relationships
    UserInput --> X11
    X11 --> MainApp
    MainApp --> Nav
    MainApp --> Screenshot
    MainApp --> Config
    LA --> Nav
    LA --> Screenshot
    Screenshot --> GLContext
    Nav --> GLContext
    Config --> GLContext
    VertShader --> GLContext
    FragShader --> GLContext
    GLContext --> GraphicsHW
    GraphicsHW --> GraphicsOut

    %% Click Events
    click MainApp "https://github.com/tsoding/boomer/blob/master/src/boomer.nim"
    click Config "https://github.com/tsoding/boomer/blob/master/src/config.nim"
    click Nav "https://github.com/tsoding/boomer/blob/master/src/navigation.nim"
    click Screenshot "https://github.com/tsoding/boomer/blob/master/src/screenshot.nim"
    click LA "https://github.com/tsoding/boomer/blob/master/src/la.nim"
    click VertShader "https://github.com/tsoding/boomer/blob/master/src/vert.glsl"
    click FragShader "https://github.com/tsoding/boomer/blob/master/src/frag.glsl"
    click BuildConfig "https://github.com/tsoding/boomer/blob/master/boomer.nimble"
    click NixConfig "https://github.com/tsoding/boomer/blob/master/overlay/boomer.nix"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["System Interfaces"]:::system
        L3["Input/Output"]:::io
        L4["Configuration"]:::config
        L5["Critical Path"]:::critical
        L6["Shaders"]:::shader
    end
```
