# 24f3002840/ascii-yourself architecture

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

- Interactive diagram: https://gitdiagram.com/24f3002840/ascii-yourself
- Repository: https://github.com/24f3002840/ascii-yourself

## Overview

1. **High-level shape**
   - This is a **client-side React + TypeScript app** built with **Vite**.
   - The app appears to be an **AI Studio demo** that combines a visual/ASCII rendering surface with a Gemini-powered analysis feature.

2. **Application bootstrap**
   - `index.html` provides the host page.
   - `index.tsx` is the browser entrypoint that mounts the React app.
   - `App.tsx` is the composition root and main orchestration layer for the whole UI.

3. **Main orchestration boundary**
   - `App.tsx` likely owns the central state and coordinates:
     - user controls,
     - ASCII rendering,
     - AI analysis requests,
     - modal visibility,
     - and any feedback effects.
   - In diagram terms, this is the hub that connects UI, utilities, and the Gemini service.

4. **UI subsystem**
   - `components/ControlPanel.tsx` is the user interaction surface for adjusting app behavior.
   - `components/AsciiCanvas.tsx` is the primary display surface for the ASCII output.
   - `components/AnalysisModal.tsx` is the presentation layer for AI-generated analysis or results.
   - These are “dumb” or semi-dumb view components compared with `App.tsx`.

5. **Data transformation subsystem**
   - `utils/asciiConverter.ts` is the core transformation utility.
   - It likely converts source input into ASCII-friendly output consumed by `AsciiCanvas`.
   - This is a pure logic boundary: no UI, no network, just deterministic conversion.

6. **External AI/service boundary**
   - `services/geminiService.ts` is the only obvious network-facing subsystem.
   - It integrates with **Google Gemini** using the `GEMINI_API_KEY` configured in local environment.
   - The README confirms this is the main external dependency and that the app is expected to run locally while calling Gemini remotely.

7. **Feedback and sensory layer**
   - `utils/soundEffects.ts` adds audio or interaction feedback.
   - This is separate from the main rendering and AI flow, suggesting the app uses sound as part of the user experience rather than business logic.

8. **Shared domain model**
   - `types.ts` defines the shared TypeScript contracts used across components, services, and utilities.
   - This file is the schema boundary that keeps UI state, converter output, and AI response shapes aligned.

9. **Likely runtime data flow**
   - User interacts with `ControlPanel`.
   - `App.tsx` updates state and triggers conversion via `asciiConverter`.
   - The resulting ASCII output is rendered in `AsciiCanvas`.
   - When analysis is requested, `App.tsx` calls `geminiService`, then shows the response in `AnalysisModal`.
   - `soundEffects` may play on key interactions or successful actions.

10. **Deployment and environment**
   - The project is intended to run in the browser with no visible backend layer.
   - `package.json`, `vite.config.ts`, and `tsconfig.json` support local development, bundling, and TypeScript compilation.
   - `metadata.json` suggests AI Studio-specific app metadata rather than application runtime logic.

11. **Architecture boundary to draw**
   - Draw one main client application box containing `App.tsx` and the three UI components.
   - Add a pure-logic box for `asciiConverter` and `soundEffects`.
   - Add an external service box for Gemini accessed through `services/geminiService.ts`.
   - There is no evidence of a database, server API, or persistent storage layer in this repo.

