# radebeneo/eskort-driver architecture

> Architecture diagram of the GitHub repository radebeneo/eskort-driver, 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/radebeneo/eskort-driver
- Repository: https://github.com/radebeneo/eskort-driver

## Overview

Eskort Driver is a scaffolded mobile app for drivers: authenticate, load a driver profile, review assigned deliveries, inspect delivery details, and use location and route guidance. The README also documents mock/live service selection, Supabase-backed delivery and driver data, tracking preferences, and a Google Maps Edge Function proxy. Edges are limited to sampled references or README statements; hook-to-repository wiring is not shown, so those links are marked unverified.

Main entry points: [`src/providers/auth-provider.tsx`](https://github.com/radebeneo/eskort-driver/blob/main/src/providers/auth-provider.tsx) (Auth provider), [`src/app/(app)`](https://github.com/radebeneo/eskort-driver/tree/main/src/app/(app)) (Delivery routes), [`src/app/_layout.tsx`](https://github.com/radebeneo/eskort-driver/blob/main/src/app/_layout.tsx) (App shell), [`src/services/deliveries/supabase-delivery-repository.ts`](https://github.com/radebeneo/eskort-driver/blob/main/src/services/deliveries/supabase-delivery-repository.ts) (Delivery repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and screens"]
  node_root["App shell<br/>[_layout.tsx]"]
  node_delivery_routes["Delivery routes"]
  node_auth_routes["Sign-in route<br/>[sign-in.tsx]"]
  node_ui_system["UI design system<br/>[theme.ts]"]
end

subgraph group_identity["Identity and profile"]
  node_sign_in["Sign-in screen<br/>[sign-in-screen.tsx]"]
  node_auth_provider["Auth provider<br/>[auth-provider.tsx]"]
  node_driver_profile["Driver profile"]
end

subgraph group_delivery["Delivery operations"]
  node_delivery_list["Assigned deliveries"]
  node_delivery_detail["Delivery details"]
  node_delivery_hook["Delivery data hook<br/>[use-deliveries.ts]"]
end

subgraph group_field["Location and routing"]
  node_location_ui["Location permission"]
  node_route_ui["Route guidance"]
  node_route_estimate["Route estimate"]
end

subgraph group_services["Services and state"]
  node_delivery_repo["Delivery repository"]
  node_delivery_mapper["Delivery mapper<br/>[delivery-mapper.ts]"]
  node_auth_service["Supabase auth"]
  node_driver_repo["Driver repository"]
  node_services_provider["Services injection"]
  node_service_selection["Service selection<br/>[index.ts]"]
  node_selection_store["Delivery selection"]
  node_tracking_store["Tracking preferences"]
  node_location_service["Device location"]
  node_maps_service["Maps proxy client"]
  node_config["Environment config<br/>[env.ts]"]
  node_secure_storage["Session storage<br/>[secure-storage.ts]"]
end

node_driver(("Driver"))
node_supabase[("Supabase")]
node_maps_proxy["Maps Edge Function"]

node_driver -->|"opens sign-in"| node_auth_routes
node_root -->|"sets up providers"| node_auth_provider
node_root -->|"checks config"| node_config
node_root -.->|"guards app routes"| node_delivery_routes
node_auth_routes -->|"renders screen"| node_sign_in
node_driver -->|"opens deliveries"| node_delivery_routes
node_delivery_routes -->|"renders list"| node_delivery_list
node_delivery_routes -->|"renders details"| node_delivery_detail
node_delivery_list -->|"loads deliveries"| node_delivery_hook
node_delivery_hook -.->|"requests delivery data"| node_delivery_repo
node_delivery_repo -->|"reads and updates"| node_supabase
node_delivery_repo -->|"parses rows"| node_delivery_mapper
node_auth_provider -->|"gets services"| node_services_provider
node_auth_provider -->|"clears selection"| node_selection_store
node_auth_provider -.->|"manages session"| node_auth_service
node_auth_provider -->|"loads profile"| node_driver_repo
node_auth_service -->|"authenticates"| node_supabase
node_driver_profile -.->|"reads profile"| node_auth_provider
node_services_provider -->|"receives services"| node_service_selection
node_service_selection -->|"selects mock or live"| node_config
node_location_ui -->|"requests permission"| node_location_service
node_route_ui -->|"checks permission"| node_location_ui
node_route_ui -->|"shows estimate"| node_route_estimate
node_route_estimate -.->|"requests route data"| node_maps_service
node_maps_service -->|"calls proxy"| node_maps_proxy
node_driver -.->|"sets preferences"| node_tracking_store

click node_root "https://github.com/radebeneo/eskort-driver/blob/main/src/app/_layout.tsx"
click node_delivery_routes "https://github.com/radebeneo/eskort-driver/tree/main/src/app/(app)"
click node_auth_routes "https://github.com/radebeneo/eskort-driver/blob/main/src/app/(auth)/sign-in.tsx"
click node_delivery_list "https://github.com/radebeneo/eskort-driver/blob/main/src/features/deliveries/assigned-deliveries-screen.tsx"
click node_delivery_detail "https://github.com/radebeneo/eskort-driver/blob/main/src/features/deliveries/delivery-details-screen.tsx"
click node_delivery_hook "https://github.com/radebeneo/eskort-driver/blob/main/src/features/deliveries/use-deliveries.ts"
click node_delivery_repo "https://github.com/radebeneo/eskort-driver/blob/main/src/services/deliveries/supabase-delivery-repository.ts"
click node_delivery_mapper "https://github.com/radebeneo/eskort-driver/blob/main/src/services/deliveries/delivery-mapper.ts"
click node_sign_in "https://github.com/radebeneo/eskort-driver/blob/main/src/features/auth/sign-in-screen.tsx"
click node_auth_provider "https://github.com/radebeneo/eskort-driver/blob/main/src/providers/auth-provider.tsx"
click node_auth_service "https://github.com/radebeneo/eskort-driver/blob/main/src/services/auth/supabase-auth-service.ts"
click node_driver_profile "https://github.com/radebeneo/eskort-driver/blob/main/src/features/auth/driver-profile-screen.tsx"
click node_driver_repo "https://github.com/radebeneo/eskort-driver/blob/main/src/services/drivers/supabase-driver-repository.ts"
click node_services_provider "https://github.com/radebeneo/eskort-driver/blob/main/src/providers/services-provider.tsx"
click node_service_selection "https://github.com/radebeneo/eskort-driver/blob/main/src/services/index.ts"
click node_selection_store "https://github.com/radebeneo/eskort-driver/blob/main/src/stores/delivery-selection-store.ts"
click node_tracking_store "https://github.com/radebeneo/eskort-driver/blob/main/src/stores/tracking-preferences-store.ts"
click node_location_ui "https://github.com/radebeneo/eskort-driver/blob/main/src/features/location/use-location-permission.ts"
click node_location_service "https://github.com/radebeneo/eskort-driver/blob/main/src/services/location/expo-location-service.ts"
click node_route_ui "https://github.com/radebeneo/eskort-driver/blob/main/src/features/navigation/delivery-route-section.tsx"
click node_route_estimate "https://github.com/radebeneo/eskort-driver/blob/main/src/features/navigation/use-route-estimate.ts"
click node_maps_service "https://github.com/radebeneo/eskort-driver/blob/main/src/services/maps/edge-function-maps-service.ts"
click node_config "https://github.com/radebeneo/eskort-driver/blob/main/src/config/env.ts"
click node_ui_system "https://github.com/radebeneo/eskort-driver/blob/main/src/components/ui/theme.ts"
click node_secure_storage "https://github.com/radebeneo/eskort-driver/blob/main/src/lib/secure-storage.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_root,node_delivery_routes,node_auth_routes,node_ui_system toneBlue
class node_sign_in,node_auth_provider,node_driver_profile,node_supabase toneAmber
class node_delivery_list,node_delivery_detail,node_delivery_hook toneMint
class node_location_ui,node_route_ui,node_route_estimate toneRose
class node_delivery_repo,node_delivery_mapper,node_auth_service,node_driver_repo,node_services_provider,node_service_selection,node_selection_store,node_tracking_store,node_location_service,node_maps_service,node_config,node_secure_storage,node_driver,node_maps_proxy toneIndigo
```

## Components

### App and screens

- [App shell](https://github.com/radebeneo/eskort-driver/blob/main/src/app/_layout.tsx): `src/app/_layout.tsx`
- [Delivery routes](https://github.com/radebeneo/eskort-driver/tree/main/src/app/(app)): `src/app/(app)`
- [Sign-in route](https://github.com/radebeneo/eskort-driver/blob/main/src/app/(auth)/sign-in.tsx): `src/app/(auth)/sign-in.tsx`
- [UI design system](https://github.com/radebeneo/eskort-driver/blob/main/src/components/ui/theme.ts): `src/components/ui/theme.ts`

### Identity and profile

- [Sign-in screen](https://github.com/radebeneo/eskort-driver/blob/main/src/features/auth/sign-in-screen.tsx): `src/features/auth/sign-in-screen.tsx`
- [Auth provider](https://github.com/radebeneo/eskort-driver/blob/main/src/providers/auth-provider.tsx): `src/providers/auth-provider.tsx`
- [Driver profile](https://github.com/radebeneo/eskort-driver/blob/main/src/features/auth/driver-profile-screen.tsx): `src/features/auth/driver-profile-screen.tsx`

### Delivery operations

- [Assigned deliveries](https://github.com/radebeneo/eskort-driver/blob/main/src/features/deliveries/assigned-deliveries-screen.tsx): `src/features/deliveries/assigned-deliveries-screen.tsx`
- [Delivery details](https://github.com/radebeneo/eskort-driver/blob/main/src/features/deliveries/delivery-details-screen.tsx): `src/features/deliveries/delivery-details-screen.tsx`
- [Delivery data hook](https://github.com/radebeneo/eskort-driver/blob/main/src/features/deliveries/use-deliveries.ts): `src/features/deliveries/use-deliveries.ts`

### Location and routing

- [Location permission](https://github.com/radebeneo/eskort-driver/blob/main/src/features/location/use-location-permission.ts): `src/features/location/use-location-permission.ts`
- [Route guidance](https://github.com/radebeneo/eskort-driver/blob/main/src/features/navigation/delivery-route-section.tsx): `src/features/navigation/delivery-route-section.tsx`
- [Route estimate](https://github.com/radebeneo/eskort-driver/blob/main/src/features/navigation/use-route-estimate.ts): `src/features/navigation/use-route-estimate.ts`

### Services and state

- [Delivery repository](https://github.com/radebeneo/eskort-driver/blob/main/src/services/deliveries/supabase-delivery-repository.ts): `src/services/deliveries/supabase-delivery-repository.ts`
- [Delivery mapper](https://github.com/radebeneo/eskort-driver/blob/main/src/services/deliveries/delivery-mapper.ts): `src/services/deliveries/delivery-mapper.ts`
- [Supabase auth](https://github.com/radebeneo/eskort-driver/blob/main/src/services/auth/supabase-auth-service.ts): `src/services/auth/supabase-auth-service.ts`
- [Driver repository](https://github.com/radebeneo/eskort-driver/blob/main/src/services/drivers/supabase-driver-repository.ts): `src/services/drivers/supabase-driver-repository.ts`
- [Services injection](https://github.com/radebeneo/eskort-driver/blob/main/src/providers/services-provider.tsx): `src/providers/services-provider.tsx`
- [Service selection](https://github.com/radebeneo/eskort-driver/blob/main/src/services/index.ts): `src/services/index.ts`
- [Delivery selection](https://github.com/radebeneo/eskort-driver/blob/main/src/stores/delivery-selection-store.ts): `src/stores/delivery-selection-store.ts`
- [Tracking preferences](https://github.com/radebeneo/eskort-driver/blob/main/src/stores/tracking-preferences-store.ts): `src/stores/tracking-preferences-store.ts`
- [Device location](https://github.com/radebeneo/eskort-driver/blob/main/src/services/location/expo-location-service.ts): `src/services/location/expo-location-service.ts`
- [Maps proxy client](https://github.com/radebeneo/eskort-driver/blob/main/src/services/maps/edge-function-maps-service.ts): `src/services/maps/edge-function-maps-service.ts`
- [Environment config](https://github.com/radebeneo/eskort-driver/blob/main/src/config/env.ts): `src/config/env.ts`
- [Session storage](https://github.com/radebeneo/eskort-driver/blob/main/src/lib/secure-storage.ts): `src/lib/secure-storage.ts`

### Other components

- **Driver**
- **Supabase**
- **Maps Edge Function**

## Connections

- Driver → Sign-in route: opens sign-in (evidence: `README.md`)
- App shell → Auth provider: sets up providers (evidence: `src/app/_layout.tsx`)
- App shell → Environment config: checks config (evidence: `src/app/_layout.tsx`)
- App shell → Delivery routes: guards app routes (evidence: `README.md`)
- Sign-in route → Sign-in screen: renders screen (evidence: `README.md`)
- Driver → Delivery routes: opens deliveries (evidence: `README.md`)
- Delivery routes → Assigned deliveries: renders list (evidence: `README.md`)
- Delivery routes → Delivery details: renders details (evidence: `README.md`)
- Assigned deliveries → Delivery data hook: loads deliveries (evidence: `src/features/deliveries/assigned-deliveries-screen.tsx`)
- Delivery data hook → Delivery repository: requests delivery data
- Delivery repository → Supabase: reads and updates (evidence: `src/services/deliveries/supabase-delivery-repository.ts`)
- Delivery repository → Delivery mapper: parses rows (evidence: `src/services/deliveries/supabase-delivery-repository.ts`)
- Auth provider → Services injection: gets services (evidence: `src/providers/auth-provider.tsx`)
- Auth provider → Delivery selection: clears selection (evidence: `src/providers/auth-provider.tsx`)
- Auth provider → Supabase auth: manages session
- Auth provider → Driver repository: loads profile (evidence: `src/providers/auth-provider.tsx`)
- Supabase auth → Supabase: authenticates (evidence: `src/services/auth/supabase-auth-service.ts`)
- Driver profile → Auth provider: reads profile
- Services injection → Service selection: receives services (evidence: `src/providers/services-provider.tsx`)
- Service selection → Environment config: selects mock or live (evidence: `src/services/index.ts`)
- Location permission → Device location: requests permission (evidence: `src/features/location/use-location-permission.ts`)
- Route guidance → Location permission: checks permission (evidence: `src/features/navigation/delivery-route-section.tsx`)
- Route guidance → Route estimate: shows estimate (evidence: `src/features/navigation/delivery-route-section.tsx`)
- Route estimate → Maps proxy client: requests route data
- Maps proxy client → Maps Edge Function: calls proxy (evidence: `README.md`)
- Driver → Tracking preferences: sets preferences (evidence: `README.md`)
