# robertnisipeanu/mgu-store architecture

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

- Interactive diagram: https://gitdiagram.com/robertnisipeanu/mgu-store
- Repository: https://github.com/robertnisipeanu/mgu-store

## Overview

mgu-store is an in-car app and tools store for BMW MGU head units. A driver browses source catalogs or USB offerings, chooses an install/update/remove action in the Store, and the updater resolves and downloads components before the deploy tool applies changes (and can roll them back). The wider product also installs privacy protection, a graphics renderer, Python build support, and internet uplink. The graph follows documented product capabilities; unsampled implementation paths are represented only at supported directories, and uncertain internal links are omitted.

Main entry points: [`deploy/unit/mgu-deploy.js`](https://github.com/robertnisipeanu/mgu-store/blob/main/deploy/unit/mgu-deploy.js) (Deploy and rollback), [`native/mgu-updater/js/updater.js`](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/updater.js) (Updater service), [`native/mgu-updater/js/sources.js`](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/sources.js) (Sources and catalogs), [`apps/robertn_store/src/store.js`](https://github.com/robertnisipeanu/mgu-store/blob/main/apps/robertn_store/src/store.js) (Store app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store["Store experience"]
  node_store_app["Store app<br/>[store.js]"]
  node_store_ui["Store screens<br/>[store_ui.js]"]
  node_updater_client["Updater client<br/>[client.js]"]
  node_phone_page["Phone access<br/>[web.js]"]
end

subgraph group_update["Catalog and updater"]
  node_source_catalog["Sources and catalogs<br/>[sources.js]"]
  node_catalog_rules["Catalog validation<br/>[catalog.js]"]
  node_updater["Updater service<br/>[updater.js]"]
  node_build_support["Source builds<br/>[build.js]"]
end

subgraph group_install["Head-unit installation"]
  node_installer["Computer installer<br/>[mgu-install.js]"]
  node_deploy_tool["Deploy and rollback<br/>[mgu-deploy.js]"]
  node_ssh_transport["SSH transport<br/>[mgu_connect.py]"]
end

subgraph group_runtime["Car runtime services"]
  node_privacy["App privacy<br/>[patch_mainapp.js]"]
  node_renderer["Graphics renderer<br/>[main.c]"]
  node_python["Python support<br/>[build.js]"]
  node_uplink["Internet uplink<br/>[main.go]"]
end

node_driver(("Driver"))
node_usb["USB stick"]
node_github["GitHub sources"]

node_driver -->|"browses and selects"| node_store_app
node_store_app -.->|"renders screens"| node_store_ui
node_store_app -.->|"sends actions"| node_updater_client
node_updater_client -->|"requests over socket"| node_updater
node_driver -->|"views remotely"| node_phone_page
node_usb -->|"offers packages"| node_source_catalog
node_github -->|"provides catalogs"| node_source_catalog
node_updater -->|"reads sources"| node_source_catalog
node_source_catalog -->|"validates entries"| node_catalog_rules
node_updater -->|"builds requested apps"| node_build_support
node_updater -->|"applies install changes"| node_deploy_tool
node_installer -->|"connects to head unit"| node_ssh_transport
node_installer -->|"installs product tools"| node_deploy_tool
node_deploy_tool -->|"installs component"| node_privacy
node_deploy_tool -->|"installs component"| node_renderer
node_deploy_tool -->|"installs component"| node_python
node_deploy_tool -->|"installs component"| node_uplink

click node_store_app "https://github.com/robertnisipeanu/mgu-store/blob/main/apps/robertn_store/src/store.js"
click node_store_ui "https://github.com/robertnisipeanu/mgu-store/blob/main/apps/robertn_store/src/store_ui.js"
click node_updater_client "https://github.com/robertnisipeanu/mgu-store/blob/main/apps/robertn_store/lib/client.js"
click node_phone_page "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/web.js"
click node_source_catalog "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/sources.js"
click node_catalog_rules "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/catalog.js"
click node_updater "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/updater.js"
click node_build_support "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/build.js"
click node_installer "https://github.com/robertnisipeanu/mgu-store/blob/main/deploy/mgu-install.js"
click node_deploy_tool "https://github.com/robertnisipeanu/mgu-store/blob/main/deploy/unit/mgu-deploy.js"
click node_ssh_transport "https://github.com/robertnisipeanu/mgu-store/blob/main/deploy/transport/mgu_connect.py"
click node_privacy "https://github.com/robertnisipeanu/mgu-store/blob/main/native/app-privacy/patch_mainapp.js"
click node_renderer "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-render/src/main.c"
click node_python "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-python/build.js"
click node_uplink "https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-uplink/main.go"

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_store_app,node_store_ui,node_updater_client,node_phone_page toneBlue
class node_source_catalog,node_catalog_rules,node_updater,node_build_support toneAmber
class node_installer,node_deploy_tool,node_ssh_transport toneMint
class node_privacy,node_renderer,node_python,node_uplink toneRose
class node_driver,node_usb,node_github toneIndigo
```

## Components

### Store experience

- [Store app](https://github.com/robertnisipeanu/mgu-store/blob/main/apps/robertn_store/src/store.js): `apps/robertn_store/src/store.js`
- [Store screens](https://github.com/robertnisipeanu/mgu-store/blob/main/apps/robertn_store/src/store_ui.js): `apps/robertn_store/src/store_ui.js`
- [Updater client](https://github.com/robertnisipeanu/mgu-store/blob/main/apps/robertn_store/lib/client.js): `apps/robertn_store/lib/client.js`
- [Phone access](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/web.js): `native/mgu-updater/js/web.js`

### Catalog and updater

- [Sources and catalogs](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/sources.js): `native/mgu-updater/js/sources.js`
- [Catalog validation](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/catalog.js): `native/mgu-updater/js/catalog.js`
- [Updater service](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/updater.js): `native/mgu-updater/js/updater.js`
- [Source builds](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-updater/js/build.js): `native/mgu-updater/js/build.js`

### Head-unit installation

- [Computer installer](https://github.com/robertnisipeanu/mgu-store/blob/main/deploy/mgu-install.js): `deploy/mgu-install.js`
- [Deploy and rollback](https://github.com/robertnisipeanu/mgu-store/blob/main/deploy/unit/mgu-deploy.js): `deploy/unit/mgu-deploy.js`
- [SSH transport](https://github.com/robertnisipeanu/mgu-store/blob/main/deploy/transport/mgu_connect.py): `deploy/transport/mgu_connect.py`

### Car runtime services

- [App privacy](https://github.com/robertnisipeanu/mgu-store/blob/main/native/app-privacy/patch_mainapp.js): `native/app-privacy/patch_mainapp.js`
- [Graphics renderer](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-render/src/main.c): `native/mgu-render/src/main.c`
- [Python support](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-python/build.js): `native/mgu-python/build.js`
- [Internet uplink](https://github.com/robertnisipeanu/mgu-store/blob/main/native/mgu-uplink/main.go): `native/mgu-uplink/main.go`

### Other components

- **Driver**
- **USB stick**
- **GitHub sources**

## Connections

- Driver → Store app: browses and selects (evidence: `README.md`)
- Store app → Store screens: renders screens
- Store app → Updater client: sends actions
- Updater client → Updater service: requests over socket
- Driver → Phone access: views remotely (evidence: `README.md`)
- USB stick → Sources and catalogs: offers packages (evidence: `README.md`)
- GitHub sources → Sources and catalogs: provides catalogs (evidence: `README.md`)
- Updater service → Sources and catalogs: reads sources (evidence: `native/mgu-updater/js/updater.js`)
- Sources and catalogs → Catalog validation: validates entries (evidence: `native/mgu-updater/js/sources.js`)
- Updater service → Source builds: builds requested apps (evidence: `native/mgu-updater/js/updater.js`)
- Updater service → Deploy and rollback: applies install changes (evidence: `README.md`)
- Computer installer → SSH transport: connects to head unit (evidence: `README.md`)
- Computer installer → Deploy and rollback: installs product tools (evidence: `README.md`)
- Deploy and rollback → App privacy: installs component (evidence: `README.md`)
- Deploy and rollback → Graphics renderer: installs component (evidence: `README.md`)
- Deploy and rollback → Python support: installs component (evidence: `README.md`)
- Deploy and rollback → Internet uplink: installs component (evidence: `README.md`)
