# ethank511/my-garmin-app architecture

> Architecture diagram of the GitHub repository ethank511/my-garmin-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ethank511/my-garmin-app
- Repository: https://github.com/ethank511/my-garmin-app

## Overview

1. **Repository purpose**
   - This is a **Garmin Connect IQ watch face app** written in **Monkey C**.
   - The architecture is centered on a small on-device application that renders a custom watch face, likely with weather-themed imagery.

2. **Core runtime boundary**
   - The main runtime code lives in `source/`.
   - `source/MyWatchFaceApp.mc` is the **application entry/lifecycle layer**.
   - `source/MyWatchFace.mc` is the **watch-face view/rendering layer** that draws the UI on the device.
   - This is a typical split in Connect IQ: app orchestration versus visual watch-face logic.

3. **UI and presentation assets**
   - `Assets/Backgrounds (Weather)/` contains background imagery used by the watch face.
   - `Assets/Icons/` contains icon assets, likely for weather conditions or status indicators.
   - These assets are presentation-only and are consumed indirectly through the resource system rather than referenced as loose files at runtime.

4. **Resource subsystem**
   - `resources/resources.xml` is the central resource manifest.
   - `resources/strings/strings.xml` contains localized or user-facing text.
   - `resources/drawables/` is the drawable resource bundle, bridging source code to image assets.
   - In Connect IQ, this resource layer is important because the generated resource IDs are what the Monkey C code uses at runtime.

5. **Generated resource code**
   - `build/gen/.../source/Rez.mcgen` is generated from the resource definitions.
   - This file is an internal build artifact that gives the source code typed access to compiled resources.
   - Architecturally, it sits between the asset catalog and the runtime code, but it should not be edited manually.

6. **Build and packaging pipeline**
   - `build.jungle` and `build.properties` define the Garmin build process.
   - The output `build/WeatherWatchFace.prg` is the packaged app artifact deployed to a watch or simulator.
   - The `build/` tree also contains intermediate compiled MIR artifacts and resource caches, showing a standard compile-and-package pipeline.

7. **Platform metadata and configuration**
   - `manifest.xml` defines app metadata, device compatibility, permissions/capabilities, and the app entry points used by Garmin tooling.
   - `projectInfo.xml` holds project-level configuration for the Connect IQ toolchain.
   - These files shape what devices the app can run on and how the build is assembled.

8. **Signing and distribution**
   - `developer_key.der` and `developer_key.pem` are signing credentials used to package or sideload the app.
   - `temp_key.pem` suggests a temporary or locally generated signing key used during development.
   - This is an important boundary because packaging is tied to device trust and deployment, not just compilation.

9. **Build outputs and internal artifacts**
   - `build/internal-mir/` and `build/external-mir/` contain compiled Monkey C intermediate artifacts.
   - These are not source of truth; they reflect the compiler’s internal output for the app and its resources.
   - `build/gen/resources/cache/` shows resource compilation caching, which supports faster incremental builds.

10. **Testing and automation**
   - `test.sh` likely wraps build or validation steps for local development.
   - Since there is no larger service/backend visible, the app’s primary “integration surface” is the Garmin build/deploy toolchain rather than external APIs.

11. **Likely data flow**
   - Assets and strings are declared in `resources/`.
   - The build system converts them into generated resource bindings.
   - `MyWatchFaceApp` initializes the app context and hands control to `MyWatchFace`.
   - `MyWatchFace` reads device state and resource IDs to render the final face on the watch.

12. **Architecture summary**
   - The repo is organized into a **source layer**, a **resource/asset layer**, and a **Connect IQ build/package layer**.
   - The main functional boundary is between **compiled watch-face logic** and **packaged visual resources**.
   - There is no evidence here of a separate backend, web service, or cloud synchronization system; the app appears self-contained on the Garmin device.

