# freesk8/freesk8_mobile architecture

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

- Interactive diagram: https://gitdiagram.com/freesk8/freesk8_mobile
- Repository: https://github.com/freesk8/freesk8_mobile
- Video tour (about a minute): https://gitdiagram.com/freesk8/freesk8_mobile/video

## Overview

FreeSK8 Mobile is a Flutter companion app for ESK8/PEV devices and the FreeSK8 Robogotchi. Its documented workflow is to connect to devices, view live ESC and smart-BMS data, configure the vehicle, and review logged rides. The map preserves those main tabs and the editor/firmware capabilities shown in the source tree. The README describes the screens, but Dart implementations were not sampled, so internal calls and data-store wiring are omitted where they cannot be verified.

Main entry points: [`lib/mainViews/esk8Configuration.dart`](https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/esk8Configuration.dart) (Vehicle settings), [`lib/main.dart`](https://github.com/freesk8/freesk8_mobile/blob/master/lib/main.dart) (Flutter app), [`lib/mainViews/realTimeData.dart`](https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/realTimeData.dart) (Live telemetry), [`lib/mainViews/rideLogging.dart`](https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/rideLogging.dart) (Ride logging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["Flutter app<br/>[main.dart]"]
end

subgraph group_device["Device connection and telemetry"]
  node_connection["Connection status"]
  node_blebloc["BLE connection state"]
  node_ble["BLE support<br/>[bleHelper.dart]"]
  node_robogotchi["Robogotchi status"]
  node_telemetry["Live telemetry<br/>[realTimeData.dart]"]
  node_telemetrybloc["Telemetry state"]
  node_bms["BMS support"]
end

subgraph group_config["Vehicle configuration"]
  node_configuration["Vehicle settings"]
  node_escbloc["ESC configuration state"]
  node_esc["ESC protocol support"]
  node_profiles["Speed profiles<br/>[speedProfiles.dart]"]
  node_profileeditor["Profile editor"]
  node_inputeditor["Input configuration"]
  node_motoreditor["Motor configuration"]
  node_foc["FOC wizard<br/>[focWizard.dart]"]
end

subgraph group_records["Ride records and Robogotchi"]
  node_rides["Ride logging<br/>[rideLogging.dart]"]
  node_rideviewer["Ride log viewer<br/>[rideLogViewer.dart]"]
  node_ridebloc["Ride data state"]
  node_filemanager["File management<br/>[fileManager.dart]"]
  node_filesync["File sync"]
  node_robocfg["Robogotchi settings"]
  node_robodfu["Robogotchi DFU<br/>[robogotchiDFU.dart]"]
  node_gotchifirmware["Firmware packages"]
end

node_rider(("Rider"))
node_deviceactor(("PEV device"))

node_rider -->|"opens"| node_app
node_app -->|"shows tab"| node_connection
node_app -->|"shows tab"| node_telemetry
node_app -->|"shows tab"| node_configuration
node_app -->|"shows tab"| node_rides
node_connection -->|"connects through"| node_blebloc
node_blebloc -->|"uses"| node_ble
node_ble -->|"communicates"| node_deviceactor
node_connection -->|"displays status"| node_robogotchi
node_telemetry -->|"presents"| node_telemetrybloc
node_telemetry -->|"includes BMS data"| node_bms
node_telemetry -->|"includes ESC data"| node_esc
node_configuration -->|"manages"| node_escbloc
node_configuration -->|"offers"| node_profiles
node_configuration -->|"offers"| node_inputeditor
node_configuration -->|"offers"| node_motoreditor
node_configuration -->|"offers"| node_foc
node_profiles -->|"edits profiles"| node_profileeditor
node_escbloc -->|"uses"| node_esc
node_rides -->|"tracks location"| node_ridebloc
node_rides -->|"opens"| node_rideviewer
node_rides -->|"provides file sync"| node_filesync
node_filesync -->|"uses"| node_filemanager
node_robocfg -->|"configures"| node_robogotchi
node_robodfu -->|"provides firmware"| node_gotchifirmware
node_robodfu -->|"updates"| node_deviceactor

click node_app "https://github.com/freesk8/freesk8_mobile/blob/master/lib/main.dart"
click node_connection "https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/connectionStatus.dart"
click node_blebloc "https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/ble_connection"
click node_ble "https://github.com/freesk8/freesk8_mobile/blob/master/lib/hardwareSupport/bleHelper.dart"
click node_robogotchi "https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/robogotchi"
click node_telemetry "https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/realTimeData.dart"
click node_telemetrybloc "https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/telemetry"
click node_bms "https://github.com/freesk8/freesk8_mobile/blob/master/lib/hardwareSupport/dieBieMSHelper.dart"
click node_configuration "https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/esk8Configuration.dart"
click node_escbloc "https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/esc_config"
click node_esc "https://github.com/freesk8/freesk8_mobile/tree/master/lib/hardwareSupport/escHelper"
click node_profiles "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/speedProfiles.dart"
click node_profileeditor "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/escProfileEditor.dart"
click node_inputeditor "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/inputConfigurationEditor.dart"
click node_motoreditor "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/motorConfigurationEditor.dart"
click node_foc "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/focWizard.dart"
click node_rides "https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/rideLogging.dart"
click node_rideviewer "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/rideLogViewer.dart"
click node_ridebloc "https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/location"
click node_filemanager "https://github.com/freesk8/freesk8_mobile/blob/master/lib/components/fileManager.dart"
click node_filesync "https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/file_sync"
click node_robocfg "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/robogotchiCfgEditor.dart"
click node_robodfu "https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/robogotchiDFU.dart"
click node_gotchifirmware "https://github.com/freesk8/freesk8_mobile/tree/master/assets/firmware"

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 toneBlue
class node_connection,node_blebloc,node_ble,node_robogotchi,node_telemetry,node_telemetrybloc,node_bms toneAmber
class node_configuration,node_escbloc,node_esc,node_profiles,node_profileeditor,node_inputeditor,node_motoreditor,node_foc toneMint
class node_rides,node_rideviewer,node_ridebloc,node_filemanager,node_filesync,node_robocfg,node_robodfu,node_gotchifirmware toneRose
class node_rider,node_deviceactor toneIndigo
```

## Components

### App shell

- [Flutter app](https://github.com/freesk8/freesk8_mobile/blob/master/lib/main.dart): `lib/main.dart`

### Device connection and telemetry

- [Connection status](https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/connectionStatus.dart): `lib/mainViews/connectionStatus.dart`
- [BLE connection state](https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/ble_connection): `lib/blocs/ble_connection`
- [BLE support](https://github.com/freesk8/freesk8_mobile/blob/master/lib/hardwareSupport/bleHelper.dart): `lib/hardwareSupport/bleHelper.dart`
- [Robogotchi status](https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/robogotchi): `lib/blocs/robogotchi`
- [Live telemetry](https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/realTimeData.dart): `lib/mainViews/realTimeData.dart`
- [Telemetry state](https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/telemetry): `lib/blocs/telemetry`
- [BMS support](https://github.com/freesk8/freesk8_mobile/blob/master/lib/hardwareSupport/dieBieMSHelper.dart): `lib/hardwareSupport/dieBieMSHelper.dart`

### Vehicle configuration

- [Vehicle settings](https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/esk8Configuration.dart): `lib/mainViews/esk8Configuration.dart`
- [ESC configuration state](https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/esc_config): `lib/blocs/esc_config`
- [ESC protocol support](https://github.com/freesk8/freesk8_mobile/tree/master/lib/hardwareSupport/escHelper): `lib/hardwareSupport/escHelper`
- [Speed profiles](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/speedProfiles.dart): `lib/subViews/speedProfiles.dart`
- [Profile editor](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/escProfileEditor.dart): `lib/subViews/escProfileEditor.dart`
- [Input configuration](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/inputConfigurationEditor.dart): `lib/subViews/inputConfigurationEditor.dart`
- [Motor configuration](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/motorConfigurationEditor.dart): `lib/subViews/motorConfigurationEditor.dart`
- [FOC wizard](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/focWizard.dart): `lib/subViews/focWizard.dart`

### Ride records and Robogotchi

- [Ride logging](https://github.com/freesk8/freesk8_mobile/blob/master/lib/mainViews/rideLogging.dart): `lib/mainViews/rideLogging.dart`
- [Ride log viewer](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/rideLogViewer.dart): `lib/subViews/rideLogViewer.dart`
- [Ride data state](https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/location): `lib/blocs/location`
- [File management](https://github.com/freesk8/freesk8_mobile/blob/master/lib/components/fileManager.dart): `lib/components/fileManager.dart`
- [File sync](https://github.com/freesk8/freesk8_mobile/tree/master/lib/blocs/file_sync): `lib/blocs/file_sync`
- [Robogotchi settings](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/robogotchiCfgEditor.dart): `lib/subViews/robogotchiCfgEditor.dart`
- [Robogotchi DFU](https://github.com/freesk8/freesk8_mobile/blob/master/lib/subViews/robogotchiDFU.dart): `lib/subViews/robogotchiDFU.dart`
- [Firmware packages](https://github.com/freesk8/freesk8_mobile/tree/master/assets/firmware): `assets/firmware`

### Other components

- **Rider**
- **PEV device**

## Connections

- Rider → Flutter app: opens
- Flutter app → Connection status: shows tab
- Flutter app → Live telemetry: shows tab
- Flutter app → Vehicle settings: shows tab
- Flutter app → Ride logging: shows tab
- Connection status → BLE connection state: connects through
- BLE connection state → BLE support: uses
- BLE support → PEV device: communicates
- Connection status → Robogotchi status: displays status
- Live telemetry → Telemetry state: presents
- Live telemetry → BMS support: includes BMS data
- Live telemetry → ESC protocol support: includes ESC data
- Vehicle settings → ESC configuration state: manages
- Vehicle settings → Speed profiles: offers
- Vehicle settings → Input configuration: offers
- Vehicle settings → Motor configuration: offers
- Vehicle settings → FOC wizard: offers
- Speed profiles → Profile editor: edits profiles
- ESC configuration state → ESC protocol support: uses
- Ride logging → Ride data state: tracks location
- Ride logging → Ride log viewer: opens
- Ride logging → File sync: provides file sync
- File sync → File management: uses
- Robogotchi settings → Robogotchi status: configures
- Robogotchi DFU → Firmware packages: provides firmware
- Robogotchi DFU → PEV device: updates
