# navaismo/cacomixtlepad architecture

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

- Interactive diagram: https://gitdiagram.com/navaismo/cacomixtlepad
- Repository: https://github.com/navaismo/cacomixtlepad

## Overview

CacomixtlePad is a Flutter Android app for controlling a Marlin-based 3D printer, primarily over a phone’s USB-OTG serial connection. The user workflow spans printer status and motion controls, G-code selection and job control, printer preparation, and configuration. The README documents these capabilities and external upload clients; the available source excerpts do not show Flutter routing, serial commands, or upload-server implementation, so internal links beyond documented behavior are marked unverified or omitted.

Main entry points: [`lib/main.dart`](https://github.com/navaismo/cacomixtlepad/blob/main/lib/main.dart) (Flutter entry), [`lib/pages/prepare_page.dart`](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/prepare_page.dart) (Prepare controls), [`lib/services/usbConn_svc.dart`](https://github.com/navaismo/cacomixtlepad/blob/main/lib/services/usbConn_svc.dart) (USB serial connection), [`lib/pages/home_page.dart`](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/home_page.dart) (Printer dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app_entry["Flutter entry<br/>[main.dart]"]
  node_android_shell["Android shell<br/>[MainActivity.kt]"]
end

subgraph group_printer["Printer controls"]
  node_home["Printer dashboard<br/>[home_page.dart]"]
  node_temperature["Temperature service<br/>[temp_svc.dart]"]
  node_usb["USB serial connection<br/>[usbConn_svc.dart]"]
end

subgraph group_jobs["Print workflow"]
  node_print_files["G-code files<br/>[print_page.dart]"]
  node_print_job["Print job controls<br/>[print_job.dart]"]
  node_upload_api["File upload API<br/>[print_page.dart]"]
end

subgraph group_setup["Preparation and settings"]
  node_prepare["Prepare controls<br/>[prepare_page.dart]"]
  node_bed_level["Bed leveling<br/>[bed_level.dart]"]
  node_extrude["Extrude and retract"]
  node_material_values["Material presets"]
  node_settings["Printer settings<br/>[settings_page.dart]"]
end

node_user(("Phone user"))
node_printer_device["Marlin printer"]
node_upload_client(("Upload client"))

node_user -->|"uses"| node_app_entry
node_app_entry -.->|"runs in"| node_android_shell
node_app_entry -.->|"opens"| node_home
node_app_entry -.->|"opens"| node_print_files
node_app_entry -.->|"opens"| node_print_job
node_app_entry -.->|"opens"| node_prepare
node_app_entry -.->|"opens"| node_settings
node_home -.->|"controls"| node_temperature
node_home -.->|"controls"| node_usb
node_print_files -.->|"starts"| node_print_job
node_upload_client -->|"uploads G-code"| node_upload_api
node_print_job -.->|"controls printer"| node_usb
node_prepare -.->|"offers"| node_bed_level
node_prepare -.->|"offers"| node_extrude
node_prepare -.->|"controls"| node_usb
node_settings -.->|"edits presets"| node_material_values
node_usb -->|"communicates via OTG"| node_printer_device

click node_app_entry "https://github.com/navaismo/cacomixtlepad/blob/main/lib/main.dart"
click node_android_shell "https://github.com/navaismo/cacomixtlepad/blob/main/android/app/src/main/kotlin/com/shaka/cacomixtlepad/MainActivity.kt"
click node_home "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/home_page.dart"
click node_temperature "https://github.com/navaismo/cacomixtlepad/blob/main/lib/services/temp_svc.dart"
click node_usb "https://github.com/navaismo/cacomixtlepad/blob/main/lib/services/usbConn_svc.dart"
click node_print_files "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/print_page.dart"
click node_print_job "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/print_job.dart"
click node_upload_api "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/print_page.dart"
click node_prepare "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/prepare_page.dart"
click node_bed_level "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/bed_level.dart"
click node_extrude "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/extrude_retract.dart"
click node_material_values "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/material_values.dart"
click node_settings "https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/settings_page.dart"

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_app_entry,node_android_shell,node_user,node_upload_client toneBlue
class node_home,node_temperature,node_usb toneAmber
class node_print_files,node_print_job,node_upload_api toneMint
class node_prepare,node_bed_level,node_extrude,node_material_values,node_settings toneRose
class node_printer_device toneIndigo
```

## Components

### App and navigation

- [Flutter entry](https://github.com/navaismo/cacomixtlepad/blob/main/lib/main.dart): `lib/main.dart`
- [Android shell](https://github.com/navaismo/cacomixtlepad/blob/main/android/app/src/main/kotlin/com/shaka/cacomixtlepad/MainActivity.kt): `android/app/src/main/kotlin/com/shaka/cacomixtlepad/MainActivity.kt`

### Printer controls

- [Printer dashboard](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/home_page.dart): `lib/pages/home_page.dart`
- [Temperature service](https://github.com/navaismo/cacomixtlepad/blob/main/lib/services/temp_svc.dart): `lib/services/temp_svc.dart`
- [USB serial connection](https://github.com/navaismo/cacomixtlepad/blob/main/lib/services/usbConn_svc.dart): `lib/services/usbConn_svc.dart`

### Print workflow

- [G-code files](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/print_page.dart): `lib/pages/print_page.dart`
- [Print job controls](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/print_job.dart): `lib/pages/print_job.dart`
- [File upload API](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/print_page.dart): `lib/pages/print_page.dart`

### Preparation and settings

- [Prepare controls](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/prepare_page.dart): `lib/pages/prepare_page.dart`
- [Bed leveling](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/bed_level.dart): `lib/pages/bed_level.dart`
- [Extrude and retract](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/extrude_retract.dart): `lib/pages/extrude_retract.dart`
- [Material presets](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/material_values.dart): `lib/pages/material_values.dart`
- [Printer settings](https://github.com/navaismo/cacomixtlepad/blob/main/lib/pages/settings_page.dart): `lib/pages/settings_page.dart`

### Other components

- **Phone user**
- **Marlin printer**
- **Upload client**

## Connections

- Phone user → Flutter entry: uses (evidence: `README.md`)
- Flutter entry → Android shell: runs in
- Flutter entry → Printer dashboard: opens
- Flutter entry → G-code files: opens
- Flutter entry → Print job controls: opens
- Flutter entry → Prepare controls: opens
- Flutter entry → Printer settings: opens
- Printer dashboard → Temperature service: controls
- Printer dashboard → USB serial connection: controls
- G-code files → Print job controls: starts
- Upload client → File upload API: uploads G-code (evidence: `README.md`)
- Print job controls → USB serial connection: controls printer
- Prepare controls → Bed leveling: offers
- Prepare controls → Extrude and retract: offers
- Prepare controls → USB serial connection: controls
- Printer settings → Material presets: edits presets
- USB serial connection → Marlin printer: communicates via OTG (evidence: `README.md`)
