# avgerinos8/ascii-art-web architecture

> Architecture diagram of the GitHub repository avgerinos8/ascii-art-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/avgerinos8/ascii-art-web
- Repository: https://github.com/avgerinos8/ascii-art-web

## Overview

Ascii Art Web is a browser-based ASCII-art generator. A user submits text and font, layout, and color options; the Go server normalizes input, builds a render configuration, loads banner glyphs, and generates HTML output for the page or JSON response. The browser also supports live updates, HSL color-rule editing, background effects, layout controls, and saved settings. The README documents these capabilities; some frontend wiring and server routes are not visible in the sampled excerpts, so those relationships are not inferred.

Main entry points: [`main.go`](https://github.com/avgerinos8/ascii-art-web/blob/main/main.go) (HTTP Server and Handlers), [`templates/index.html`](https://github.com/avgerinos8/ascii-art-web/blob/main/templates/index.html) (Generator Page), [`internal/font/font.go`](https://github.com/avgerinos8/ascii-art-web/blob/main/internal/font/font.go) (Banner Render Engine), [`static/fetch.js`](https://github.com/avgerinos8/ascii-art-web/blob/main/static/fetch.js) (Live Requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Interface"]
  node_ui["Generator Page<br/>[index.html]"]
  node_styles["Interface Styling<br/>[style.css]"]
  node_live["Live Requests<br/>[fetch.js]"]
  node_colorui["Color Rule Editor<br/>[colorPreview.js]"]
  node_background["Background Effects<br/>[bg.js]"]
  node_persistence["Setting Persistence<br/>[persistence.js]"]
  node_scroll["Scroll Synchronization<br/>[aScrollSync.js]"]
end

subgraph group_server["HTTP Application"]
  node_server["HTTP Server and Handlers<br/>[main.go]"]
  node_assets["Static Asset Service<br/>[main.go]"]
  node_templates["Page Templates"]
end

subgraph group_render["Rendering Engine"]
  node_engine["Banner Render Engine<br/>[font.go]"]
  node_layout["Wrap and Align<br/>[tokens.go]"]
  node_color["Color Conversion<br/>[color.go]"]
  node_banners["Font Banner Assets"]
end

subgraph group_input["Input and Color"]
  node_config["Render Configuration<br/>[arghandler.go]"]
  node_normalize["Text Normalization<br/>[normalize.go]"]
end

node_visitor(("Browser User"))
node_browserstore[("Browser LocalStorage")]

node_visitor -->|"uses"| node_ui
node_visitor -->|"requests updates"| node_live
node_live -->|"sends live requests"| node_server
node_server -->|"renders page"| node_templates
node_server -->|"serves static files"| node_assets
node_server -->|"builds configuration"| node_config
node_config -->|"normalizes text"| node_normalize
node_server -->|"creates and renders"| node_engine
node_engine -->|"reads glyphs"| node_banners
node_engine -->|"runs layout"| node_layout
node_layout -->|"converts colors"| node_color
node_colorui -.->|"triggers updates"| node_live
node_persistence -->|"saves and restores"| node_browserstore
node_background -->|"adjusts effects"| node_ui
node_scroll -->|"synchronizes scrolling"| node_ui
node_styles -.->|"styles"| node_ui

click node_ui "https://github.com/avgerinos8/ascii-art-web/blob/main/templates/index.html"
click node_styles "https://github.com/avgerinos8/ascii-art-web/blob/main/static/style.css"
click node_live "https://github.com/avgerinos8/ascii-art-web/blob/main/static/fetch.js"
click node_colorui "https://github.com/avgerinos8/ascii-art-web/blob/main/static/colorPreview.js"
click node_background "https://github.com/avgerinos8/ascii-art-web/blob/main/static/bg.js"
click node_persistence "https://github.com/avgerinos8/ascii-art-web/blob/main/static/persistence.js"
click node_scroll "https://github.com/avgerinos8/ascii-art-web/blob/main/static/aScrollSync.js"
click node_server "https://github.com/avgerinos8/ascii-art-web/blob/main/main.go"
click node_assets "https://github.com/avgerinos8/ascii-art-web/blob/main/main.go"
click node_templates "https://github.com/avgerinos8/ascii-art-web/tree/main/templates"
click node_config "https://github.com/avgerinos8/ascii-art-web/blob/main/internal/arghandler/arghandler.go"
click node_normalize "https://github.com/avgerinos8/ascii-art-web/blob/main/internal/normalize/normalize.go"
click node_engine "https://github.com/avgerinos8/ascii-art-web/blob/main/internal/font/font.go"
click node_layout "https://github.com/avgerinos8/ascii-art-web/blob/main/internal/font/tokens.go"
click node_color "https://github.com/avgerinos8/ascii-art-web/blob/main/internal/color/color.go"
click node_banners "https://github.com/avgerinos8/ascii-art-web/tree/main/banners"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_styles,node_live,node_colorui,node_background,node_persistence,node_scroll,node_visitor toneBlue
class node_server,node_assets,node_templates,node_browserstore toneAmber
class node_engine,node_layout,node_color,node_banners toneMint
class node_config,node_normalize toneRose
```

## Components

### Web Interface

- [Generator Page](https://github.com/avgerinos8/ascii-art-web/blob/main/templates/index.html): `templates/index.html`
- [Interface Styling](https://github.com/avgerinos8/ascii-art-web/blob/main/static/style.css): `static/style.css`
- [Live Requests](https://github.com/avgerinos8/ascii-art-web/blob/main/static/fetch.js): `static/fetch.js`
- [Color Rule Editor](https://github.com/avgerinos8/ascii-art-web/blob/main/static/colorPreview.js): `static/colorPreview.js`
- [Background Effects](https://github.com/avgerinos8/ascii-art-web/blob/main/static/bg.js): `static/bg.js`
- [Setting Persistence](https://github.com/avgerinos8/ascii-art-web/blob/main/static/persistence.js): `static/persistence.js`
- [Scroll Synchronization](https://github.com/avgerinos8/ascii-art-web/blob/main/static/aScrollSync.js): `static/aScrollSync.js`

### HTTP Application

- [HTTP Server and Handlers](https://github.com/avgerinos8/ascii-art-web/blob/main/main.go): `main.go`
- [Static Asset Service](https://github.com/avgerinos8/ascii-art-web/blob/main/main.go): `main.go`
- [Page Templates](https://github.com/avgerinos8/ascii-art-web/tree/main/templates): `templates`

### Rendering Engine

- [Banner Render Engine](https://github.com/avgerinos8/ascii-art-web/blob/main/internal/font/font.go): `internal/font/font.go`
- [Wrap and Align](https://github.com/avgerinos8/ascii-art-web/blob/main/internal/font/tokens.go): `internal/font/tokens.go`
- [Color Conversion](https://github.com/avgerinos8/ascii-art-web/blob/main/internal/color/color.go): `internal/color/color.go`
- [Font Banner Assets](https://github.com/avgerinos8/ascii-art-web/tree/main/banners): `banners`

### Input and Color

- [Render Configuration](https://github.com/avgerinos8/ascii-art-web/blob/main/internal/arghandler/arghandler.go): `internal/arghandler/arghandler.go`
- [Text Normalization](https://github.com/avgerinos8/ascii-art-web/blob/main/internal/normalize/normalize.go): `internal/normalize/normalize.go`

### Other components

- **Browser User**
- **Browser LocalStorage**

## Connections

- Browser User → Generator Page: uses (evidence: `README.md`)
- Browser User → Live Requests: requests updates (evidence: `README.md`)
- Live Requests → HTTP Server and Handlers: sends live requests (evidence: `README.md`)
- HTTP Server and Handlers → Page Templates: renders page (evidence: `main.go`)
- HTTP Server and Handlers → Static Asset Service: serves static files (evidence: `main.go`)
- HTTP Server and Handlers → Render Configuration: builds configuration (evidence: `main.go`)
- Render Configuration → Text Normalization: normalizes text (evidence: `internal/arghandler/arghandler.go`)
- HTTP Server and Handlers → Banner Render Engine: creates and renders (evidence: `main.go`)
- Banner Render Engine → Font Banner Assets: reads glyphs (evidence: `internal/font/font.go`)
- Banner Render Engine → Wrap and Align: runs layout (evidence: `internal/font/font.go`)
- Wrap and Align → Color Conversion: converts colors (evidence: `internal/font/tokens.go`)
- Color Rule Editor → Live Requests: triggers updates
- Setting Persistence → Browser LocalStorage: saves and restores (evidence: `static/persistence.js`)
- Background Effects → Generator Page: adjusts effects (evidence: `static/bg.js`)
- Scroll Synchronization → Generator Page: synchronizes scrolling (evidence: `static/aScrollSync.js`)
- Interface Styling → Generator Page: styles
