# tahirdotdev-tdd/alive-ascii architecture

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

- Interactive diagram: https://gitdiagram.com/tahirdotdev-tdd/alive-ascii
- Repository: https://github.com/tahirdotdev-tdd/alive-ascii

## Overview

Living ASCII Portrait is a browser-based tool for turning a user’s message and photo into an animated ASCII portrait and exporting it as a looping GIF. The main path is photo and message input, portrait rendering with visual effects, then optional export. The implementation is concentrated in app.js; the graph separates its major responsibilities while reusing that exact source path. The app.js excerpt is partial, so internal links not shown directly are supported by README statements rather than assumptions about unsampled code.

Main entry points: [`app.js`](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js) (ASCII scene), [`index.html`](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/index.html) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Portrait input"]
  node_photo_input["Photo input<br/>[app.js]"]
  node_message["Message and controls<br/>[app.js]"]
end

subgraph group_render["Portrait rendering"]
  node_image_prep["Image preparation<br/>[app.js]"]
  node_light_analysis["Light analysis<br/>[app.js]"]
  node_glyph_grid["Character grid<br/>[app.js]"]
  node_ascii_scene["ASCII scene<br/>[app.js]"]
end

subgraph group_effects["Visual effects"]
  node_lamp_effects["Lamp effects<br/>[app.js]"]
  node_ripple["Pointer ripple<br/>[app.js]"]
  node_animation["Animated rendering<br/>[app.js]"]
end

subgraph group_export["GIF export"]
  node_gif_export["GIF export<br/>[app.js]"]
  node_gif_encoder["GIF encoder<br/>[app.js]"]
end

node_user(("User"))
node_interface["Web interface<br/>[index.html]"]
node_browser["Browser"]
node_download["GIF download"]

node_user -->|"uses"| node_interface
node_interface -->|"accepts photo"| node_photo_input
node_interface -->|"sets message"| node_message
node_photo_input -->|"loads image"| node_image_prep
node_image_prep -->|"samples pixels"| node_light_analysis
node_light_analysis -->|"maps brightness"| node_glyph_grid
node_message -->|"provides text"| node_glyph_grid
node_glyph_grid -->|"renders portrait"| node_ascii_scene
node_ascii_scene -->|"adds lighting"| node_lamp_effects
node_ascii_scene -->|"responds to pointer"| node_ripple
node_ascii_scene -->|"animates scene"| node_animation
node_user -->|"requests export"| node_gif_export
node_gif_export -->|"encodes frames"| node_gif_encoder
node_gif_export -->|"offers GIF"| node_download
node_browser -->|"reads locally"| node_photo_input

click node_interface "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/index.html"
click node_photo_input "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_message "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_image_prep "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_light_analysis "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_glyph_grid "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_ascii_scene "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_lamp_effects "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_ripple "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_animation "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_gif_export "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"
click node_gif_encoder "https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js"

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_photo_input,node_message,node_user,node_browser toneBlue
class node_image_prep,node_light_analysis,node_glyph_grid,node_ascii_scene toneAmber
class node_lamp_effects,node_ripple,node_animation toneMint
class node_gif_export,node_gif_encoder toneRose
class node_interface toneTeal
class node_download toneIndigo
```

## Components

### Portrait input

- [Photo input](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`
- [Message and controls](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`

### Portrait rendering

- [Image preparation](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`
- [Light analysis](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`
- [Character grid](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`
- [ASCII scene](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`

### Visual effects

- [Lamp effects](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`
- [Pointer ripple](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`
- [Animated rendering](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`

### GIF export

- [GIF export](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`
- [GIF encoder](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/app.js): `app.js`

### Other components

- **User**
- [Web interface](https://github.com/tahirdotdev-tdd/alive-ascii/blob/main/index.html): `index.html`
- **Browser**
- **GIF download**

## Connections

- User → Web interface: uses (evidence: `README.md`)
- Web interface → Photo input: accepts photo (evidence: `README.md`)
- Web interface → Message and controls: sets message (evidence: `README.md`)
- Photo input → Image preparation: loads image (evidence: `app.js`)
- Image preparation → Light analysis: samples pixels (evidence: `app.js`)
- Light analysis → Character grid: maps brightness (evidence: `README.md`)
- Message and controls → Character grid: provides text (evidence: `README.md`)
- Character grid → ASCII scene: renders portrait (evidence: `README.md`)
- ASCII scene → Lamp effects: adds lighting (evidence: `README.md`)
- ASCII scene → Pointer ripple: responds to pointer (evidence: `README.md`)
- ASCII scene → Animated rendering: animates scene (evidence: `app.js`)
- User → GIF export: requests export (evidence: `README.md`)
- GIF export → GIF encoder: encodes frames (evidence: `README.md`)
- GIF export → GIF download: offers GIF (evidence: `app.js`)
- Browser → Photo input: reads locally (evidence: `README.md`)
