# 23abhishek2024/algosort_visualizer architecture

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

- Interactive diagram: https://gitdiagram.com/23abhishek2024/algosort_visualizer
- Repository: https://github.com/23abhishek2024/algosort_visualizer

## Overview

##### Project type and purpose
- This is a static, single-page, front-end web application whose sole purpose is to let users generate an array and watch various sorting algorithms (bubble, selection, insertion, merge, quick) run on it—animated in real time.
- Implemented entirely in HTML, CSS/SCSS, and plain JavaScript; there is no backend or database.

##### File structure
- Top level
– index.html: the only HTML entry point
– style.scss: source for styles, compiled down to css/style.css + css/style.css.map
– css/: holds the compiled CSS
– scripts/: holds all JavaScript code
- scripts/ directory breakdown
– main.js: The central controller (wires up UI events, triggers sorts)
– visualizations.js: The view-renderer (takes algorithm steps and animates DOM bars)
– bubble_sort.js, selection_sort.js, insertion_sort.js, merge_sort.js, quick_sort.js: Pure algorithm implementations that expose step-by-step interfaces

##### README for additional insights
- Confirms it’s a front-end visualizer
- Mentions key features: array generation, shuffle, dropdown for algorithm choice, smooth animated bars
- No mention of any server-side or external dependencies

– UI → Controller → Algorithm Module → Visualization → UI

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Build Process"
        SCSS["style.scss"]:::build
        CSS["css/style.css"]:::styling
        SCSS -->|"compile"| CSS
    end

    subgraph "Browser"
        UI["index.html (UI Layer)"]:::ui
        CSSb["css/style.css (Styling Layer)"]:::styling
        Controller["main.js (Controller)"]:::controller

        subgraph "Algorithms"
            Bubble["bubble_sort.js"]:::algorithm
            Selection["selection_sort.js"]:::algorithm
            Insertion["insertion_sort.js"]:::algorithm
            Merge["merge_sort.js"]:::algorithm
            Quick["quick_sort.js"]:::algorithm
        end

        Viz["visualizations.js (Visualization Engine)"]:::viz

        UI -->|"user event"| Controller
        CSSb -->|"styles"| UI
        Controller -->|"invoke sort()"| Bubble
        Controller -->|"invoke sort()"| Selection
        Controller -->|"invoke sort()"| Insertion
        Controller -->|"invoke sort()"| Merge
        Controller -->|"invoke sort()"| Quick

        Bubble -->|"steps stream"| Viz
        Selection -->|"steps stream"| Viz
        Insertion -->|"steps stream"| Viz
        Merge -->|"steps stream"| Viz
        Quick -->|"steps stream"| Viz

        Viz -->|"DOM updates"| UI
        Viz -->|"animation complete"| Controller
    end

    click UI "https://github.com/23abhishek2024/algosort_visualizer/blob/main/index.html"
    click CSSb "https://github.com/23abhishek2024/algosort_visualizer/blob/main/css/style.css"
    click SCSS "https://github.com/23abhishek2024/algosort_visualizer/blob/main/style.scss"
    click Controller "https://github.com/23abhishek2024/algosort_visualizer/blob/main/scripts/main.js"
    click Viz "https://github.com/23abhishek2024/algosort_visualizer/blob/main/scripts/visualizations.js"
    click Bubble "https://github.com/23abhishek2024/algosort_visualizer/blob/main/scripts/bubble_sort.js"
    click Selection "https://github.com/23abhishek2024/algosort_visualizer/blob/main/scripts/selection_sort.js"
    click Insertion "https://github.com/23abhishek2024/algosort_visualizer/blob/main/scripts/insertion_sort.js"
    click Merge "https://github.com/23abhishek2024/algosort_visualizer/blob/main/scripts/merge_sort.js"
    click Quick "https://github.com/23abhishek2024/algosort_visualizer/blob/main/scripts/quick_sort.js"

    classDef ui fill:#D0E6FF,stroke:#333,stroke-width:1px
    classDef styling fill:#B3E5FC,stroke:#333,stroke-width:1px
    classDef controller fill:#C8E6C9,stroke:#333,stroke-width:1px
    classDef algorithm fill:#FFE0B2,stroke:#333,stroke-width:1px
    classDef viz fill:#E1BEE7,stroke:#333,stroke-width:1px
    classDef build fill:#EEEEEE,stroke:#333,stroke-width:1px
```
