# evairx/hours-booster architecture

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

- Interactive diagram: https://gitdiagram.com/evairx/hours-booster
- Repository: https://github.com/evairx/hours-booster

## Overview

##### Main Components
- Main Process (src/main):
- Represented by src/main/index.js. This component is responsible for bootstrapping the application, handling system-level logic, and creating one or more application windows.
- Renderer Process (src/renderer):
- Contains all UI elements and pages. Its structure shows components (e.g., authMenu.jsx, github.jsx, loading.jsx, menu.jsx) and pages (authentication, library, update).
- Configuration & Build:
- Files like vite.config.js, config.js, and package.json indicate the build tooling and runtime configuration.
- Internationalization:
- The presence of i18n.js and locale files suggests multi-language support which adapts based on the OS language.
- Static Assets:
- The index.html and the content in the public directory are responsible for initializing and presenting the application UI.
- Styles and Theming:
- CSS and styled components found in src/renderer/styles and styled subfolders define the visual presentation.

##### Relationships and Interactions
- The Main Process initiates the application by loading index.html and setting up the environment (e.g., security, window management).
- The Renderer Process manages UI components:
- Authentication Flow: Pages under src/renderer/pages/auth allow users to log into their Steam accounts and handle Steam Guard verification.
- Library Display: The Library page (src/renderer/pages/Library) shows the user’s Steam library with logos, names, and playtime details.
- Boosting Timer: The update page (src/renderer/pages/update) manages the display of the timer that tracks game boosting.
- Configuration files provide the settings that control the build and runtime behavior, such as ESLint rules (.eslintrc.cjs), module resolving (vite.config.js), and overall package configuration (package.json).
- The i18n module and locale files ensure the UI dynamically adapts to the user’s OS language settings.

##### Important Architectural Patterns
- Separation of Concerns: Clear demarcation between the main (backend-like functionality in Electron) and the renderer (frontend UI) processes.
- Component-Based Architecture: The organization within src/renderer/components shows a clear use of reusable components.
- Internationalization: Integrated support for multi-language, improving user experience for global audiences.

##### Relevant Technologies, Frameworks, or Libraries
- Likely use of Electron for desktop application development.
- Vite as the build tool (vite.config.js).
- A modern JavaScript framework (possibly React, as indicated by file extensions like .jsx) for building the UI.
- ESLint configuration indicating a focus on code quality (.eslintrc.cjs).

- Clear Labels for Each Component:
- Differentiate between backend processes (Electron main), frontend UI (React components or similar), static asset management, and configuration layers.
- Annotations for Architectural Patterns:
- Notes that explain the separation of concerns, modularity, and component-based design if needed for clarity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Process
    MP["Main Process (src/main/index.js)"]:::backend

    %% Renderer Process
    subgraph "Renderer Process"
        RP["Renderer Process (src/renderer)"]:::frontend
        subgraph "UI Components & Pages"
            UC["UI Components (src/renderer/components)"]:::frontend
            AuthPage["Authentication Page (src/renderer/pages/auth/Login/index.jsx)"]:::frontend
            LibPage["Library Page (src/renderer/pages/Library/index.jsx)"]:::frontend
            UpdatePage["Boosting/Update Page (src/renderer/pages/update/index.jsx)"]:::frontend
        end
        subgraph "Styling & Theming"
            GlobalStyle["Global Styles (src/renderer/styles/global.css)"]:::styles
            ComponentStyles["Component Styles (src/renderer/styles/styled)"]:::styles
        end
        subgraph "Internationalization"
            I18n["i18n Module (i18n.js)"]:::i18n
            Locale["Locale Files (src/renderer/locales/global.json)"]:::i18n
        end
    end

    %% Static Assets
    subgraph "Static Assets"
        HTML["HTML Entry Point (index.html)"]:::asset
        Public["Public Directory (public)"]:::asset
    end

    %% Configuration & Build
    subgraph "Configuration & Build"
        Vite["Build Config (vite.config.js)"]:::config
        Config["Runtime Config (config.js)"]:::config
        Package["Package (package.json)"]:::config
        ESLint["Code Quality (.eslintrc.cjs)"]:::config
    end

    %% Data Flow and Interactions
    MP -->|"loads"| HTML
    MP -->|"createsWindow"| RP
    RP -->|"rendersUI"| UC
    UC -->|"triggersAuth"| AuthPage
    UC -->|"showsLibrary"| LibPage
    UC -->|"managesBoost"| UpdatePage
    RP -->|"appliesGlobalStyles"| GlobalStyle
    RP -->|"appliesComponentStyles"| ComponentStyles
    RP -->|"integratesI18n"| I18n
    I18n -->|"loadsLocale"| Locale
    RP -->|"servesAssets"| Public
    RP -->|"usesConfig"| Config
    Vite -->|"buildsMainAndRenderer"| MP
    Vite -->|"buildsMainAndRenderer"| RP
    Package -->|"definesDeps"| Vite
    Package -->|"definesRuntime"| Config
    ESLint -->|"enforcesQuality"| Package

    %% Click Events
    click MP "https://github.com/evairx/hours-booster/blob/main/src/main/index.js"
    click RP "https://github.com/evairx/hours-booster/tree/main/src/renderer"
    click UC "https://github.com/evairx/hours-booster/tree/main/src/renderer/components"
    click AuthPage "https://github.com/evairx/hours-booster/blob/main/src/renderer/pages/auth/Login/index.jsx"
    click LibPage "https://github.com/evairx/hours-booster/blob/main/src/renderer/pages/Library/index.jsx"
    click UpdatePage "https://github.com/evairx/hours-booster/blob/main/src/renderer/pages/update/index.jsx"
    click I18n "https://github.com/evairx/hours-booster/blob/main/i18n.js"
    click Locale "https://github.com/evairx/hours-booster/blob/main/src/renderer/locales/global.json"
    click HTML "https://github.com/evairx/hours-booster/blob/main/index.html"
    click Public "https://github.com/evairx/hours-booster/tree/main/public"
    click GlobalStyle "https://github.com/evairx/hours-booster/blob/main/src/renderer/styles/global.css"
    click ComponentStyles "https://github.com/evairx/hours-booster/tree/main/src/renderer/styles/styled"
    click Vite "https://github.com/evairx/hours-booster/blob/main/vite.config.js"
    click Config "https://github.com/evairx/hours-booster/blob/main/config.js"
    click Package "https://github.com/evairx/hours-booster/blob/main/package.json"
    click ESLint "https://github.com/evairx/hours-booster/blob/main/.eslintrc.cjs"

    %% Styles
    classDef backend fill:#f88,stroke:#333,stroke-width:2px;
    classDef frontend fill:#8cf,stroke:#333,stroke-width:2px;
    classDef asset fill:#fc8,stroke:#333,stroke-width:2px;
    classDef config fill:#ff8,stroke:#333,stroke-width:2px;
    classDef i18n fill:#cfc,stroke:#333,stroke-width:2px;
    classDef styles fill:#ccf,stroke:#333,stroke-width:2px;
```
