# basexapp/powertank architecture

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

- Interactive diagram: https://gitdiagram.com/basexapp/powertank
- Repository: https://github.com/basexapp/powertank

## Overview

Cloudtrack is presented as a Flutter starter app; the tree exposes native platform shells and Supabase Edge Functions, but no Flutter/Dart application source. The functions indicate backend capabilities for account management, driver data, stock exports, and App Script synchronization, though their internal data flow and the app-to-function calls cannot be established from the available evidence. The graph therefore shows verified desktop shell relationships and keeps backend entry points separate.

Main entry points: [`windows/runner/flutter_window.h`](https://github.com/basexapp/powertank/blob/main/windows/runner/flutter_window.h) (Flutter window), [`linux/runner/my_application.cc`](https://github.com/basexapp/powertank/blob/main/linux/runner/my_application.cc) (GTK application), [`windows/runner/main.cpp`](https://github.com/basexapp/powertank/blob/main/windows/runner/main.cpp) (Windows launcher), [`linux/runner/main.cc`](https://github.com/basexapp/powertank/blob/main/linux/runner/main.cc) (Linux launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform shells"]
  node_windows_entry["Windows launcher<br/>[main.cpp]"]
  node_windows_view["Flutter window<br/>[flutter_window.h]"]
  node_win32_window["Win32 window<br/>[win32_window.cpp]"]
  node_linux_entry["Linux launcher<br/>[main.cc]"]
  node_linux_app["GTK application<br/>[my_application.cc]"]
  node_ios_app["iOS app delegate<br/>[AppDelegate.swift]"]
end

subgraph group_plugins["Native plugins"]
  node_linux_plugins["Linux plugin registration"]
  node_macos_plugins["macOS plugin registration"]
  node_windows_plugins["Windows plugin registration"]
end

subgraph group_accounts["Account functions"]
  node_password_change["Change password<br/>[index.ts]"]
  node_password_set["Set final password<br/>[index.ts]"]
  node_password_reset["Reset password<br/>[index.ts]"]
  node_reset_request["Request reset<br/>[index.ts]"]
  node_user_approval["Approve user<br/>[index.ts]"]
  node_dev_validation["Validate developer<br/>[index.ts]"]
end

subgraph group_operations["Operations functions"]
  node_driver_data["Driver data access<br/>[index.ts]"]
  node_tank_export["Tank stock export<br/>[index.ts]"]
  node_stock_export["Stock export<br/>[index.ts]"]
  node_appscript_sync["App Script sync<br/>[index.ts]"]
end

node_user(("App user"))

node_windows_entry -->|"creates"| node_windows_view
node_windows_view -->|"inherits from"| node_win32_window
node_linux_entry -->|"creates and runs"| node_linux_app
node_linux_app -->|"registers plugins"| node_linux_plugins
node_user -.->|"invokes"| node_driver_data
node_user -.->|"invokes"| node_tank_export
node_user -.->|"invokes"| node_stock_export
node_user -.->|"invokes"| node_appscript_sync
node_user -.->|"invokes"| node_password_change
node_user -.->|"invokes"| node_password_set
node_user -.->|"invokes"| node_password_reset
node_user -.->|"invokes"| node_reset_request
node_user -.->|"invokes"| node_user_approval
node_user -.->|"invokes"| node_dev_validation

click node_windows_entry "https://github.com/basexapp/powertank/blob/main/windows/runner/main.cpp"
click node_windows_view "https://github.com/basexapp/powertank/blob/main/windows/runner/flutter_window.h"
click node_win32_window "https://github.com/basexapp/powertank/blob/main/windows/runner/win32_window.cpp"
click node_linux_entry "https://github.com/basexapp/powertank/blob/main/linux/runner/main.cc"
click node_linux_app "https://github.com/basexapp/powertank/blob/main/linux/runner/my_application.cc"
click node_ios_app "https://github.com/basexapp/powertank/blob/main/ios/Runner/AppDelegate.swift"
click node_linux_plugins "https://github.com/basexapp/powertank/blob/main/linux/flutter/generated_plugin_registrant.cc"
click node_macos_plugins "https://github.com/basexapp/powertank/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"
click node_windows_plugins "https://github.com/basexapp/powertank/blob/main/windows/flutter/generated_plugin_registrant.cc"
click node_driver_data "https://github.com/basexapp/powertank/blob/main/supabase/functions/acessar-dados-motoristas/index.ts"
click node_tank_export "https://github.com/basexapp/powertank/blob/main/supabase/functions/down_excel_estoque_tanque/index.ts"
click node_stock_export "https://github.com/basexapp/powertank/blob/main/supabase/functions/down_excel_estoques/index.ts"
click node_appscript_sync "https://github.com/basexapp/powertank/blob/main/supabase/functions/sincronizar_appscript/index.ts"
click node_password_change "https://github.com/basexapp/powertank/blob/main/supabase/functions/alterar-senha/index.ts"
click node_password_set "https://github.com/basexapp/powertank/blob/main/supabase/functions/definir-senha-definitiva/index.ts"
click node_password_reset "https://github.com/basexapp/powertank/blob/main/supabase/functions/redefinir-senha/index.ts"
click node_reset_request "https://github.com/basexapp/powertank/blob/main/supabase/functions/solicitar-redefinicao/index.ts"
click node_user_approval "https://github.com/basexapp/powertank/blob/main/supabase/functions/aprovar-usuario/index.ts"
click node_dev_validation "https://github.com/basexapp/powertank/blob/main/supabase/functions/validar-dev/index.ts"

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_windows_entry,node_windows_view,node_win32_window,node_linux_entry,node_linux_app,node_ios_app,node_user toneBlue
class node_linux_plugins,node_macos_plugins,node_windows_plugins toneAmber
class node_password_change,node_password_set,node_password_reset,node_reset_request,node_user_approval,node_dev_validation toneMint
class node_driver_data,node_tank_export,node_stock_export,node_appscript_sync toneRose
```

## Components

### Platform shells

- [Windows launcher](https://github.com/basexapp/powertank/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/basexapp/powertank/blob/main/windows/runner/flutter_window.h): `windows/runner/flutter_window.h`
- [Win32 window](https://github.com/basexapp/powertank/blob/main/windows/runner/win32_window.cpp): `windows/runner/win32_window.cpp`
- [Linux launcher](https://github.com/basexapp/powertank/blob/main/linux/runner/main.cc): `linux/runner/main.cc`
- [GTK application](https://github.com/basexapp/powertank/blob/main/linux/runner/my_application.cc): `linux/runner/my_application.cc`
- [iOS app delegate](https://github.com/basexapp/powertank/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Native plugins

- [Linux plugin registration](https://github.com/basexapp/powertank/blob/main/linux/flutter/generated_plugin_registrant.cc): `linux/flutter/generated_plugin_registrant.cc`
- [macOS plugin registration](https://github.com/basexapp/powertank/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`
- [Windows plugin registration](https://github.com/basexapp/powertank/blob/main/windows/flutter/generated_plugin_registrant.cc): `windows/flutter/generated_plugin_registrant.cc`

### Account functions

- [Change password](https://github.com/basexapp/powertank/blob/main/supabase/functions/alterar-senha/index.ts): `supabase/functions/alterar-senha/index.ts`
- [Set final password](https://github.com/basexapp/powertank/blob/main/supabase/functions/definir-senha-definitiva/index.ts): `supabase/functions/definir-senha-definitiva/index.ts`
- [Reset password](https://github.com/basexapp/powertank/blob/main/supabase/functions/redefinir-senha/index.ts): `supabase/functions/redefinir-senha/index.ts`
- [Request reset](https://github.com/basexapp/powertank/blob/main/supabase/functions/solicitar-redefinicao/index.ts): `supabase/functions/solicitar-redefinicao/index.ts`
- [Approve user](https://github.com/basexapp/powertank/blob/main/supabase/functions/aprovar-usuario/index.ts): `supabase/functions/aprovar-usuario/index.ts`
- [Validate developer](https://github.com/basexapp/powertank/blob/main/supabase/functions/validar-dev/index.ts): `supabase/functions/validar-dev/index.ts`

### Operations functions

- [Driver data access](https://github.com/basexapp/powertank/blob/main/supabase/functions/acessar-dados-motoristas/index.ts): `supabase/functions/acessar-dados-motoristas/index.ts`
- [Tank stock export](https://github.com/basexapp/powertank/blob/main/supabase/functions/down_excel_estoque_tanque/index.ts): `supabase/functions/down_excel_estoque_tanque/index.ts`
- [Stock export](https://github.com/basexapp/powertank/blob/main/supabase/functions/down_excel_estoques/index.ts): `supabase/functions/down_excel_estoques/index.ts`
- [App Script sync](https://github.com/basexapp/powertank/blob/main/supabase/functions/sincronizar_appscript/index.ts): `supabase/functions/sincronizar_appscript/index.ts`

### Other components

- **App user**

## Connections

- Windows launcher → Flutter window: creates (evidence: `windows/runner/main.cpp`)
- Flutter window → Win32 window: inherits from (evidence: `windows/runner/flutter_window.h`)
- Linux launcher → GTK application: creates and runs (evidence: `linux/runner/main.cc`)
- GTK application → Linux plugin registration: registers plugins (evidence: `linux/runner/my_application.cc`)
- App user → Driver data access: invokes
- App user → Tank stock export: invokes
- App user → Stock export: invokes
- App user → App Script sync: invokes
- App user → Change password: invokes
- App user → Set final password: invokes
- App user → Reset password: invokes
- App user → Request reset: invokes
- App user → Approve user: invokes
- App user → Validate developer: invokes
