Skip to content

Driver App

The Driver App is the TyteRide mobile app for company Drivers. It supports company-scoped trip execution: manifest review, boarding, navigation on main and D2D secondary routes, GPS publishing, quick status feedback, and offline sync.

1. Responsibility and Audience

Concern Detail
Primary audience Driver role within a Company.
Primary responsibility Execute assigned trips: view manifest, board Passengers, navigate, publish GPS, send status feedback.
Excluded responsibility Fleet management, enrollment approval, pricing, or Company administration.
Host policy Pointer only on this host. apps/driver is a gitlink and must not be initialized, fetched, or populated on this server.

2. Stack and Repository Policy

  • Stack: Expo React Native (architecture/build spec).
  • Repo/path: apps/driver/ ยท tyteride-driver.
  • Parent repo status: Gitlink recorded in parent; development happens on the owner's machine.
  • Bootstrap rule: scripts/bootstrap.sh initializes only api, web/front, web/dashboard; it sets app submodule update to none.
  • Terminology: Use Driver everywhere; never "coordinator". Route prefix is /driver/*.

3. Core Flows

3.1 Company-Scoped Trips and Manifest

  • Driver sees company-scoped trips and manifest for assigned trips.
  • Driver accounts are created by the Manager (name and phone); Drivers log in with phone and OTP.
  • A Driver sees only trips for their Company and assignment (domain invariant).

3.2 Boarding

  • Driver taps or scans a QR code on the manifest to mark a Passenger boarded (boarded_at).
  • Boarding update is broadcast; Dashboard and live consumers receive it as defined by live-ops specs.

3.3 Navigation and D2D

  • Navigation shows main route and secondary D2D routes.
  • Route plan comes from GET /driver/trips/{id}/route-plan (API conventions/build spec naming): main route in one color, each D2D leg as a secondary route in another color with a label (Passenger, detour minutes).
  • The Driver decides when to take a D2D secondary route.
flowchart TD
    Start[Driver starts active trip] --> GPS[Publish GPS every 10-15s]
    Start --> Plan[Load route plan]
    Plan --> Main[Main route leg]
    Plan --> D2D[D2D secondary legs]
    Main --> Nav[Driver navigates]
    D2D --> Nav
    Nav --> Board[Tap/QR boarding]
    Nav --> Feedback[Quick status message]
    Board --> Broadcast[Broadcast boarded update]
    Feedback --> Broadcast2[Broadcast driver feedback]

3.4 GPS and Status Feedback

  • Driver App publishes GPS every 10 to 15 seconds during an active trip.
  • Driver App sends quick status messages (delay, incident, Passenger absent) via POST /driver/trips/{id}/feedback.
  • Dashboard Live tab consumes positions and Driver status feed.

3.5 Offline Sync

  • Offline sync is retained "as today" per build spec. The exact conflict-resolution and sync-scope details are not fully specified in current docs and should be treated as an implementation constraint to preserve/clarify.

3.6 Extra Cars

  • Extra-car requests created by Manager appear to the Driver as a normal trip (build spec).

4. Localization and UX Rules

  • Arabic and English everywhere, with RTL in apps; maps stay LTR.
  • i18next + react-i18next, persisted locale, language switch in settings.
  • Use project terminology consistently; never expose legacy Driver-role naming in UI or API naming.

5. Open Questions

  • Offline sync contract: "Offline sync as today" is stated, but current authoritative sync behavior/limits are not documented in this repo's docs.
  • Manifest fields: Exact manifest fields, sort order, and Passenger privacy constraints are not fully specified.
  • Route-plan endpoint naming: The preserved build spec includes a legacy Driver route-plan path from the old naming; canonical TyteRide path is /driver/trips/{id}/route-plan and should be confirmed in the API spec.
  • Boarding scan format: QR payload format and validation rules are not specified.
  • Status message taxonomy: Quick status messages are listed as examples (delay, incident, Passenger absent); canonical enum/list is an open question.