# kcy0428/c40 architecture

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

- Interactive diagram: https://gitdiagram.com/kcy0428/c40
- Repository: https://github.com/kcy0428/c40

## Overview

This repository is an investigation and design project for a one-click floor-change workflow on a Keenon C40 cleaning robot; it does not contain the planned app implementation. The README describes the intended sequence: select a floor, switch maps, set a position, confirm localization, and start cleaning. Research documents and extracted API, configuration, and database references inform that design. The only sampled runtime code is a WebView-to-native JavaScript bridge. The workflow links below reflect the README’s documented sequence, not verified implementation calls; unsampled internals are represented only where the README identifies them.

Main entry points: [`docs/01_robot_investigation.md`](https://github.com/kcy0428/c40/blob/main/docs/01_robot_investigation.md) (Robot investigation), [`docs/03_app_design.md`](https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md) (Floor selection), [`docs/02_clean_app_internals.md`](https://github.com/kcy0428/c40/blob/main/docs/02_clean_app_internals.md) (Cleaning app internals), [`reference/api/WebViewJavascriptBridge.js`](https://github.com/kcy0428/c40/blob/main/reference/api/WebViewJavascriptBridge.js) (WebView bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Planned workflow"]
  node_floor["Floor selection<br/>[03_app_design.md]"]
  node_map["Map switching<br/>[03_app_design.md]"]
  node_position["Position setting<br/>[03_app_design.md]"]
  node_localization["Localization check<br/>[03_app_design.md]"]
  node_cleaning["Cleaning start<br/>[03_app_design.md]"]
end

subgraph group_research["Robot research"]
  node_investigation["Robot investigation"]
  node_internals["Cleaning app internals"]
  node_api_refs["API references"]
  node_data_refs[("Map and pose data")]
end

subgraph group_interface["App interface"]
  node_bridge["WebView bridge"]
end

node_operator(("Operator"))
node_native["Android app interface"]

node_operator -->|"selects"| node_floor
node_floor -->|"then switches"| node_map
node_map -->|"then sets"| node_position
node_position -->|"then confirms"| node_localization
node_localization -->|"then starts"| node_cleaning
node_investigation -.->|"informs"| node_internals
node_internals -.->|"documents interfaces"| node_api_refs
node_investigation -.->|"documents robot data"| node_data_refs
node_bridge -->|"calls handlers"| node_native

click node_floor "https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md"
click node_map "https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md"
click node_position "https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md"
click node_localization "https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md"
click node_cleaning "https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md"
click node_investigation "https://github.com/kcy0428/c40/blob/main/docs/01_robot_investigation.md"
click node_internals "https://github.com/kcy0428/c40/blob/main/docs/02_clean_app_internals.md"
click node_api_refs "https://github.com/kcy0428/c40/tree/main/reference/api"
click node_data_refs "https://github.com/kcy0428/c40/tree/main/reference/db"
click node_bridge "https://github.com/kcy0428/c40/blob/main/reference/api/WebViewJavascriptBridge.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_floor,node_map,node_position,node_localization,node_cleaning toneBlue
class node_investigation,node_internals,node_api_refs,node_data_refs toneAmber
class node_bridge toneMint
class node_operator,node_native toneIndigo
```

## Components

### Planned workflow

- [Floor selection](https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md): `docs/03_app_design.md`
- [Map switching](https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md): `docs/03_app_design.md`
- [Position setting](https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md): `docs/03_app_design.md`
- [Localization check](https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md): `docs/03_app_design.md`
- [Cleaning start](https://github.com/kcy0428/c40/blob/main/docs/03_app_design.md): `docs/03_app_design.md`

### Robot research

- [Robot investigation](https://github.com/kcy0428/c40/blob/main/docs/01_robot_investigation.md): `docs/01_robot_investigation.md`
- [Cleaning app internals](https://github.com/kcy0428/c40/blob/main/docs/02_clean_app_internals.md): `docs/02_clean_app_internals.md`
- [API references](https://github.com/kcy0428/c40/tree/main/reference/api): `reference/api`
- [Map and pose data](https://github.com/kcy0428/c40/tree/main/reference/db): `reference/db`

### App interface

- [WebView bridge](https://github.com/kcy0428/c40/blob/main/reference/api/WebViewJavascriptBridge.js): `reference/api/WebViewJavascriptBridge.js`

### Other components

- **Operator**
- **Android app interface**

## Connections

- Operator → Floor selection: selects (evidence: `README.md`)
- Floor selection → Map switching: then switches (evidence: `README.md`)
- Map switching → Position setting: then sets (evidence: `README.md`)
- Position setting → Localization check: then confirms (evidence: `README.md`)
- Localization check → Cleaning start: then starts (evidence: `README.md`)
- Robot investigation → Cleaning app internals: informs (evidence: `README.md`)
- Cleaning app internals → API references: documents interfaces (evidence: `README.md`)
- Robot investigation → Map and pose data: documents robot data (evidence: `README.md`)
- WebView bridge → Android app interface: calls handlers (evidence: `reference/api/WebViewJavascriptBridge.js`)
