# johnbenedictbolatin/seedrover architecture

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

- Interactive diagram: https://gitdiagram.com/johnbenedictbolatin/seedrover
- Repository: https://github.com/johnbenedictbolatin/seedrover

## Overview

SeedRover combines a farm-operations portal, mobile field workflows, Supabase services, and rover hardware. The documented field workflow includes planting sessions that can continue offline and synchronize receipts when connectivity returns; the portal covers operational management and read-only rover monitoring. The supplied tree omits the Dart app, firmware, database migrations, and contracts, so those major capabilities are represented only where README evidence supports them. Portal internals are grouped by their visible routes and libraries; unsampled implementation links are omitted.

Main entry points: [`web-admin/src/app/(portal)`](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)) (Admin portal), [`android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverMessagingService.kt`](https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverMessagingService.kt) (Firebase messaging service), [`windows/runner/flutter_window.h`](https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/runner/flutter_window.h) (Flutter window host), [`android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverPushEvents.kt`](https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverPushEvents.kt) (Push event relay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Web administration"]
  node_admin["Admin portal"]
  node_sales["Sales and customers"]
  node_inventory["Inventory workflows"]
  node_crops["Crop workflows"]
  node_finance["Investments"]
  node_reporting["Reports and exports"]
  node_users["User administration"]
  node_rover_monitor["Rover monitoring"]
  node_assistant_route["Assistant API<br/>[route.ts]"]
  node_portal_data["Portal domain libraries"]
end

subgraph group_backend["Supabase services"]
  node_supabase[("Supabase project")]
  node_assistant_fn["Assistant function<br/>[index.ts]"]
  node_crop_monitor["Crop monitoring<br/>[index.ts]"]
  node_push_fn["Push notifications<br/>[index.ts]"]
  node_rover_fn["Rover device API<br/>[index.ts]"]
  node_user_fn["User administration API<br/>[index.ts]"]
end

subgraph group_field["Mobile and field"]
  node_mobile["Flutter field app"]
  node_rover["Rover and camera"]
end

subgraph group_native["Platform integration"]
  node_android["Android platform bridge<br/>[MainActivity.kt]"]
  node_push_events["Push event relay"]
  node_messaging["Firebase messaging service"]
  node_windows_entry["Windows app entry<br/>[main.cpp]"]
  node_flutter_window["Flutter window host<br/>[flutter_window.h]"]
  node_win32_window["Win32 window<br/>[win32_window.h]"]
  node_win_plugins["Windows plugin registration"]
  node_win_plugin_header["Plugin registration interface"]
  node_mac_plugins["macOS plugin registration"]
  node_ios_entry["iOS app entry<br/>[AppDelegate.swift]"]
end

node_operator(("Farm operator"))
node_firebase["Firebase Cloud Messaging"]

node_operator -->|"manages operations"| node_admin
node_operator -->|"performs field work"| node_mobile
node_mobile -.->|"syncs receipts"| node_supabase
node_mobile -.->|"operates rover"| node_rover
node_admin -.->|"uses backend"| node_supabase
node_rover_monitor -.->|"monitors read-only"| node_rover
node_android -->|"registers event streams"| node_push_events
node_messaging -->|"forwards push events"| node_push_events
node_firebase -.->|"delivers messages"| node_messaging
node_windows_entry -->|"creates window"| node_flutter_window
node_flutter_window -->|"inherits window host"| node_win32_window
node_win_plugins -->|"implements interface"| node_win_plugin_header
node_ios_entry -->|"registers plugins"| node_mac_plugins

click node_admin "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)"
click node_sales "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/sales"
click node_inventory "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/inventory"
click node_crops "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/crops"
click node_finance "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/investments"
click node_reporting "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/reports"
click node_users "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/users"
click node_rover_monitor "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/rover-monitor"
click node_assistant_route "https://github.com/johnbenedictbolatin/seedrover/blob/main/web-admin/src/app/api/assistant/route.ts"
click node_portal_data "https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/lib"
click node_assistant_fn "https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/assistant/index.ts"
click node_crop_monitor "https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/crop-monitor/index.ts"
click node_push_fn "https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/push-notification/index.ts"
click node_rover_fn "https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/rover-device/index.ts"
click node_user_fn "https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/user-admin/index.ts"
click node_android "https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/MainActivity.kt"
click node_push_events "https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverPushEvents.kt"
click node_messaging "https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverMessagingService.kt"
click node_windows_entry "https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/runner/main.cpp"
click node_flutter_window "https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/runner/flutter_window.h"
click node_win32_window "https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/runner/win32_window.h"
click node_win_plugins "https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/flutter/generated_plugin_registrant.cc"
click node_win_plugin_header "https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/flutter/generated_plugin_registrant.h"
click node_mac_plugins "https://github.com/johnbenedictbolatin/seedrover/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"
click node_ios_entry "https://github.com/johnbenedictbolatin/seedrover/blob/main/ios/Runner/AppDelegate.swift"

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_admin,node_sales,node_inventory,node_crops,node_finance,node_reporting,node_users,node_rover_monitor,node_assistant_route,node_portal_data toneBlue
class node_supabase,node_assistant_fn,node_crop_monitor,node_push_fn,node_rover_fn,node_user_fn toneAmber
class node_mobile,node_rover toneMint
class node_android,node_push_events,node_messaging,node_windows_entry,node_flutter_window,node_win32_window,node_win_plugins,node_win_plugin_header,node_mac_plugins,node_ios_entry toneRose
class node_operator,node_firebase toneIndigo
```

## Components

### Web administration

- [Admin portal](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)): `web-admin/src/app/(portal)`
- [Sales and customers](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/sales): `web-admin/src/app/(portal)/sales`
- [Inventory workflows](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/inventory): `web-admin/src/app/(portal)/inventory`
- [Crop workflows](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/crops): `web-admin/src/app/(portal)/crops`
- [Investments](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/investments): `web-admin/src/app/(portal)/investments`
- [Reports and exports](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/reports): `web-admin/src/app/(portal)/reports`
- [User administration](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/users): `web-admin/src/app/(portal)/users`
- [Rover monitoring](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/app/(portal)/rover-monitor): `web-admin/src/app/(portal)/rover-monitor`
- [Assistant API](https://github.com/johnbenedictbolatin/seedrover/blob/main/web-admin/src/app/api/assistant/route.ts): `web-admin/src/app/api/assistant/route.ts`
- [Portal domain libraries](https://github.com/johnbenedictbolatin/seedrover/tree/main/web-admin/src/lib): `web-admin/src/lib`

### Supabase services

- **Supabase project**
- [Assistant function](https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/assistant/index.ts): `supabase/functions/assistant/index.ts`
- [Crop monitoring](https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/crop-monitor/index.ts): `supabase/functions/crop-monitor/index.ts`
- [Push notifications](https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/push-notification/index.ts): `supabase/functions/push-notification/index.ts`
- [Rover device API](https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/rover-device/index.ts): `supabase/functions/rover-device/index.ts`
- [User administration API](https://github.com/johnbenedictbolatin/seedrover/blob/main/supabase/functions/user-admin/index.ts): `supabase/functions/user-admin/index.ts`

### Mobile and field

- **Flutter field app**
- **Rover and camera**

### Platform integration

- [Android platform bridge](https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/MainActivity.kt): `android/app/src/main/kotlin/com/altf4/seedrover/MainActivity.kt`
- [Push event relay](https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverPushEvents.kt): `android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverPushEvents.kt`
- [Firebase messaging service](https://github.com/johnbenedictbolatin/seedrover/blob/main/android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverMessagingService.kt): `android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverMessagingService.kt`
- [Windows app entry](https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window host](https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/runner/flutter_window.h): `windows/runner/flutter_window.h`
- [Win32 window](https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/runner/win32_window.h): `windows/runner/win32_window.h`
- [Windows plugin registration](https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/flutter/generated_plugin_registrant.cc): `windows/flutter/generated_plugin_registrant.cc`
- [Plugin registration interface](https://github.com/johnbenedictbolatin/seedrover/blob/main/windows/flutter/generated_plugin_registrant.h): `windows/flutter/generated_plugin_registrant.h`
- [macOS plugin registration](https://github.com/johnbenedictbolatin/seedrover/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`
- [iOS app entry](https://github.com/johnbenedictbolatin/seedrover/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Other components

- **Farm operator**
- **Firebase Cloud Messaging**

## Connections

- Farm operator → Admin portal: manages operations (evidence: `README.md`)
- Farm operator → Flutter field app: performs field work (evidence: `README.md`)
- Flutter field app → Supabase project: syncs receipts (evidence: `README.md`)
- Flutter field app → Rover and camera: operates rover (evidence: `README.md`)
- Admin portal → Supabase project: uses backend (evidence: `README.md`)
- Rover monitoring → Rover and camera: monitors read-only (evidence: `README.md`)
- Android platform bridge → Push event relay: registers event streams (evidence: `android/app/src/main/kotlin/com/altf4/seedrover/MainActivity.kt`)
- Firebase messaging service → Push event relay: forwards push events (evidence: `android/app/src/main/kotlin/com/altf4/seedrover/SeedRoverMessagingService.kt`)
- Firebase Cloud Messaging → Firebase messaging service: delivers messages
- Windows app entry → Flutter window host: creates window (evidence: `windows/runner/main.cpp`)
- Flutter window host → Win32 window: inherits window host (evidence: `windows/runner/flutter_window.h`)
- Windows plugin registration → Plugin registration interface: implements interface (evidence: `windows/flutter/generated_plugin_registrant.cc`)
- iOS app entry → macOS plugin registration: registers plugins (evidence: `ios/Runner/AppDelegate.swift`)
