# thornedll/utilities architecture

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

- Interactive diagram: https://gitdiagram.com/thornedll/utilities
- Repository: https://github.com/thornedll/utilities

## Overview

##### Project type and purpose
- This is a single‑page application (SPA) built with Create React App and TypeScript.
- It provides client‑side pages for Date conversion, JSON conversion, and JSON diffing.
- There is no backend or microservice; all logic lives in the front‑end within the browser.

##### File structure
- Top‑level folders:
- public: static assets (index.html, manifest.json, redirects, robots.txt)
- src: application source code
- src subfolders:
- components/UI: reusable low‑level controls (buttons, inputs, tooltips, selects)
- components/blocks: layout pieces (navigation bar, page container wrappers)
- components/pages: individual “routes” or views (DateConverter, JsonConverter, JsonDiff)
- assets/styles: global SCSS modules
- utils, constants, ts (types & interfaces): helper functions and shared types
- Build/config files: package.json, tsconfig.json, CRA wiring (reportWebVitals, react-app-env.d.ts)

##### README
- Confirms it’s a CRA bootstrapped React/TypeScript project.
- Standard npm scripts: start (dev server), build (production bundle), test, eject.

##### Diagramming recommendations
- Developer, Dev Server, Bundler, Source Modules, Static Host, Browser
- src → dev server → browser (hot reload)
- src + public → build → deploy → browser
- App.tsx → pages → blocks → UI → browser DOM
- Blue rectangles for code modules
- Callouts for important tech (React, TypeScript, SCSS, CRA).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Layer
    DevWorkstation["Developer Workstation (IDE)"]:::external

    %% Development Infrastructure
    subgraph "Development Infrastructure"
        DevServer["Dev Server & Bundler\n(Create React App/webpack)"]:::infra
    end

    %% Source Modules
    subgraph "Source Modules" 
        direction TB
        EntryIndex["src/index.tsx"]:::code
        EntryApp["src/App.tsx"]:::code

        subgraph "UI Library" 
            direction TB
            UILibDir["components/UI"]:::code
            Button["Button.tsx"]:::code
            TextInput["TextInput.tsx"]:::code
            BaseSelect["BaseSelect.tsx"]:::code
            UILibIndex["index.ts"]:::code
        end

        subgraph "Layout Blocks"
            direction TB
            BlocksDir["components/blocks"]:::code
            Navigation["Navigation.tsx"]:::code
            BlocksIndex["index.ts"]:::code
        end

        subgraph "Pages / Routes"
            direction TB
            PagesDir["components/pages"]:::code
            DateConverter["DateConverter.tsx"]:::code
            JsonConverter["JsonConverter.tsx"]:::code
            JsonDiff["JsonDiff.tsx"]:::code
            PagesIndex["index.ts"]:::code
        end

        subgraph "Shared Styles"
            direction TB
            GlobalStyles["assets/styles/global.module.scss"]:::code
            UIStyles["components/UI/styles.module.scss"]:::code
        end

        Utils["src/utils/index.ts"]:::code
        Constants["src/constants/index.ts"]:::code

        subgraph "Types & Interfaces"
            direction TB
            TypesFile["src/ts/types/types.ts"]:::code
            InterfacesFile["src/ts/interfaces/interfaces.ts"]:::code
        end

        EntryIndex --> EntryApp
        EntryApp --> PagesDir
        PagesDir --> BlocksDir
        BlocksDir --> UILibDir
        EntryApp --> Utils
        EntryApp --> Constants
        EntryApp --> TypesFile
    end

    %% Public Assets
    subgraph "Public Assets"
        direction TB
        PublicIndex["public/index.html"]:::storage
    end

    %% Build & Deployment
    subgraph "Build & Deploy"
        BuildProcess["Build Process\n(transpile, bundle, minify)"]:::infra
        StaticHost["Static File Server / CDN"]:::storage
    end

    %% Browser Runtime
    Browser["Browser\n(React SPA)"]:::runtime

    %% Flows
    DevWorkstation --> DevServer
    DevServer -->|watches src| EntryIndex
    DevServer -->|serves| Browser
    PublicIndex --> BuildProcess
    EntryIndex --> BuildProcess
    BuildProcess --> StaticHost
    StaticHost --> Browser
    Browser -->|loads index.html| PublicIndex
    Browser -->|loads bundle| EntryApp
    EntryApp -->|renders SPA| Browser

    %% Click Events
    click DevServer "https://github.com/thornedll/utilities/blob/master/package.json"
    click EntryIndex "https://github.com/thornedll/utilities/blob/master/src/index.tsx"
    click EntryApp "https://github.com/thornedll/utilities/blob/master/src/App.tsx"
    click UILibDir "https://github.com/thornedll/utilities/tree/master/src/components/UI"
    click Button "https://github.com/thornedll/utilities/blob/master/src/components/UI/Button.tsx"
    click TextInput "https://github.com/thornedll/utilities/blob/master/src/components/UI/TextInput.tsx"
    click BaseSelect "https://github.com/thornedll/utilities/blob/master/src/components/UI/BaseSelect.tsx"
    click UILibIndex "https://github.com/thornedll/utilities/blob/master/src/components/UI/index.ts"
    click BlocksDir "https://github.com/thornedll/utilities/tree/master/src/components/blocks"
    click Navigation "https://github.com/thornedll/utilities/blob/master/src/components/blocks/Navigation.tsx"
    click BlocksIndex "https://github.com/thornedll/utilities/blob/master/src/components/blocks/index.ts"
    click PagesDir "https://github.com/thornedll/utilities/tree/master/src/components/pages"
    click DateConverter "https://github.com/thornedll/utilities/blob/master/src/components/pages/DateConverter.tsx"
    click JsonConverter "https://github.com/thornedll/utilities/blob/master/src/components/pages/JsonConverter.tsx"
    click JsonDiff "https://github.com/thornedll/utilities/blob/master/src/components/pages/JsonDiff.tsx"
    click PagesIndex "https://github.com/thornedll/utilities/blob/master/src/components/pages/index.ts"
    click GlobalStyles "https://github.com/thornedll/utilities/blob/master/src/assets/styles/global.module.scss"
    click UIStyles "https://github.com/thornedll/utilities/blob/master/src/components/UI/styles.module.scss"
    click Utils "https://github.com/thornedll/utilities/blob/master/src/utils/index.ts"
    click Constants "https://github.com/thornedll/utilities/blob/master/src/constants/index.ts"
    click TypesFile "https://github.com/thornedll/utilities/blob/master/src/ts/types/types.ts"
    click InterfacesFile "https://github.com/thornedll/utilities/blob/master/src/ts/interfaces/interfaces.ts"
    click PublicIndex "https://github.com/thornedll/utilities/blob/master/public/index.html"

    %% Styles
    classDef infra fill:#a2d5c6,stroke:#333,stroke-width:1px;
    classDef code fill:#9ec1cf,stroke:#333,stroke-width:1px;
    classDef storage fill:#ffcc5c,stroke:#333,stroke-width:1px;
    classDef runtime fill:#ff6f69,stroke:#333,stroke-width:1px;
    classDef external fill:#dddddd,stroke:#333,stroke-width:1px;
```
