# ugurbdg/smart_home architecture

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

- Interactive diagram: https://gitdiagram.com/ugurbdg/smart_home
- Repository: https://github.com/ugurbdg/smart_home

## Overview

Smart Home Premium is a Flutter smart-home control app. Users interact with the app to pair devices over Bluetooth, use offline voice control, and access energy and timer features; the README also documents MQTT communication. The tree exposes a single Dart entry point, but its implementation was not sampled, so internal call relationships and feature ownership cannot be verified. Feature nodes use the existing `lib` directory as their path rather than implying separate modules.

Main entry points: [`lib/main.dart`](https://github.com/ugurbdg/smart_home/blob/main/lib/main.dart) (Flutter App), [`lib`](https://github.com/ugurbdg/smart_home/tree/main/lib) (BLE Provisioning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App"]
  node_app_entry["Flutter App<br/>[main.dart]"]
end

subgraph group_device["Device Setup"]
  node_ble_setup["BLE Provisioning"]
  node_smart_device["Smart Device"]
end

subgraph group_control["Home Control"]
  node_voice["Offline Voice"]
  node_energy["Energy Usage"]
  node_timer["Timer"]
  node_mqtt["MQTT Messaging"]
end

node_user(("Home User"))
node_broker["MQTT Broker"]

node_user -->|"uses"| node_app_entry
node_app_entry -->|"offers setup"| node_ble_setup
node_ble_setup -->|"pairs via BLE"| node_smart_device
node_app_entry -->|"offers control"| node_voice
node_user -->|"speaks commands"| node_voice
node_app_entry -->|"offers monitoring"| node_energy
node_app_entry -->|"offers scheduling"| node_timer
node_app_entry -->|"communicates via"| node_mqtt
node_mqtt -->|"exchanges messages"| node_broker

click node_app_entry "https://github.com/ugurbdg/smart_home/blob/main/lib/main.dart"
click node_ble_setup "https://github.com/ugurbdg/smart_home/tree/main/lib"
click node_voice "https://github.com/ugurbdg/smart_home/tree/main/lib"
click node_energy "https://github.com/ugurbdg/smart_home/tree/main/lib"
click node_timer "https://github.com/ugurbdg/smart_home/tree/main/lib"
click node_mqtt "https://github.com/ugurbdg/smart_home/tree/main/lib"

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_user toneBlue
class node_ble_setup,node_smart_device toneAmber
class node_voice,node_energy,node_timer,node_mqtt toneMint
class node_broker toneIndigo
```

## Components

### App

- [Flutter App](https://github.com/ugurbdg/smart_home/blob/main/lib/main.dart): `lib/main.dart`

### Device Setup

- [BLE Provisioning](https://github.com/ugurbdg/smart_home/tree/main/lib): `lib`
- **Smart Device**

### Home Control

- [Offline Voice](https://github.com/ugurbdg/smart_home/tree/main/lib): `lib`
- [Energy Usage](https://github.com/ugurbdg/smart_home/tree/main/lib): `lib`
- [Timer](https://github.com/ugurbdg/smart_home/tree/main/lib): `lib`
- [MQTT Messaging](https://github.com/ugurbdg/smart_home/tree/main/lib): `lib`

### Other components

- **Home User**
- **MQTT Broker**

## Connections

- Home User → Flutter App: uses
- Flutter App → BLE Provisioning: offers setup
- BLE Provisioning → Smart Device: pairs via BLE
- Flutter App → Offline Voice: offers control
- Home User → Offline Voice: speaks commands
- Flutter App → Energy Usage: offers monitoring
- Flutter App → Timer: offers scheduling
- Flutter App → MQTT Messaging: communicates via
- MQTT Messaging → MQTT Broker: exchanges messages
