# thu03092004/rpa_lucidchart architecture

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

- Interactive diagram: https://gitdiagram.com/thu03092004/rpa_lucidchart
- Repository: https://github.com/thu03092004/rpa_lucidchart

## Overview

This repository appears to support natural-language-driven browser automation: instructions are parsed into actions, elements can be located through text or image-based methods, and Selenium actions are executed or emitted as Java. Visual utilities also detect shapes and compare screenshots. The excerpts establish the parser, generator, browser/image routines, and canvas dispatcher, but do not show enough wiring to assert how every locator or visual subsystem is called; those links are omitted where uncertain.

Main entry points: [`generator.py`](https://github.com/thu03092004/rpa_lucidchart/blob/main/generator.py) (Action generator), [`find_element.py`](https://github.com/thu03092004/rpa_lucidchart/blob/main/find_element.py) (Element locator), [`by_image.py`](https://github.com/thu03092004/rpa_lucidchart/blob/main/by_image.py) (Image locator), [`step_parser.py`](https://github.com/thu03092004/rpa_lucidchart/blob/main/step_parser.py) (Step parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_instruction["Instruction and execution"]
  node_parser["Step parser<br/>[step_parser.py]"]
  node_generator["Action generator<br/>[generator.py]"]
  node_java["Generated Java<br/>[GeneratedTest.java]"]
end

subgraph group_locators["Element location"]
  node_find["Element locator<br/>[find_element.py]"]
  node_text["Text locator<br/>[by_text.py]"]
  node_image["Image locator<br/>[by_image.py]"]
  node_imagehelper["Image helpers<br/>[by_image_helper.py]"]
end

subgraph group_vision["Visual analysis"]
  node_shapecheck["Canvas shape dispatcher<br/>[check_canvas.py]"]
  node_canvas["Canvas detectors"]
  node_element["Element detectors"]
  node_diff["Screenshot differ<br/>[diff_ui.py]"]
  node_detectout[("Detection outputs")]
end

subgraph group_browser["Browser interaction"]
  node_browser["Chrome browser"]
  node_screenshots[("Screenshot files")]
end

node_user(("Automation user"))
node_external(("Web page"))

node_user -->|"provides steps"| node_parser
node_parser -->|"parsed steps"| node_generator
node_generator -->|"locates elements"| node_find
node_generator -->|"executes actions"| node_browser
node_generator -->|"emits Java"| node_java
node_find -->|"delegates lookup"| node_text
node_find -->|"delegates lookup"| node_image
node_text -->|"reads page DOM"| node_browser
node_image -->|"captures screenshots"| node_browser
node_image -->|"uses helpers"| node_imagehelper
node_browser -->|"opens page"| node_external
node_browser -->|"saves captures"| node_screenshots
node_shapecheck -->|"dispatches detection"| node_canvas
node_canvas -->|"writes annotated images"| node_detectout
node_diff -->|"writes difference mask"| node_detectout
node_screenshots -->|"compares images"| node_diff

click node_parser "https://github.com/thu03092004/rpa_lucidchart/blob/main/step_parser.py"
click node_generator "https://github.com/thu03092004/rpa_lucidchart/blob/main/generator.py"
click node_java "https://github.com/thu03092004/rpa_lucidchart/blob/main/GeneratedTest.java"
click node_find "https://github.com/thu03092004/rpa_lucidchart/blob/main/find_element.py"
click node_text "https://github.com/thu03092004/rpa_lucidchart/blob/main/by_text.py"
click node_image "https://github.com/thu03092004/rpa_lucidchart/blob/main/by_image.py"
click node_imagehelper "https://github.com/thu03092004/rpa_lucidchart/blob/main/by_image_helper.py"
click node_screenshots "https://github.com/thu03092004/rpa_lucidchart/tree/main/screenshots"
click node_shapecheck "https://github.com/thu03092004/rpa_lucidchart/blob/main/detect_shapes/canvas/check_canvas.py"
click node_canvas "https://github.com/thu03092004/rpa_lucidchart/tree/main/detect_shapes/canvas"
click node_element "https://github.com/thu03092004/rpa_lucidchart/tree/main/detect_shapes/element"
click node_diff "https://github.com/thu03092004/rpa_lucidchart/blob/main/detect_shapes/diff_ui.py"
click node_detectout "https://github.com/thu03092004/rpa_lucidchart/tree/main/detect_img"

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_parser,node_generator,node_java,node_user toneBlue
class node_find,node_text,node_image,node_imagehelper toneAmber
class node_shapecheck,node_canvas,node_element,node_diff,node_detectout toneMint
class node_browser,node_screenshots toneRose
class node_external toneIndigo
```

## Components

### Instruction and execution

- [Step parser](https://github.com/thu03092004/rpa_lucidchart/blob/main/step_parser.py): `step_parser.py`
- [Action generator](https://github.com/thu03092004/rpa_lucidchart/blob/main/generator.py): `generator.py`
- [Generated Java](https://github.com/thu03092004/rpa_lucidchart/blob/main/GeneratedTest.java): `GeneratedTest.java`

### Element location

- [Element locator](https://github.com/thu03092004/rpa_lucidchart/blob/main/find_element.py): `find_element.py`
- [Text locator](https://github.com/thu03092004/rpa_lucidchart/blob/main/by_text.py): `by_text.py`
- [Image locator](https://github.com/thu03092004/rpa_lucidchart/blob/main/by_image.py): `by_image.py`
- [Image helpers](https://github.com/thu03092004/rpa_lucidchart/blob/main/by_image_helper.py): `by_image_helper.py`

### Visual analysis

- [Canvas shape dispatcher](https://github.com/thu03092004/rpa_lucidchart/blob/main/detect_shapes/canvas/check_canvas.py): `detect_shapes/canvas/check_canvas.py`
- [Canvas detectors](https://github.com/thu03092004/rpa_lucidchart/tree/main/detect_shapes/canvas): `detect_shapes/canvas`
- [Element detectors](https://github.com/thu03092004/rpa_lucidchart/tree/main/detect_shapes/element): `detect_shapes/element`
- [Screenshot differ](https://github.com/thu03092004/rpa_lucidchart/blob/main/detect_shapes/diff_ui.py): `detect_shapes/diff_ui.py`
- [Detection outputs](https://github.com/thu03092004/rpa_lucidchart/tree/main/detect_img): `detect_img`

### Browser interaction

- **Chrome browser**
- [Screenshot files](https://github.com/thu03092004/rpa_lucidchart/tree/main/screenshots): `screenshots`

### Other components

- **Automation user**
- **Web page**

## Connections

- Automation user → Step parser: provides steps
- Step parser → Action generator: parsed steps
- Action generator → Element locator: locates elements
- Action generator → Chrome browser: executes actions
- Action generator → Generated Java: emits Java
- Element locator → Text locator: delegates lookup
- Element locator → Image locator: delegates lookup
- Text locator → Chrome browser: reads page DOM
- Image locator → Chrome browser: captures screenshots
- Image locator → Image helpers: uses helpers
- Chrome browser → Web page: opens page
- Chrome browser → Screenshot files: saves captures
- Canvas shape dispatcher → Canvas detectors: dispatches detection
- Canvas detectors → Detection outputs: writes annotated images
- Screenshot differ → Detection outputs: writes difference mask
- Screenshot files → Screenshot differ: compares images
