# vparik/ascii-art-web architecture

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

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

## Overview

This small Go web app serves a main page and generates ASCII art from POSTed text and a selected banner. The request flow is routed through the server, validated and processed by the ASCII handler, rendered by the generator, and returned as plain text. The main-page handler loads the HTML template. The template contents were not sampled, so its page-level behavior is not described.

Main entry points: [`funcs/HandleAscii.go`](https://github.com/vparik/ascii-art-web/blob/master/funcs/HandleAscii.go) (ASCII request handler), [`main.go`](https://github.com/vparik/ascii-art-web/blob/master/main.go) (HTTP server), [`funcs/MainPage.go`](https://github.com/vparik/ascii-art-web/blob/master/funcs/MainPage.go) (Main page handler), [`funcs/PrinrAscii.go`](https://github.com/vparik/ascii-art-web/blob/master/funcs/PrinrAscii.go) (ASCII renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP application"]
  node_server["HTTP server<br/>[main.go]"]
  node_page["Main page handler<br/>[MainPage.go]"]
end

subgraph group_ascii["ASCII generation"]
  node_ascii_handler["ASCII request handler<br/>[HandleAscii.go]"]
  node_generator["ASCII renderer<br/>[PrinrAscii.go]"]
end

subgraph group_assets["Page and banner assets"]
  node_template["Page template<br/>[mainpage.html]"]
  node_banners["Banner files"]
end

node_user(("Browser/client"))

node_user -->|"sends HTTP requests"| node_server
node_server -->|"routes /"| node_page
node_server -->|"routes /ascii-art"| node_ascii_handler
node_page -->|"loads template"| node_template
node_ascii_handler -->|"reads selected banner"| node_banners
node_ascii_handler -->|"generates art"| node_generator
node_page -->|"writes page response"| node_user
node_ascii_handler -->|"writes art response"| node_user

click node_server "https://github.com/vparik/ascii-art-web/blob/master/main.go"
click node_page "https://github.com/vparik/ascii-art-web/blob/master/funcs/MainPage.go"
click node_ascii_handler "https://github.com/vparik/ascii-art-web/blob/master/funcs/HandleAscii.go"
click node_generator "https://github.com/vparik/ascii-art-web/blob/master/funcs/PrinrAscii.go"
click node_template "https://github.com/vparik/ascii-art-web/blob/master/Html/mainpage.html"
click node_banners "https://github.com/vparik/ascii-art-web/tree/master/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_server,node_page,node_user toneBlue
class node_ascii_handler,node_generator toneAmber
class node_template,node_banners toneMint
```

## Components

### HTTP application

- [HTTP server](https://github.com/vparik/ascii-art-web/blob/master/main.go): `main.go`
- [Main page handler](https://github.com/vparik/ascii-art-web/blob/master/funcs/MainPage.go): `funcs/MainPage.go`

### ASCII generation

- [ASCII request handler](https://github.com/vparik/ascii-art-web/blob/master/funcs/HandleAscii.go): `funcs/HandleAscii.go`
- [ASCII renderer](https://github.com/vparik/ascii-art-web/blob/master/funcs/PrinrAscii.go): `funcs/PrinrAscii.go`

### Page and banner assets

- [Page template](https://github.com/vparik/ascii-art-web/blob/master/Html/mainpage.html): `Html/mainpage.html`
- [Banner files](https://github.com/vparik/ascii-art-web/tree/master/banners): `banners`

### Other components

- **Browser/client**

## Connections

- Browser/client → HTTP server: sends HTTP requests
- HTTP server → Main page handler: routes / (evidence: `main.go`)
- HTTP server → ASCII request handler: routes /ascii-art (evidence: `main.go`)
- Main page handler → Page template: loads template (evidence: `funcs/MainPage.go`)
- ASCII request handler → Banner files: reads selected banner (evidence: `funcs/HandleAscii.go`)
- ASCII request handler → ASCII renderer: generates art (evidence: `funcs/HandleAscii.go`)
- Main page handler → Browser/client: writes page response (evidence: `funcs/MainPage.go`)
- ASCII request handler → Browser/client: writes art response (evidence: `funcs/HandleAscii.go`)
