# mickekofi/rafikios architecture

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

- Interactive diagram: https://gitdiagram.com/mickekofi/rafikios
- Repository: https://github.com/mickekofi/rafikios

## Overview

RafikiOS is a Flutter smart-home control app intended to make electrical appliances controllable through an Arduino and HC-05 Bluetooth link. The documented flow is user interaction in the app, telemetry to the Arduino, and relay-driven appliance control; the README also describes diagnostic LED slots and the motor actuator. Dart implementation files are present but not excerpted, so app internals and its concrete Bluetooth behavior cannot be verified. The sampled native files show desktop launch and window hosting only, not product logic.

Main entry points: [`RafikiOS/windows/runner/main.cpp`](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/main.cpp) (Windows entry), [`RafikiOS/lib`](https://github.com/mickekofi/rafikios/tree/master/RafikiOS/lib) (Flutter app), [`RafikiOS/windows/runner/flutter_window.h`](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/flutter_window.h) (Flutter window), [`RafikiOS/linux/runner/main.cc`](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/linux/runner/main.cc) (Linux entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Flutter app"]
  node_flutter_app["Flutter app"]
  node_app_service["Bugo service<br/>[bugo_service.dart]"]
  node_app_ui["Bugo UI<br/>[bugo_ui.dart]"]
end

subgraph group_control["Device control"]
  node_arduino{{"Arduino controller"}}
  node_bluetooth["HC-05 Bluetooth"]
  node_led_slots["Diagnostic LED slots"]
  node_relay["Relay module"]
  node_motor["Motor load"]
end

subgraph group_platform["Desktop hosting"]
  node_windows_entry["Windows entry<br/>[main.cpp]"]
  node_flutter_window["Flutter window<br/>[flutter_window.h]"]
  node_win32_window["Win32 window<br/>[win32_window.h]"]
  node_windows_utils["Windows utilities<br/>[utils.h]"]
  node_linux_entry["Linux entry<br/>[main.cc]"]
  node_linux_app["Linux application<br/>[my_application.h]"]
end

node_user(("User"))

node_user -->|"uses"| node_flutter_app
node_flutter_app -.->|"sends telemetry"| node_bluetooth
node_bluetooth -->|"transmits telemetry"| node_arduino
node_arduino -->|"drives diagnostics"| node_led_slots
node_arduino -->|"controls relay"| node_relay
node_relay -->|"switches load"| node_motor
node_windows_entry -->|"creates"| node_flutter_window
node_windows_entry -->|"gets arguments"| node_windows_utils
node_flutter_window -->|"extends"| node_win32_window
node_linux_entry -->|"creates and runs"| node_linux_app

click node_flutter_app "https://github.com/mickekofi/rafikios/tree/master/RafikiOS/lib"
click node_app_service "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/lib/bugo_service.dart"
click node_app_ui "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/lib/bugo_ui.dart"
click node_windows_entry "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/main.cpp"
click node_flutter_window "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/flutter_window.h"
click node_win32_window "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/win32_window.h"
click node_windows_utils "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/utils.h"
click node_linux_entry "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/linux/runner/main.cc"
click node_linux_app "https://github.com/mickekofi/rafikios/blob/master/RafikiOS/linux/runner/my_application.h"

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_flutter_app,node_app_service,node_app_ui,node_user toneBlue
class node_arduino,node_bluetooth,node_led_slots,node_relay,node_motor toneAmber
class node_windows_entry,node_flutter_window,node_win32_window,node_windows_utils,node_linux_entry,node_linux_app toneMint
```

## Components

### Flutter app

- [Flutter app](https://github.com/mickekofi/rafikios/tree/master/RafikiOS/lib): `RafikiOS/lib`
- [Bugo service](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/lib/bugo_service.dart): `RafikiOS/lib/bugo_service.dart`
- [Bugo UI](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/lib/bugo_ui.dart): `RafikiOS/lib/bugo_ui.dart`

### Device control

- **Arduino controller**
- **HC-05 Bluetooth**
- **Diagnostic LED slots**
- **Relay module**
- **Motor load**

### Desktop hosting

- [Windows entry](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/main.cpp): `RafikiOS/windows/runner/main.cpp`
- [Flutter window](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/flutter_window.h): `RafikiOS/windows/runner/flutter_window.h`
- [Win32 window](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/win32_window.h): `RafikiOS/windows/runner/win32_window.h`
- [Windows utilities](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/windows/runner/utils.h): `RafikiOS/windows/runner/utils.h`
- [Linux entry](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/linux/runner/main.cc): `RafikiOS/linux/runner/main.cc`
- [Linux application](https://github.com/mickekofi/rafikios/blob/master/RafikiOS/linux/runner/my_application.h): `RafikiOS/linux/runner/my_application.h`

### Other components

- **User**

## Connections

- User → Flutter app: uses (evidence: `README.md`)
- Flutter app → HC-05 Bluetooth: sends telemetry (evidence: `README.md`)
- HC-05 Bluetooth → Arduino controller: transmits telemetry (evidence: `README.md`)
- Arduino controller → Diagnostic LED slots: drives diagnostics (evidence: `README.md`)
- Arduino controller → Relay module: controls relay (evidence: `README.md`)
- Relay module → Motor load: switches load (evidence: `README.md`)
- Windows entry → Flutter window: creates (evidence: `RafikiOS/windows/runner/main.cpp`)
- Windows entry → Windows utilities: gets arguments (evidence: `RafikiOS/windows/runner/main.cpp`)
- Flutter window → Win32 window: extends (evidence: `RafikiOS/windows/runner/flutter_window.h`)
- Linux entry → Linux application: creates and runs (evidence: `RafikiOS/linux/runner/main.cc`)
