# kennethkaungsatt/baanright-mfu-housing-demo- architecture

> Architecture diagram of the GitHub repository kennethkaungsatt/baanright-mfu-housing-demo-, 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/kennethkaungsatt/baanright-mfu-housing-demo-
- Repository: https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-

## Overview

Baan Buddy is a Chrome extension for translating Thai rental listings and helping students assess and follow up on them. Users can send highlighted text from a page to the popup, where it is translated and analyzed; they can then save listings, manage search alerts, or generate Thai replies. The graph reflects the shown selection relay, popup storage operations, and translation call. Other popup capabilities are represented from the excerpt, but unsampled implementation details and UI wiring are not inferred.

Main entry points: [`popup.js`](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js) (Extension popup), [`background.js`](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/background.js) (Background relay), [`content.js`](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/content.js) (Page selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Text capture"]
  node_page_selection["Page selection<br/>[content.js]"]
  node_background["Background relay<br/>[background.js]"]
end

subgraph group_listing["Listing workflow"]
  node_popup["Extension popup<br/>[popup.js]"]
  node_listing_analysis["Listing analysis<br/>[popup.js]"]
end

subgraph group_followup["Follow-up tools"]
  node_saved_listings["Saved listings<br/>[popup.js]"]
  node_search_alerts["Search alerts<br/>[popup.js]"]
  node_thai_replies["Thai replies<br/>[popup.js]"]
  node_local_storage[("Local storage")]
end

node_student(("Student"))
node_translation_api["MyMemory API"]

node_student -->|"selects text"| node_page_selection
node_page_selection -->|"sends selection"| node_background
node_student -->|"uses context menu"| node_background
node_background -->|"writes pending text"| node_local_storage
node_background -->|"opens popup"| node_popup
node_popup -->|"reads pending text"| node_local_storage
node_student -.->|"enters listing"| node_popup
node_popup -->|"runs analysis"| node_listing_analysis
node_listing_analysis -->|"requests translation"| node_translation_api
node_popup -->|"saves listing"| node_local_storage
node_popup -->|"manages alerts"| node_local_storage
node_popup -.->|"generates replies"| node_thai_replies

click node_page_selection "https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/content.js"
click node_background "https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/background.js"
click node_popup "https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js"
click node_listing_analysis "https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js"
click node_saved_listings "https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js"
click node_search_alerts "https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js"
click node_thai_replies "https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/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_page_selection,node_background toneBlue
class node_popup,node_listing_analysis toneAmber
class node_saved_listings,node_search_alerts,node_thai_replies,node_local_storage,node_translation_api toneMint
class node_student toneIndigo
```

## Components

### Text capture

- [Page selection](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/content.js): `content.js`
- [Background relay](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/background.js): `background.js`

### Listing workflow

- [Extension popup](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js): `popup.js`
- [Listing analysis](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js): `popup.js`

### Follow-up tools

- [Saved listings](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js): `popup.js`
- [Search alerts](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js): `popup.js`
- [Thai replies](https://github.com/kennethkaungsatt/baanright-mfu-housing-demo-/blob/main/popup.js): `popup.js`
- **Local storage**

### Other components

- **Student**
- **MyMemory API**

## Connections

- Student → Page selection: selects text (evidence: `content.js`)
- Page selection → Background relay: sends selection (evidence: `content.js`)
- Student → Background relay: uses context menu (evidence: `background.js`)
- Background relay → Local storage: writes pending text (evidence: `background.js`)
- Background relay → Extension popup: opens popup (evidence: `background.js`)
- Extension popup → Local storage: reads pending text (evidence: `popup.js`)
- Student → Extension popup: enters listing
- Extension popup → Listing analysis: runs analysis (evidence: `popup.js`)
- Listing analysis → MyMemory API: requests translation (evidence: `popup.js`)
- Extension popup → Local storage: saves listing (evidence: `popup.js`)
- Extension popup → Local storage: manages alerts (evidence: `popup.js`)
- Extension popup → Thai replies: generates replies (evidence: `popup.js`)