Main entry points: [`build/WeatherWatchFace.prg`](https://github.com/ethank511/my-garmin-app/blob/main/build/WeatherWatchFace.prg) (Packaged app), [`build/gen/006-B4625-00/source/Rez.mcgen`](https://github.com/ethank511/my-garmin-app/blob/main/build/gen/006-B4625-00/source/Rez.mcgen) (Rez bindings), [`resources/resources.xml`](https://github.com/ethank511/my-garmin-app/blob/main/resources/resources.xml) (Resource manifest), [`resources/drawables`](https://github.com/ethank511/my-garmin-app/tree/main/resources/drawables) (Drawables)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source"]
  node_app["App lifecycle<br/>Monkey C app<br/>[MyWatchFaceApp.mc]"]
  node_face["Watch face<br/>Monkey C view<br/>[MyWatchFace.mc]"]
end

subgraph group_resources["Resources"]
  node_resources_xml["Resource manifest<br/>[resources.xml]"]
  node_strings["Strings<br/>localized text<br/>[strings.xml]"]
  node_drawables["Drawables<br/>drawable bundle"]
  node_bg_assets[("Weather art<br/>image assets")]
  node_icon_assets[("Icons<br/>image assets")]
end

subgraph group_build["Build"]
  node_rez_gen["Rez bindings<br/>generated code<br/>[Rez.mcgen]"]
  node_resource_cache[("Resource cache<br/>build cache<br/>[ic7a8e8dd.mbc]")]
  node_internal_mir["Internal MIR<br/>compiled artifact<br/>[Rez.mir]"]
  node_app_mir["App MIR<br/>compiled artifact<br/>[MyWatchFaceApp.mir]"]
  node_face_mir["Face MIR<br/>compiled artifact<br/>[MyWatchFace.mir]"]
  node_prg["Packaged app<br/>deployable binary"]
  node_debug_xml["Debug map<br/>debug metadata"]
end

subgraph group_config["Config"]
  node_build_jungle["Build script<br/>toolchain config<br/>[build.jungle]"]
  node_build_props["Build props<br/>toolchain config<br/>[build.properties]"]
  node_manifest["Manifest<br/>app metadata<br/>[manifest.xml]"]
  node_project_info["Project info<br/>project config<br/>[projectInfo.xml]"]
  node_dev_key_der["Developer cert<br/>signing key<br/>[developer_key.der]"]
  node_dev_key_pem["Dev key<br/>signing key<br/>[developer_key.pem]"]
  node_temp_key["Temp key<br/>signing key<br/>[temp_key.pem]"]
  node_test_sh["Test script<br/>automation<br/>[test.sh]"]
end

node_resources_xml -->|"declares"| node_strings
node_resources_xml -->|"declares"| node_drawables
node_drawables -->|"packages"| node_bg_assets
node_drawables -->|"packages"| node_icon_assets
node_resources_xml -->|"generates"| node_rez_gen
node_strings -->|"binds"| node_rez_gen
node_drawables -->|"binds"| node_rez_gen
node_rez_gen -->|"used by"| node_app
node_rez_gen -->|"used by"| node_face
node_app -->|"creates"| node_face
node_build_jungle -->|"drives"| node_prg
node_build_props -->|"configures"| node_prg
node_manifest -->|"launches"| node_app
node_manifest -->|"launches"| node_face
node_project_info -->|"supports"| node_build_jungle
node_app -->|"compiles to"| node_app_mir
node_face -->|"compiles to"| node_face_mir
node_resources_xml -->|"compiles to"| node_internal_mir
node_app_mir -->|"packages into"| node_prg
node_face_mir -->|"packages into"| node_prg
node_internal_mir -->|"packages into"| node_prg
node_resource_cache -.->|"accelerates"| node_rez_gen
node_dev_key_der -->|"signs"| node_prg
node_dev_key_pem -->|"signs"| node_prg
node_temp_key -.->|"signs"| node_prg
node_test_sh -.->|"invokes"| node_build_jungle
node_debug_xml -.->|"describes"| node_prg

click node_app "https://github.com/ethank511/my-garmin-app/blob/main/source/MyWatchFaceApp.mc"
click node_face "https://github.com/ethank511/my-garmin-app/blob/main/source/MyWatchFace.mc"
click node_resources_xml "https://github.com/ethank511/my-garmin-app/blob/main/resources/resources.xml"
click node_strings "https://github.com/ethank511/my-garmin-app/blob/main/resources/strings/strings.xml"
click node_drawables "https://github.com/ethank511/my-garmin-app/tree/main/resources/drawables"
click node_bg_assets "https://github.com/ethank511/my-garmin-app/tree/main/Assets/Backgrounds (Weather)"
click node_icon_assets "https://github.com/ethank511/my-garmin-app/tree/main/Assets/Icons"
click node_rez_gen "https://github.com/ethank511/my-garmin-app/blob/main/build/gen/006-B4625-00/source/Rez.mcgen"
click node_resource_cache "https://github.com/ethank511/my-garmin-app/blob/main/build/gen/resources/cache/ic7a8e8dd.mbc"
click node_internal_mir "https://github.com/ethank511/my-garmin-app/blob/main/build/internal-mir/Rez.mir"
click node_app_mir "https://github.com/ethank511/my-garmin-app/blob/main/build/external-mir/home/speedye/my-garmin-app/source/MyWatchFaceApp.mir"
click node_face_mir "https://github.com/ethank511/my-garmin-app/blob/main/build/external-mir/home/speedye/my-garmin-app/source/MyWatchFace.mir"
click node_prg "https://github.com/ethank511/my-garmin-app/blob/main/build/WeatherWatchFace.prg"
click node_debug_xml "https://github.com/ethank511/my-garmin-app/blob/main/build/WeatherWatchFace.prg.debug.xml"
click node_build_jungle "https://github.com/ethank511/my-garmin-app/blob/main/build.jungle"
click node_build_props "https://github.com/ethank511/my-garmin-app/blob/main/build.properties"
click node_manifest "https://github.com/ethank511/my-garmin-app/blob/main/manifest.xml"
click node_project_info "https://github.com/ethank511/my-garmin-app/blob/main/projectInfo.xml"
click node_dev_key_der "https://github.com/ethank511/my-garmin-app/blob/main/developer_key.der"
click node_dev_key_pem "https://github.com/ethank511/my-garmin-app/blob/main/developer_key.pem"
click node_temp_key "https://github.com/ethank511/my-garmin-app/blob/main/temp_key.pem"
click node_test_sh "https://github.com/ethank511/my-garmin-app/blob/main/test.sh"

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,node_face toneBlue
class node_resources_xml,node_strings,node_drawables,node_bg_assets,node_icon_assets toneAmber
class node_rez_gen,node_resource_cache,node_internal_mir,node_app_mir,node_face_mir,node_prg,node_debug_xml toneMint
class node_build_jungle,node_build_props,node_manifest,node_project_info,node_dev_key_der,node_dev_key_pem,node_temp_key,node_test_sh toneRose
```

## Components

### Source

Runtime Monkey C watch-face code

- [App lifecycle](https://github.com/ethank511/my-garmin-app/blob/main/source/MyWatchFaceApp.mc): Monkey C app · Application entry and lifecycle orchestration · `source/MyWatchFaceApp.mc`
- [Watch face](https://github.com/ethank511/my-garmin-app/blob/main/source/MyWatchFace.mc): Monkey C view · Main rendering and device UI logic · `source/MyWatchFace.mc`

### Resources

Strings, drawables, and asset catalogs

- [Resource manifest](https://github.com/ethank511/my-garmin-app/blob/main/resources/resources.xml): resource manifest · Central resource declaration file · `resources/resources.xml`
- [Strings](https://github.com/ethank511/my-garmin-app/blob/main/resources/strings/strings.xml): localized text · User-facing and localized text resources · `resources/strings/strings.xml`
- [Drawables](https://github.com/ethank511/my-garmin-app/tree/main/resources/drawables): drawable bundle · Drawable resource layer bridging code to images · `resources/drawables`
- [Weather art](https://github.com/ethank511/my-garmin-app/tree/HEAD/Assets/Backgrounds%20(Weather)): image assets · Background imagery for the watch face · `Assets/Backgrounds (Weather)`
- [Icons](https://github.com/ethank511/my-garmin-app/tree/main/Assets/Icons): image assets · Iconography for conditions and indicators · `Assets/Icons`

### Build

Generated artifacts and packaging pipeline

- [Rez bindings](https://github.com/ethank511/my-garmin-app/blob/main/build/gen/006-B4625-00/source/Rez.mcgen): generated code · Generated typed resource access layer · `build/gen/006-B4625-00/source/Rez.mcgen`
- [Resource cache](https://github.com/ethank511/my-garmin-app/blob/main/build/gen/resources/cache/ic7a8e8dd.mbc): build cache · Incremental resource compilation cache · `build/gen/resources/cache/ic7a8e8dd.mbc`
- [Internal MIR](https://github.com/ethank511/my-garmin-app/blob/main/build/internal-mir/Rez.mir): compiled artifact · Compiler intermediate output for resources · `build/internal-mir/Rez.mir`
- [App MIR](https://github.com/ethank511/my-garmin-app/blob/main/build/external-mir/home/speedye/my-garmin-app/source/MyWatchFaceApp.mir): compiled artifact · Compiled Monkey C intermediate for app code · `build/external-mir/home/speedye/my-garmin-app/source/MyWatchFaceApp.mir`
- [Face MIR](https://github.com/ethank511/my-garmin-app/blob/main/build/external-mir/home/speedye/my-garmin-app/source/MyWatchFace.mir): compiled artifact · Compiled Monkey C intermediate for watch-face code · `build/external-mir/home/speedye/my-garmin-app/source/MyWatchFace.mir`
- [Packaged app](https://github.com/ethank511/my-garmin-app/blob/main/build/WeatherWatchFace.prg): deployable binary · Final Garmin application package · `build/WeatherWatchFace.prg`
- [Debug map](https://github.com/ethank511/my-garmin-app/blob/main/build/WeatherWatchFace.prg.debug.xml): debug metadata · Debug metadata for the packaged app · `build/WeatherWatchFace.prg.debug.xml`

### Config

Tooling metadata and signing inputs

- [Build script](https://github.com/ethank511/my-garmin-app/blob/main/build.jungle): toolchain config · Garmin build definition · `build.jungle`
- [Build props](https://github.com/ethank511/my-garmin-app/blob/main/build.properties): toolchain config · Build properties and packaging settings · `build.properties`
- [Manifest](https://github.com/ethank511/my-garmin-app/blob/main/manifest.xml): app metadata · App entry points, permissions, and device compatibility · `manifest.xml`
- [Project info](https://github.com/ethank511/my-garmin-app/blob/main/projectInfo.xml): project config · Connect IQ project-level configuration · `projectInfo.xml`
- [Developer cert](https://github.com/ethank511/my-garmin-app/blob/main/developer_key.der): signing key · Signing credential used for packaging · `developer_key.der`
- [Dev key](https://github.com/ethank511/my-garmin-app/blob/main/developer_key.pem): signing key · Developer private key for signing · `developer_key.pem`
- [Temp key](https://github.com/ethank511/my-garmin-app/blob/main/temp_key.pem): signing key · Temporary local signing key · `temp_key.pem`
- [Test script](https://github.com/ethank511/my-garmin-app/blob/main/test.sh): automation · Local build or validation wrapper · `test.sh`

## Connections

- Resource manifest → Strings: declares · Resource manifest includes string resources
- Resource manifest → Drawables: declares · Resource manifest includes drawable resources
- Drawables → Weather art: packages · Drawable layer packages background artwork
- Drawables → Icons: packages · Drawable layer packages icon artwork
- Resource manifest → Rez bindings: generates · Resource definitions generate typed bindings
- Strings → Rez bindings: binds · Strings are exposed through generated resource code
- Drawables → Rez bindings: binds · Drawables are exposed through generated resource code
- Rez bindings → App lifecycle: used by · App lifecycle code accesses generated resources
- Rez bindings → Watch face: used by · Watch-face rendering code accesses generated resources
- App lifecycle → Watch face: creates · Application hands off to the watch-face view
- Build script → Packaged app: drives · Build definition packages the final app
- Build props → Packaged app: configures · Build properties shape packaging output
- Manifest → App lifecycle: launches · Manifest defines app entry and runtime behavior
- Manifest → Watch face: launches · Manifest wires in the watch-face component
- Project info → Build script: supports · Project configuration supports the build toolchain
- App lifecycle → App MIR: compiles to · App source compiles into MIR
- Watch face → Face MIR: compiles to · Watch-face source compiles into MIR
- Resource manifest → Internal MIR: compiles to · Resource layer produces internal MIR artifact
- App MIR → Packaged app: packages into · Compiled app code is packaged into the PRG
- Face MIR → Packaged app: packages into · Compiled watch-face code is packaged into the PRG
- Internal MIR → Packaged app: packages into · Compiled resource artifact is packaged into the PRG
- Resource cache → Rez bindings: accelerates · Cache supports incremental resource generation
- Developer cert → Packaged app: signs · Signing credential used in package creation
- Dev key → Packaged app: signs · Private key used in package creation
- Temp key → Packaged app: signs · Temporary signing key used during development
- Test script → Build script: invokes · Test script likely wraps the Garmin build process
- Debug map → Packaged app: describes · Debug metadata corresponds to the packaged binary