Main entry points: [`App.tsx`](https://github.com/24f3002840/ascii-yourself/blob/main/App.tsx) (App), [`types.ts`](https://github.com/24f3002840/ascii-yourself/blob/main/types.ts) (types.ts), [`services/geminiService.ts`](https://github.com/24f3002840/ascii-yourself/blob/main/services/geminiService.ts) (Gemini Service), [`package.json`](https://github.com/24f3002840/ascii-yourself/blob/main/package.json) (package.json)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Client Runtime"]
  node_index_html["index.html<br/>host page<br/>[index.html]"]
  node_index_tsx["index.tsx<br/>entrypoint<br/>[index.tsx]"]
  node_app["App<br/>orchestrator<br/>[App.tsx]"]
  node_control_panel["Control Panel<br/>ui component<br/>[ControlPanel.tsx]"]
  node_ascii_canvas["Ascii Canvas<br/>ui component<br/>[AsciiCanvas.tsx]"]
  node_analysis_modal["Analysis Modal<br/>ui component<br/>[AnalysisModal.tsx]"]
end

subgraph group_logic["Core Logic"]
  node_types["types.ts<br/>shared schema<br/>[types.ts]"]
  node_ascii_converter["ASCII Converter<br/>transform util<br/>[asciiConverter.ts]"]
  node_sound_effects["Sound Effects<br/>feedback util<br/>[soundEffects.ts]"]
end

subgraph group_external["External AI"]
  node_gemini_service["Gemini Service<br/>api client<br/>[geminiService.ts]"]
end

subgraph group_build["Build Support"]
  node_package_json["package.json<br/>project manifest<br/>[package.json]"]
  node_vite_config["vite.config.ts<br/>build config<br/>[vite.config.ts]"]
  node_tsconfig["tsconfig.json<br/>ts config<br/>[tsconfig.json]"]
  node_metadata["metadata.json<br/>ai studio metadata<br/>[metadata.json]"]
  node_readme["README.md<br/>docs<br/>[README.md]"]
end

node_index_html -->|"loads"| node_index_tsx
node_index_tsx -->|"mounts"| node_app
node_app -->|"renders"| node_control_panel
node_app -->|"renders"| node_ascii_canvas
node_app -->|"renders"| node_analysis_modal
node_app -->|"uses"| node_ascii_converter
node_app -->|"calls"| node_gemini_service
node_app -->|"uses"| node_sound_effects
node_app -->|"shares"| node_types
node_control_panel -->|"depends on"| node_types
node_ascii_canvas -->|"depends on"| node_types
node_analysis_modal -->|"depends on"| node_types
node_ascii_converter -->|"constrains"| node_types
node_gemini_service -->|"constrains"| node_types
node_package_json -.->|"supports"| node_vite_config
node_package_json -.->|"supports"| node_tsconfig
node_metadata -.->|"describes"| node_app
node_readme -.->|"documents"| node_gemini_service

click node_index_html "https://github.com/24f3002840/ascii-yourself/blob/main/index.html"
click node_index_tsx "https://github.com/24f3002840/ascii-yourself/blob/main/index.tsx"
click node_app "https://github.com/24f3002840/ascii-yourself/blob/main/App.tsx"
click node_control_panel "https://github.com/24f3002840/ascii-yourself/blob/main/components/ControlPanel.tsx"
click node_ascii_canvas "https://github.com/24f3002840/ascii-yourself/blob/main/components/AsciiCanvas.tsx"
click node_analysis_modal "https://github.com/24f3002840/ascii-yourself/blob/main/components/AnalysisModal.tsx"
click node_types "https://github.com/24f3002840/ascii-yourself/blob/main/types.ts"
click node_ascii_converter "https://github.com/24f3002840/ascii-yourself/blob/main/utils/asciiConverter.ts"
click node_sound_effects "https://github.com/24f3002840/ascii-yourself/blob/main/utils/soundEffects.ts"
click node_gemini_service "https://github.com/24f3002840/ascii-yourself/blob/main/services/geminiService.ts"
click node_package_json "https://github.com/24f3002840/ascii-yourself/blob/main/package.json"
click node_vite_config "https://github.com/24f3002840/ascii-yourself/blob/main/vite.config.ts"
click node_tsconfig "https://github.com/24f3002840/ascii-yourself/blob/main/tsconfig.json"
click node_metadata "https://github.com/24f3002840/ascii-yourself/blob/main/metadata.json"
click node_readme "https://github.com/24f3002840/ascii-yourself/blob/main/README.md"

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_index_html,node_index_tsx,node_app,node_control_panel,node_ascii_canvas,node_analysis_modal toneBlue
class node_types,node_ascii_converter,node_sound_effects toneAmber
class node_gemini_service toneMint
class node_package_json,node_vite_config,node_tsconfig,node_metadata,node_readme toneRose
```

## Components

### Client Runtime

Browser entrypoint and React UI composition

- [index.html](https://github.com/24f3002840/ascii-yourself/blob/main/index.html): host page · Browser shell that loads the app · `index.html`
- [index.tsx](https://github.com/24f3002840/ascii-yourself/blob/main/index.tsx): entrypoint · React bootstrapping and app mount · `index.tsx`
- [App](https://github.com/24f3002840/ascii-yourself/blob/main/App.tsx): orchestrator · Main state and workflow coordinator · `App.tsx`
- [Control Panel](https://github.com/24f3002840/ascii-yourself/blob/main/components/ControlPanel.tsx): ui component · User controls for app settings and actions · `components/ControlPanel.tsx`
- [Ascii Canvas](https://github.com/24f3002840/ascii-yourself/blob/main/components/AsciiCanvas.tsx): ui component · Primary ASCII rendering surface · `components/AsciiCanvas.tsx`
- [Analysis Modal](https://github.com/24f3002840/ascii-yourself/blob/main/components/AnalysisModal.tsx): ui component · Displays Gemini-generated analysis · `components/AnalysisModal.tsx`

### Core Logic

Deterministic conversion, shared types, and feedback helpers

- [types.ts](https://github.com/24f3002840/ascii-yourself/blob/main/types.ts): shared schema · Shared TypeScript contracts across the app · `types.ts`
- [ASCII Converter](https://github.com/24f3002840/ascii-yourself/blob/main/utils/asciiConverter.ts): transform util · Converts source content into ASCII-friendly output · `utils/asciiConverter.ts`
- [Sound Effects](https://github.com/24f3002840/ascii-yourself/blob/main/utils/soundEffects.ts): feedback util · Audio and interaction feedback helpers · `utils/soundEffects.ts`

### External AI

Remote Gemini integration

- [Gemini Service](https://github.com/24f3002840/ascii-yourself/blob/main/services/geminiService.ts): api client · Client for Gemini analysis requests · `services/geminiService.ts`

### Build Support

Vite, TypeScript, and app metadata

- [package.json](https://github.com/24f3002840/ascii-yourself/blob/main/package.json): project manifest · Dependencies and scripts for the app · `package.json`
- [vite.config.ts](https://github.com/24f3002840/ascii-yourself/blob/main/vite.config.ts): build config · Vite bundler configuration · `vite.config.ts`
- [tsconfig.json](https://github.com/24f3002840/ascii-yourself/blob/main/tsconfig.json): ts config · TypeScript compiler settings · `tsconfig.json`
- [metadata.json](https://github.com/24f3002840/ascii-yourself/blob/main/metadata.json): ai studio metadata · App metadata for the hosting environment · `metadata.json`
- [README.md](https://github.com/24f3002840/ascii-yourself/blob/main/README.md): docs · Project overview and setup notes · `README.md`

## Connections

- index.html → index.tsx: loads · The host page loads the React entrypoint
- index.tsx → App: mounts · Bootstraps the main application component
- App → Control Panel: renders · Composes the user control surface
- App → Ascii Canvas: renders · Feeds ASCII output into the display surface
- App → Analysis Modal: renders · Opens the analysis presentation layer
- App → ASCII Converter: uses · Transforms input into ASCII output
- App → Gemini Service: calls · Requests AI analysis from Gemini
- App → Sound Effects: uses · Triggers interaction feedback
- App → types.ts: shares · Uses common app data contracts
- Control Panel → types.ts: depends on · Consumes shared state and option shapes
- Ascii Canvas → types.ts: depends on · Renders typed output data
- Analysis Modal → types.ts: depends on · Displays typed analysis results
- ASCII Converter → types.ts: constrains · Uses shared domain models for conversion output
- Gemini Service → types.ts: constrains · Maps Gemini responses into app-friendly shapes
- package.json → vite.config.ts: supports · Project scripts rely on the Vite build setup
- package.json → tsconfig.json: supports · Project dependencies and scripts align with TypeScript build settings
- metadata.json → App: describes · Metadata identifies the app in the AI Studio environment
- README.md → Gemini Service: documents · Documents the Gemini integration and local setup
