# akhtarmdsaad/mini-figma architecture

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

- Interactive diagram: https://gitdiagram.com/akhtarmdsaad/mini-figma
- Repository: https://github.com/akhtarmdsaad/mini-figma

## Overview

##### Main Components
- User Interface (UI) Layer: At its core, the project is entirely client-side. Start with an "HTML/CSS" component represented by index.html and style.css. This layer contains the structural layout including the left panel, the playground area (canvas), and the right panel.
- Code Output/Console Feedback: The application prints the generated HTML/CSS code to the console, so include a component for "Code Generation/Output" that interacts with the JavaScript logic.

##### Relationships and Interactions
- The UI layer (index.html) is the host for various panels:

##### Architectural Patterns and Design Principles
- Modular Design: Even though it is a simple application, there are separate JS files (including one for handling “show/hide” functions). This implies that you could represent these modules as sub-components under the JS Logic block.

##### Relevant Technologies and Frameworks
- Since the project is a plain HTML/JavaScript/CSS web application, represent the “Browser” as the overall runtime environment.
- Mention that there is no backend or server-side code – all logic is implemented client-side inside the browser.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser (Client)"]:::env
    Browser -->|"renders"| UILayer["UI Layer"]
    Browser -->|"runs"| JSLayer["Interaction & Logic Layer"]

    subgraph "UI Layer"
        HTMLFiles["HTML/CSS Files"]:::htmlGroup
        subgraph "HTML/CSS Files"
            IndexFile["index.html"]:::html
            StyleFile["style.css"]:::html
        end
        
        UIPanels["UI Panels"]:::uiGroup
        subgraph "UI Panels"
            LeftPanel["Left Panel – Style Controls"]:::ui
            Canvas["Playground – Canvas"]:::ui
            RightPanel["Right Panel – Box Manager"]:::ui
        end
    end

    subgraph "Interaction & Logic Layer"
        JSLogic["JS Core Logic"]:::js
        subgraph "JavaScript Modules"
            CoreJS["UI Behavior & Interactivity"]:::jsModule
            ShowHide["Show/Hide Module"]:::jsModule
        end
        CodeGen["Code Generation/Console Output"]:::js
    end

    LeftPanel -->|"triggers"| JSLogic
    Canvas -->|"sendevents"| JSLogic
    RightPanel -->|"updateslabels"| JSLogic

    JSLogic -->|"updatesDOM"| Canvas
    JSLogic -->|"logsCode"| CodeGen

    classDef env fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef html fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef ui fill:#AED6F1,stroke:#2874A6,stroke-width:2px;
    classDef js fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef jsModule fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef htmlGroup fill:#FDEBD0,stroke:#D35400,stroke-dasharray:5,5;
    classDef uiGroup fill:#D6EAF8,stroke:#2471A3,stroke-dasharray:5,5;

    click IndexFile "https://github.com/akhtarmdsaad/mini-figma/blob/main/index.html"
    click StyleFile "https://github.com/akhtarmdsaad/mini-figma/blob/main/style.css"
    click CoreJS "https://github.com/akhtarmdsaad/mini-figma/blob/main/script.js"
    click CoreJS "https://github.com/akhtarmdsaad/mini-figma/blob/main/scripts/script.js"
    click ShowHide "https://github.com/akhtarmdsaad/mini-figma/blob/main/scripts/showHide.js"
    click CodeGen "https://github.com/akhtarmdsaad/mini-figma/blob/main/script.js"
    click CodeGen "https://github.com/akhtarmdsaad/mini-figma/blob/main/scripts/script.js"
```
