# codemisba/visual-lingo- architecture

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

- Interactive diagram: https://gitdiagram.com/codemisba/visual-lingo-
- Repository: https://github.com/codemisba/visual-lingo-

## Overview

VisuaLingo AI combines website summarization and translation with image/text-to-language assistance. In the website workflow, a user selects a language and submits a URL; the React analyzer calls the Flask backend, which fetches and extracts page text, analyzes it, translates the result, and returns both versions for display and browser speech. A separate Supabase function implements a website-analysis path, while another handles image captioning/text extraction and translation. The excerpts do not show these Supabase functions wired to the React UI, so they are shown as independent HTTP entry points; Backend.py is a separate mock image-upload route.

Main entry points: [`website_analyzer_backend.py`](https://github.com/codemisba/visual-lingo-/blob/main/website_analyzer_backend.py) (Flask analyzer), [`supabase/functions/analyze-website/index.ts`](https://github.com/codemisba/visual-lingo-/blob/main/supabase/functions/analyze-website/index.ts) (Edge website analyzer), [`supabase/functions/vision-speak/index.ts`](https://github.com/codemisba/visual-lingo-/blob/main/supabase/functions/vision-speak/index.ts) (Vision and speech), [`src/components/WebsiteAnalyzer.tsx`](https://github.com/codemisba/visual-lingo-/blob/main/src/components/WebsiteAnalyzer.tsx) (Website analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_analyzer_ui["Website analyzer"]
  node_language_selector["Language selector"]
  node_browser_speech["Browser speech"]
end

subgraph group_analysis["Website analysis"]
  node_flask_analyzer["Flask analyzer"]
  node_edge_analyzer["Edge website analyzer<br/>[index.ts]"]
end

subgraph group_vision["Vision and language"]
  node_vision_speak["Vision and speech<br/>[index.ts]"]
end

subgraph group_prototype["Image upload prototype"]
  node_image_upload["Image upload mock<br/>[Backend.py]"]
end

node_visitor(("Visitor"))
node_page_site["Target website"]
node_lovable_ai["Lovable AI gateway"]
node_libretranslate["LibreTranslate"]
node_uploaded_image["Uploaded image"]

node_visitor -->|"submits URL"| node_analyzer_ui
node_analyzer_ui -->|"POSTs analysis"| node_flask_analyzer
node_flask_analyzer -->|"fetches page"| node_page_site
node_flask_analyzer -->|"requests analysis"| node_lovable_ai
node_flask_analyzer -->|"requests translation"| node_lovable_ai
node_flask_analyzer -->|"fallback translation"| node_libretranslate
node_analyzer_ui -->|"speaks results"| node_browser_speech
node_visitor -->|"submits URL"| node_edge_analyzer
node_edge_analyzer -->|"fetches page"| node_page_site
node_edge_analyzer -->|"requests analysis"| node_lovable_ai
node_edge_analyzer -->|"requests translation"| node_lovable_ai
node_edge_analyzer -->|"returns results"| node_visitor
node_visitor -->|"submits image or text"| node_vision_speak
node_vision_speak -->|"requests caption and translation"| node_lovable_ai
node_vision_speak -->|"fallback translation"| node_libretranslate
node_vision_speak -->|"returns result"| node_visitor
node_visitor -->|"uploads images"| node_image_upload
node_image_upload -->|"saves image"| node_uploaded_image

click node_analyzer_ui "https://github.com/codemisba/visual-lingo-/blob/main/src/components/WebsiteAnalyzer.tsx"
click node_language_selector "https://github.com/codemisba/visual-lingo-/blob/main/src/components/LanguageSelector.tsx"
click node_flask_analyzer "https://github.com/codemisba/visual-lingo-/blob/main/website_analyzer_backend.py"
click node_edge_analyzer "https://github.com/codemisba/visual-lingo-/blob/main/supabase/functions/analyze-website/index.ts"
click node_vision_speak "https://github.com/codemisba/visual-lingo-/blob/main/supabase/functions/vision-speak/index.ts"
click node_image_upload "https://github.com/codemisba/visual-lingo-/blob/main/Backend.py"

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_analyzer_ui,node_language_selector,node_browser_speech toneBlue
class node_flask_analyzer,node_edge_analyzer toneAmber
class node_vision_speak toneMint
class node_image_upload toneRose
class node_visitor,node_page_site,node_lovable_ai,node_libretranslate,node_uploaded_image toneIndigo
```

## Components

### Web interface

- [Website analyzer](https://github.com/codemisba/visual-lingo-/blob/main/src/components/WebsiteAnalyzer.tsx): `src/components/WebsiteAnalyzer.tsx`
- [Language selector](https://github.com/codemisba/visual-lingo-/blob/main/src/components/LanguageSelector.tsx): `src/components/LanguageSelector.tsx`
- **Browser speech**

### Website analysis

- [Flask analyzer](https://github.com/codemisba/visual-lingo-/blob/main/website_analyzer_backend.py): `website_analyzer_backend.py`
- [Edge website analyzer](https://github.com/codemisba/visual-lingo-/blob/main/supabase/functions/analyze-website/index.ts): `supabase/functions/analyze-website/index.ts`

### Vision and language

- [Vision and speech](https://github.com/codemisba/visual-lingo-/blob/main/supabase/functions/vision-speak/index.ts): `supabase/functions/vision-speak/index.ts`

### Image upload prototype

- [Image upload mock](https://github.com/codemisba/visual-lingo-/blob/main/Backend.py): `Backend.py`

### Other components

- **Visitor**
- **Target website**
- **Lovable AI gateway**
- **LibreTranslate**
- **Uploaded image**

## Connections

- Visitor → Website analyzer: submits URL (evidence: `src/components/WebsiteAnalyzer.tsx`)
- Website analyzer → Flask analyzer: POSTs analysis (evidence: `src/components/WebsiteAnalyzer.tsx`)
- Flask analyzer → Target website: fetches page (evidence: `website_analyzer_backend.py`)
- Flask analyzer → Lovable AI gateway: requests analysis (evidence: `website_analyzer_backend.py`)
- Flask analyzer → Lovable AI gateway: requests translation (evidence: `website_analyzer_backend.py`)
- Flask analyzer → LibreTranslate: fallback translation (evidence: `website_analyzer_backend.py`)
- Website analyzer → Browser speech: speaks results (evidence: `src/components/WebsiteAnalyzer.tsx`)
- Visitor → Edge website analyzer: submits URL (evidence: `supabase/functions/analyze-website/index.ts`)
- Edge website analyzer → Target website: fetches page (evidence: `supabase/functions/analyze-website/index.ts`)
- Edge website analyzer → Lovable AI gateway: requests analysis (evidence: `supabase/functions/analyze-website/index.ts`)
- Edge website analyzer → Lovable AI gateway: requests translation (evidence: `supabase/functions/analyze-website/index.ts`)
- Edge website analyzer → Visitor: returns results (evidence: `supabase/functions/analyze-website/index.ts`)
- Visitor → Vision and speech: submits image or text (evidence: `supabase/functions/vision-speak/index.ts`)
- Vision and speech → Lovable AI gateway: requests caption and translation (evidence: `supabase/functions/vision-speak/index.ts`)
- Vision and speech → LibreTranslate: fallback translation (evidence: `supabase/functions/vision-speak/index.ts`)
- Vision and speech → Visitor: returns result (evidence: `supabase/functions/vision-speak/index.ts`)
- Visitor → Image upload mock: uploads images (evidence: `Backend.py`)
- Image upload mock → Uploaded image: saves image (evidence: `Backend.py`)
