# vizsoft-global/mg-go architecture

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

- Interactive diagram: https://gitdiagram.com/vizsoft-global/mg-go
- Repository: https://github.com/vizsoft-global/mg-go

## Overview

Musallam Delivery Partner is an Android-focused Flutter app for delivery drivers. Drivers authenticate with a driver code and passcode, then use the app’s dashboard and tabs for duty, delivery, and other operational tasks. The documented delivery workflow records a pickup with order ID, photo, GPS, and a proximity check, then records delivery or cancellation with finish proof. The graph preserves major documented capabilities; sampled source is limited to native platform code, so Flutter-internal call paths are not asserted where they are not shown.

Main entry points: [`lib/features/deliveries/add_delivery_flow.dart`](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/add_delivery_flow.dart) (Pickup capture), [`lib/features/deliveries/finish_delivery_screen.dart`](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/finish_delivery_screen.dart) (Delivery finish), [`lib/features/auth/rider_auth_service.dart`](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/auth/rider_auth_service.dart) (Rider authentication), [`lib/features/auth/login_screen.dart`](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/auth/login_screen.dart) (Passcode login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_login["Passcode login<br/>[login_screen.dart]"]
  node_auth["Rider authentication"]
  node_shell["Navigation shell<br/>[main_shell.dart]"]
  node_home["Driver dashboard<br/>[home_screen.dart]"]
  node_branding["App branding"]
  node_maintenance["Maintenance gate"]
end

subgraph group_operations["Driver operations"]
  node_duty["Duty tracking"]
  node_delivery["Delivery workflow"]
  node_pickup["Pickup capture"]
  node_finish["Delivery finish"]
  node_proof["Proof uploads"]
  node_earnings["Earnings"]
  node_attendance["Attendance"]
  node_support["Support services"]
  node_vehicle["Vehicle services"]
end

subgraph group_services["Shared services"]
  node_notifications["Notifications"]
  node_security["Security controls"]
  node_offline["Offline sync"]
end

subgraph group_native["Platform integration"]
  node_android_activity["Android channels<br/>[MainActivity.kt]"]
  node_duty_overlay["Duty overlays"]
  node_overlay_plugin["Overlay plugin"]
end

node_driver(("Driver"))
node_backend[("Supabase backend")]
node_admin_api["Admin API"]
node_firebase["Firebase services"]

node_driver -->|"signs in"| node_login
node_login -.->|"submits credentials"| node_auth
node_auth -->|"passcode lookup"| node_backend
node_auth -->|"verifies passcode"| node_admin_api
node_driver -->|"uses app tabs"| node_shell
node_branding -->|"reads settings"| node_backend
node_maintenance -->|"checks maintenance"| node_backend
node_driver -->|"records pickup"| node_pickup
node_pickup -->|"creates pickup"| node_delivery
node_pickup -->|"uploads proof"| node_proof
node_pickup -->|"sends photo"| node_admin_api
node_driver -->|"completes order"| node_finish
node_finish -->|"completes or cancels"| node_delivery
node_finish -->|"uploads proof"| node_proof
node_finish -->|"sends photo"| node_admin_api
node_duty -.->|"uses native channels"| node_android_activity
node_android_activity -->|"registers plugin"| node_overlay_plugin
node_overlay_plugin -->|"controls overlay"| node_duty_overlay
node_security -->|"logs events"| node_backend
node_offline -->|"syncs queued events"| node_backend
node_notifications -.->|"receives push"| node_firebase
node_driver -.->|"views earnings"| node_earnings
node_driver -.->|"views attendance"| node_attendance
node_driver -.->|"requests support"| node_support
node_driver -.->|"manages vehicle"| node_vehicle

click node_login "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/auth/login_screen.dart"
click node_auth "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/auth/rider_auth_service.dart"
click node_shell "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/shell/main_shell.dart"
click node_home "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/home/home_screen.dart"
click node_branding "https://github.com/vizsoft-global/mg-go/blob/main/lib/core/branding/app_branding_service.dart"
click node_maintenance "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/maintenance/maintenance_screen.dart"
click node_duty "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/duty/location_tracking_service.dart"
click node_delivery "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/delivery_service.dart"
click node_pickup "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/add_delivery_flow.dart"
click node_finish "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/finish_delivery_screen.dart"
click node_proof "https://github.com/vizsoft-global/mg-go/blob/main/lib/core/storage/driver_upload_service.dart"
click node_earnings "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/earnings/earnings_service.dart"
click node_attendance "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/attendance/attendance_screen.dart"
click node_support "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/support/support_service.dart"
click node_vehicle "https://github.com/vizsoft-global/mg-go/blob/main/lib/features/vehicle/vehicle_service.dart"
click node_notifications "https://github.com/vizsoft-global/mg-go/blob/main/lib/core/notifications/push_notification_controller.dart"
click node_security "https://github.com/vizsoft-global/mg-go/blob/main/lib/core/security/security_guard_controller.dart"
click node_offline "https://github.com/vizsoft-global/mg-go/blob/main/lib/core/offline/sync_controller.dart"
click node_android_activity "https://github.com/vizsoft-global/mg-go/blob/main/android/app/src/main/kotlin/com/musallam_delivery/app/MainActivity.kt"
click node_duty_overlay "https://github.com/vizsoft-global/mg-go/blob/main/android/app/src/main/kotlin/com/musallam_delivery/app/duty_overlay/DutyOverlayController.kt"
click node_overlay_plugin "https://github.com/vizsoft-global/mg-go/blob/main/android/app/src/main/kotlin/com/musallam_delivery/app/duty_overlay/DutyOverlayPlugin.kt"

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_login,node_auth,node_shell,node_home,node_branding,node_maintenance toneBlue
class node_duty,node_delivery,node_pickup,node_finish,node_proof,node_earnings,node_attendance,node_support,node_vehicle,node_backend toneAmber
class node_notifications,node_security,node_offline,node_admin_api toneMint
class node_android_activity,node_duty_overlay,node_overlay_plugin toneRose
class node_driver,node_firebase toneIndigo
```

## Components

### App experience

- [Passcode login](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/auth/login_screen.dart): `lib/features/auth/login_screen.dart`
- [Rider authentication](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/auth/rider_auth_service.dart): `lib/features/auth/rider_auth_service.dart`
- [Navigation shell](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/shell/main_shell.dart): `lib/features/shell/main_shell.dart`
- [Driver dashboard](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/home/home_screen.dart): `lib/features/home/home_screen.dart`
- [App branding](https://github.com/vizsoft-global/mg-go/blob/main/lib/core/branding/app_branding_service.dart): `lib/core/branding/app_branding_service.dart`
- [Maintenance gate](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/maintenance/maintenance_screen.dart): `lib/features/maintenance/maintenance_screen.dart`

### Driver operations

- [Duty tracking](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/duty/location_tracking_service.dart): `lib/features/duty/location_tracking_service.dart`
- [Delivery workflow](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/delivery_service.dart): `lib/features/deliveries/delivery_service.dart`
- [Pickup capture](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/add_delivery_flow.dart): `lib/features/deliveries/add_delivery_flow.dart`
- [Delivery finish](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/deliveries/finish_delivery_screen.dart): `lib/features/deliveries/finish_delivery_screen.dart`
- [Proof uploads](https://github.com/vizsoft-global/mg-go/blob/main/lib/core/storage/driver_upload_service.dart): `lib/core/storage/driver_upload_service.dart`
- [Earnings](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/earnings/earnings_service.dart): `lib/features/earnings/earnings_service.dart`
- [Attendance](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/attendance/attendance_screen.dart): `lib/features/attendance/attendance_screen.dart`
- [Support services](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/support/support_service.dart): `lib/features/support/support_service.dart`
- [Vehicle services](https://github.com/vizsoft-global/mg-go/blob/main/lib/features/vehicle/vehicle_service.dart): `lib/features/vehicle/vehicle_service.dart`

### Shared services

- [Notifications](https://github.com/vizsoft-global/mg-go/blob/main/lib/core/notifications/push_notification_controller.dart): `lib/core/notifications/push_notification_controller.dart`
- [Security controls](https://github.com/vizsoft-global/mg-go/blob/main/lib/core/security/security_guard_controller.dart): `lib/core/security/security_guard_controller.dart`
- [Offline sync](https://github.com/vizsoft-global/mg-go/blob/main/lib/core/offline/sync_controller.dart): `lib/core/offline/sync_controller.dart`

### Platform integration

- [Android channels](https://github.com/vizsoft-global/mg-go/blob/main/android/app/src/main/kotlin/com/musallam_delivery/app/MainActivity.kt): `android/app/src/main/kotlin/com/musallam_delivery/app/MainActivity.kt`
- [Duty overlays](https://github.com/vizsoft-global/mg-go/blob/main/android/app/src/main/kotlin/com/musallam_delivery/app/duty_overlay/DutyOverlayController.kt): `android/app/src/main/kotlin/com/musallam_delivery/app/duty_overlay/DutyOverlayController.kt`
- [Overlay plugin](https://github.com/vizsoft-global/mg-go/blob/main/android/app/src/main/kotlin/com/musallam_delivery/app/duty_overlay/DutyOverlayPlugin.kt): `android/app/src/main/kotlin/com/musallam_delivery/app/duty_overlay/DutyOverlayPlugin.kt`

### Other components

- **Driver**
- **Supabase backend**
- **Admin API**
- **Firebase services**

## Connections

- Driver → Passcode login: signs in (evidence: `README.md`)
- Passcode login → Rider authentication: submits credentials
- Rider authentication → Supabase backend: passcode lookup (evidence: `README.md`)
- Rider authentication → Admin API: verifies passcode (evidence: `README.md`)
- Driver → Navigation shell: uses app tabs (evidence: `README.md`)
- App branding → Supabase backend: reads settings (evidence: `README.md`)
- Maintenance gate → Supabase backend: checks maintenance (evidence: `README.md`)
- Driver → Pickup capture: records pickup (evidence: `README.md`)
- Pickup capture → Delivery workflow: creates pickup (evidence: `README.md`)
- Pickup capture → Proof uploads: uploads proof (evidence: `README.md`)
- Pickup capture → Admin API: sends photo (evidence: `README.md`)
- Driver → Delivery finish: completes order (evidence: `README.md`)
- Delivery finish → Delivery workflow: completes or cancels (evidence: `README.md`)
- Delivery finish → Proof uploads: uploads proof (evidence: `README.md`)
- Delivery finish → Admin API: sends photo (evidence: `README.md`)
- Duty tracking → Android channels: uses native channels
- Android channels → Overlay plugin: registers plugin (evidence: `android/app/src/main/kotlin/com/musallam_delivery/app/MainActivity.kt`)
- Overlay plugin → Duty overlays: controls overlay (evidence: `android/app/src/main/kotlin/com/musallam_delivery/app/duty_overlay/DutyOverlayPlugin.kt`)
- Security controls → Supabase backend: logs events (evidence: `README.md`)
- Offline sync → Supabase backend: syncs queued events (evidence: `README.md`)
- Notifications → Firebase services: receives push
- Driver → Earnings: views earnings
- Driver → Attendance: views attendance
- Driver → Support services: requests support
- Driver → Vehicle services: manages vehicle
