# eathorne2/quickcode-html-designer architecture

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

- Interactive diagram: https://gitdiagram.com/eathorne2/quickcode-html-designer
- Repository: https://github.com/eathorne2/quickcode-html-designer

## Overview

##### Project type and purpose
- This is a full-stack monolithic web application written in PHP, JavaScript, HTML and CSS.

##### File structure
- Top-level
- LICENSE, README.md
- quickcodeui_db.sql – database schema for optional MySQL backing store
- app/components
- Custom PHP “component” library, likely used by the back-end to render segment templates
- public/
- index.php – main entry point for the UI
- api.php – AJAX endpoint for dynamic operations (saving, segment listing, palette operations)
- .htaccess – Apache URL rewriting and security rules
- assets/ – CSS, JS and images served statically to the browser
- includes/ – back-end modules that implement page logic: loader, segment injection, login/signup, palette manager, save/load, export
- segments/ – organized library of PHP template files for UI “chunks” (buttons, cards, grids, forms, etc.)
- saved/ – per-user storage of generated HTML & CSS snippets (file system persisted)
- export_templates/ – HTML/JS templates used to bundle or package the finished designs
- public/color_palettes, public/images – static asset stores for palettes & segment artwork

##### Key technical insights from README
- Single-application designer providing drag-and-drop of HTML “segments.”
- No mention of external microservices or heavy third-party integrations beyond standard LAMP stack.

##### Capturing essential elements
- Don’t clutter with every single segment file—group under “Segments Library.”
- Separation of static assets vs. dynamic code.
- Make the API boundary explicit: index.php (UI shell) vs. api.php (data & operations).
- File-based storage of user projects as a key persistence mechanism.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Browser / Client"]:::frontend
        StaticAssets["Static Assets (CSS/JS/Images)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        WebServer["Web Server (Apache/nginx + PHP-FPM)"]:::backend
        EntryUI["Index UI (public/index.php)"]:::backend
        API["API Endpoint (public/api.php)"]:::backend
        HTAccess["Rewrite & Security (.htaccess)"]:::backend
        Includes["Controller Modules"]:::backend
        CompEngine["Component Engine"]:::backend
        SegLib["Segments Library"]:::backend
        ZipScript["ZIP Download Script"]:::backend
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        direction TB
        FileStorage["File Storage (segments, templates)"]:::storage
        ColorPalettes["Color Palettes Store"]:::storage
        SegmentImages["Segment Images Library"]:::storage
        ExportTemplates["Export Templates"]:::storage
        UserProjects["User Project Storage"]:::storage
        Database["Database (MySQL)"]:::storage
    end

    %% Connections
    Browser -->|"HTTP GET index.php"| EntryUI
    Browser -->|"HTTP GET assets"| StaticAssets
    Browser -->|"AJAX (GET/POST)"| API

    EntryUI -->|"includes controllers"| Includes
    EntryUI -->|"loads component engine"| CompEngine
    EntryUI -->|"renders templates"| SegLib

    API -->|"invokes controllers"| Includes
    API -->|"uses component engine"| CompEngine
    API -->|"reads/writes projects"| UserProjects
    API -->|"executes SQL"| Database
    API -->|"handles export"| ZipScript

    CompEngine -->|"file I/O"| SegLib
    ZipScript -->|"uses templates"| ExportTemplates
    ZipScript -->|"reads projects"| UserProjects
    ZipScript -->|"downloads"| Browser

    %% File storage relations
    CompEngine -->|"reads palettes"| ColorPalettes
    Includes -->|"serves segment images"| SegmentImages

    %% Click Events
    click StaticAssets "https://github.com/eathorne2/quickcode-html-designer/tree/main/public/assets/css/"
    click ColorPalettes "https://github.com/eathorne2/quickcode-html-designer/tree/main/public/color_palettes/"
    click SegmentImages "https://github.com/eathorne2/quickcode-html-designer/tree/main/public/images/segment_images/"
    click ExportTemplates "https://github.com/eathorne2/quickcode-html-designer/tree/main/public/export_templates/"
    click EntryUI "https://github.com/eathorne2/quickcode-html-designer/blob/main/public/index.php"
    click API "https://github.com/eathorne2/quickcode-html-designer/blob/main/public/api.php"
    click HTAccess "https://github.com/eathorne2/quickcode-html-designer/blob/main/public/.htaccess"
    click Includes "https://github.com/eathorne2/quickcode-html-designer/tree/main/public/includes/"
    click CompEngine "https://github.com/eathorne2/quickcode-html-designer/blob/main/app/components/index.php"
    click SegLib "https://github.com/eathorne2/quickcode-html-designer/tree/main/public/segments/"
    click UserProjects "https://github.com/eathorne2/quickcode-html-designer/tree/main/public/saved/"
    click ZipScript "https://github.com/eathorne2/quickcode-html-designer/blob/main/public/zip_download.php"
    click Database "https://github.com/eathorne2/quickcode-html-designer/blob/main/quickcodeui_db.sql"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#1F618D,color:#1F618D
    classDef backend fill:#D5F5E3,stroke:#196F3D,color:#196F3D
    classDef storage fill:#FDEBD0,stroke:#B9770E,color:#B9770E
```
