# ok2codei/code-splash-app architecture

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

- Interactive diagram: https://gitdiagram.com/ok2codei/code-splash-app
- Repository: https://github.com/ok2codei/code-splash-app

## Overview

This is a small browser-based color-splash image editor: a user loads an image, edits which areas show color with a reveal/erase brush, then downloads the result. The sampled `app.js` implements the full workflow using browser image and canvas APIs. The HTML and CSS are present in the tree but were not sampled, so their responsibilities are not expanded here.

Main entry points: [`app.js`](https://github.com/ok2codei/code-splash-app/blob/main/app.js) (Image Editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_editor["Image Editor<br/>[app.js]"]
node_original[("Original Image<br/>[app.js]")]
node_canvas["Edited Canvas<br/>[app.js]"]
node_export["PNG Export<br/>[app.js]"]

node_user -->|"loads image"| node_editor
node_editor -->|"stores original"| node_original
node_editor -->|"grayscales image"| node_canvas
node_user -->|"paints or toggles"| node_editor
node_editor -->|"draws source"| node_original
node_editor -->|"updates brush area"| node_canvas
node_user -->|"requests download"| node_export
node_export -->|"encodes PNG"| node_canvas

click node_editor "https://github.com/ok2codei/code-splash-app/blob/main/app.js"
click node_original "https://github.com/ok2codei/code-splash-app/blob/main/app.js"
click node_canvas "https://github.com/ok2codei/code-splash-app/blob/main/app.js"
click node_export "https://github.com/ok2codei/code-splash-app/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_user toneBlue
class node_editor,node_canvas,node_export toneTeal
class node_original toneAmber
```

## Components

### Other components

- **User**
- [Image Editor](https://github.com/ok2codei/code-splash-app/blob/main/app.js): `app.js`
- [Original Image](https://github.com/ok2codei/code-splash-app/blob/main/app.js): `app.js`
- [Edited Canvas](https://github.com/ok2codei/code-splash-app/blob/main/app.js): `app.js`
- [PNG Export](https://github.com/ok2codei/code-splash-app/blob/main/app.js): `app.js`

## Connections

- User → Image Editor: loads image (evidence: `app.js`)
- Image Editor → Original Image: stores original (evidence: `app.js`)
- Image Editor → Edited Canvas: grayscales image (evidence: `app.js`)
- User → Image Editor: paints or toggles (evidence: `app.js`)
- Image Editor → Original Image: draws source (evidence: `app.js`)
- Image Editor → Edited Canvas: updates brush area (evidence: `app.js`)
- User → PNG Export: requests download (evidence: `app.js`)
- PNG Export → Edited Canvas: encodes PNG (evidence: `app.js`)
