# boltomli/it-tools architecture

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

- Interactive diagram: https://gitdiagram.com/boltomli/it-tools
- Repository: https://github.com/boltomli/it-tools

## Overview

##### Main Components
- Frontend Application (the browser-based SPA)
– This is centered on the Vue app (src/App.vue) and includes the overall shell, layouts (src/layouts), and the main routing (src/router.ts) that connects different tools and pages.
- Tools Modules
– Directory: src/tools. Each subdirectory represents a distinct tool (e.g., ascii-text-drawer, base64-file-converter, etc.). These are essentially micro–features that are composed into the main application.
- UI Component Library
– Directory: src/ui. Contains reusable components (c-alert, c-button, c-modal, etc.) used throughout the application to maintain a consistent UX.
- Supporting Modules and Plugins
– i18n Module (src/modules/i18n and locales directory): Manages multilingual support.
– Composition Functions & Utilities (src/composable and src/utils): Provide shared logic and services (e.g., debounced refs, fuzzySearch).
– Mixins/Plugins (src/plugins): For integrations such as i18n, themeing (naive plugin), and analytics (plausible plugin).
- Build & Infrastructure / Deployment Layer
– Containerization (Dockerfile, .dockerignore, nginx.conf): The app can be built into a Docker container, served via Nginx, and deployed (with CI/CD workflows under .github/workflows).
– CI/CD and Testing: Configuration files for ESLint, Vitest, Playwright, and GitHub workflows ensure quality and continuous deployment.

##### Relationships and Interactions
- At runtime, the Browser (Client) loads the SPA (hosted via Docker/Nginx), which starts at App.vue.
- The router (src/router.ts) directs navigation between pages (found under src/pages) and tools.
- The UI components from src/ui are used by both the main pages and tool-specific views.
- Each tool module (in src/tools) encapsulates its own business logic and UI. They import and reuse shared composables and utilities.
- The plugins are registered during application initialization (in src/main.ts) to globally provide features like i18n and tracking.
- The build system (Vite, pnpm scripts) compiles the project into static assets that are then served in production.

##### Architectural Patterns & Design Principles
- Component-Based Architecture:
– Emphasize that each tool is a self-contained component integrated via the main Vue router.
- Modularization:
– The separation in directories (tools, ui, plugins, modules) shows a clear separation of concerns.
- Plugin & Composable Pattern:
– The use of composables and plugins (custom hooks) helps manage cross-cutting concerns like i18n and analytics.
- Containerized Deployment:
– A Dockerized environment means the production version runs inside a container behind Nginx.
- CI/CD Integration:
– Automated testing and release workflows ensure a robust development pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser("Browser (Client)"):::external
    DockerContainer("Docker Container"):::container
    Browser -->|"loads"| DockerContainer

    subgraph "Frontend Web Application"
        direction TB
        App("Main App (src/App.vue)"):::app

        subgraph "Routing & Navigation"
            direction TB
            Router("Router (src/router.ts)"):::routing
            MainInit("Main Init (src/main.ts)"):::routing
            Pages("Pages (src/pages)"):::routing
        end

        subgraph "UI Layer"
            direction TB
            UI_Components("UI Components (src/ui)"):::ui
            UI_Theme("UI Theme (src/ui/theme)"):::ui
            UI_Demo("UI Demo (src/ui/demo)"):::ui
        end

        subgraph "Tools Modules"
            direction TB
            Tools("Tools Directory (src/tools)"):::tools
            ToolsIndex("Tools Index (src/tools/index.ts)"):::tools
        end

        subgraph "Plugins & Composables"
            direction TB
            Plugins("Plugins (src/plugins)"):::plugins
            Composables("Composables (src/composable)"):::plugins
            Utilities("Utilities (src/utils)"):::plugins
        end

        subgraph "Internationalization"
            direction TB
            I18n("i18n Module (src/modules/i18n)"):::i18n
            Locales("Locale Files (locales)"):::i18n
        end
    end

    DockerContainer --> App
    App --> Router
    App --> MainInit
    Router --> Pages
    App --> UI_Components
    UI_Components --> UI_Theme
    UI_Components --> UI_Demo
    App --> Tools
    Tools --> ToolsIndex
    App --> Plugins
    Plugins --> Composables
    Plugins --> Utilities
    App --> I18n
    I18n --> Locales

    subgraph "Build & Infrastructure"
        direction TB
        Containerization("Containerization Files (Dockerfile, .dockerignore, nginx.conf)"):::infra
        Deployment("Deployment Configurations (netlify.toml, vercel.json)"):::infra
        CICD("CI/CD Workflows (.github/workflows)"):::infra
        BuildTools("Build Tools (vite.config.ts, pnpm-lock.yaml, package.json, tsconfig files)"):::infra
    end

    BuildTools --- DockerContainer
    Containerization --> Deployment
    Deployment --> CICD

    %% Click Events
    click App "https://github.com/boltomli/it-tools/blob/main/src/App.vue"
    click Router "https://github.com/boltomli/it-tools/blob/main/src/router.ts"
    click MainInit "https://github.com/boltomli/it-tools/blob/main/src/main.ts"
    click Pages "https://github.com/boltomli/it-tools/tree/main/src/pages"
    click UI_Components "https://github.com/boltomli/it-tools/tree/main/src/ui"
    click UI_Theme "https://github.com/boltomli/it-tools/tree/main/src/ui/theme"
    click UI_Demo "https://github.com/boltomli/it-tools/tree/main/src/ui/demo"
    click Tools "https://github.com/boltomli/it-tools/tree/main/src/tools"
    click ToolsIndex "https://github.com/boltomli/it-tools/blob/main/src/tools/index.ts"
    click Plugins "https://github.com/boltomli/it-tools/tree/main/src/plugins"
    click Composables "https://github.com/boltomli/it-tools/tree/main/src/composable"
    click Utilities "https://github.com/boltomli/it-tools/tree/main/src/utils"
    click I18n "https://github.com/boltomli/it-tools/tree/main/src/modules/i18n"
    click Locales "https://github.com/boltomli/it-tools/tree/main/locales"
    click Containerization "https://github.com/boltomli/it-tools/tree/main/Dockerfile"
    click Deployment "https://github.com/boltomli/it-tools/blob/main/netlify.toml"
    click CICD "https://github.com/boltomli/it-tools/tree/main/.github/workflows"
    click BuildTools "https://github.com/boltomli/it-tools/blob/main/vite.config.ts"

    %% Styles
    classDef external fill:#ffcccc,stroke:#d80000,stroke-width:2px;
    classDef container fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef app fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef routing fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef ui fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef tools fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef plugins fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
    classDef i18n fill:#ffeeba,stroke:#856404,stroke-width:2px;
    classDef infra fill:#f0f0f0,stroke:#6f42c1,stroke-width:2px;
```
