# mun2ddd/image-baanright architecture

> Architecture diagram of the GitHub repository mun2ddd/image-baanright, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mun2ddd/image-baanright
- Repository: https://github.com/mun2ddd/image-baanright

## Overview

image-BaanRight is a browser-extension popup for translating and extracting details from Thai property listings, with tools for saving listings, setting search alerts, and composing Thai replies. The main workflow takes listing text, translates it, extracts useful details, and presents a result that can be saved. The sampled code is concentrated in popup.js; relationships to the translation service are not included because the excerpts do not show the request.

Main entry points: [`popup.js`](https://github.com/mun2ddd/image-baanright/blob/main/popup.js) (Popup interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_listing["Listing workflow"]
  node_translate["Translation<br/>[popup.js]"]
  node_extract["Listing extraction<br/>[popup.js]"]
  node_image["Image handling<br/>[popup.js]"]
end

subgraph group_tools["Listing tools"]
  node_saved["Saved listings<br/>[popup.js]"]
  node_alerts["Search alerts<br/>[popup.js]"]
  node_replies["Thai replies<br/>[popup.js]"]
  node_storage[("Extension storage")]
end

subgraph group_interface["Popup interface"]
  node_popup["Popup interactions<br/>[popup.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_popup
node_popup -->|"runs extraction"| node_extract
node_extract -->|"translates text"| node_translate
node_popup -->|"selects image"| node_image
node_popup -->|"saves listing"| node_saved
node_saved -->|"reads and writes"| node_storage
node_popup -->|"manages alerts"| node_alerts
node_alerts -->|"reads and writes"| node_storage
node_popup -->|"generates reply"| node_replies

click node_popup "https://github.com/mun2ddd/image-baanright/blob/main/popup.js"
click node_translate "https://github.com/mun2ddd/image-baanright/blob/main/popup.js"
click node_extract "https://github.com/mun2ddd/image-baanright/blob/main/popup.js"
click node_image "https://github.com/mun2ddd/image-baanright/blob/main/popup.js"
click node_saved "https://github.com/mun2ddd/image-baanright/blob/main/popup.js"
click node_alerts "https://github.com/mun2ddd/image-baanright/blob/main/popup.js"
click node_replies "https://github.com/mun2ddd/image-baanright/blob/main/popup.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_translate,node_extract,node_image,node_user toneBlue
class node_saved,node_alerts,node_replies,node_storage toneAmber
class node_popup toneMint
```

## Components

### Listing workflow

- [Translation](https://github.com/mun2ddd/image-baanright/blob/main/popup.js): `popup.js`
- [Listing extraction](https://github.com/mun2ddd/image-baanright/blob/main/popup.js): `popup.js`
- [Image handling](https://github.com/mun2ddd/image-baanright/blob/main/popup.js): `popup.js`

### Listing tools

- [Saved listings](https://github.com/mun2ddd/image-baanright/blob/main/popup.js): `popup.js`
- [Search alerts](https://github.com/mun2ddd/image-baanright/blob/main/popup.js): `popup.js`
- [Thai replies](https://github.com/mun2ddd/image-baanright/blob/main/popup.js): `popup.js`
- **Extension storage**

### Popup interface

- [Popup interactions](https://github.com/mun2ddd/image-baanright/blob/main/popup.js): `popup.js`

### Other components

- **User**

## Connections

- User → Popup interactions: uses (evidence: `popup.js`)
- Popup interactions → Listing extraction: runs extraction (evidence: `popup.js`)
- Listing extraction → Translation: translates text (evidence: `popup.js`)
- Popup interactions → Image handling: selects image (evidence: `popup.js`)
- Popup interactions → Saved listings: saves listing (evidence: `popup.js`)
- Saved listings → Extension storage: reads and writes (evidence: `popup.js`)
- Popup interactions → Search alerts: manages alerts (evidence: `popup.js`)
- Search alerts → Extension storage: reads and writes (evidence: `popup.js`)
- Popup interactions → Thai replies: generates reply (evidence: `popup.js`)
