# BeebBeeb  iOS customer app (SwiftUI)

Native iOS rider app, mirroring the Android app (`../AndroidApp`): phone+OTP auth, a ride tab
(wallet balance, nearby scooters, start/end ride), wallet top-ups, and support. Bilingual AR/EN
with automatic RTL for Arabic. Brand palette (gold/ink) from the logo.

> **Status:** this is **source only**. It was scaffolded on Linux (no macOS/Xcode), so it has
> **not been compiled or run**  it is written to build in Xcode on a Mac. Validate/iterate there.

## Build (on a Mac)

There is no committed `.xcodeproj`  it's generated from `project.yml` with **XcodeGen**:

```bash
brew install xcodegen        # once
cd IosApp
xcodegen generate            # creates BeebBeeb.xcodeproj
open BeebBeeb.xcodeproj       # then Run (⌘R) on a simulator
```

Deployment target: iOS 16. The Simulator shares the host network, so the app talks to the local
backend at `http://localhost:<port>` (see `Networking/APIConfig.swift`). Start the backend
services first (auth :8081, fleet :8082, booking :8084, wallet :8085, payment :8086).

## Structure

```
BeebBeeb/
  App/           BeebBeebApp (@main), AppContainer (manual DI)
  Networking/    APIConfig, DTOs (Codable), APIClient (async URLSession + bearer/X-User-Id)
  Data/          SessionStore (token+userId), repositories
  ViewModels/    Auth / Home / Wallet (@MainActor ObservableObject)
  Views/         RootView (session gate), Auth, MainTab, Home, Wallet, Support, Components
  Theme/         brand colors + a String.localized helper
  Resources/     Info.plist, en/ar Localizable.strings, Assets (logo, AccentColor)
```

## Deliberate stubs (same philosophy as the backend provider ports)

- **QR scanner** → a manual text field (TODO: AVFoundation `AVCaptureMetadataOutput`).
- **Device location** → hardcoded to Riyadh (TODO: CoreLocation).
- **Google Maps** → deferred; the nearby list is functional and needs no API key.
- **Top-up** → hands off to the MyFatoorah `paymentUrl` via `openURL`.
- **App icon** → not set (add a 1024px `AppIcon` set); the logo ships as the `BeebLogo` image.

The core ride flow (allocate → poll PENDING_UNLOCK→ACTIVE → end) is real against booking-service.

## Before release

Move the token to the Keychain, remove `NSAllowsArbitraryLoads`, point base URLs at the API
gateway, and replace the placeholder support number in `Views/SupportView.swift`.
