Kordant
@ d367f7e1a0
Lendair iOS App
Native iOS SwiftUI application for the Lendair peer-to-peer micro lending platform.
Setup Instructions
Prerequisites
- macOS with Xcode 15.0+ installed
- Homebrew (for package management)
Installation
-
Install XcodeGen (project generator):
brew install xcodegen -
Generate the Xcode project:
cd /home/mike/code/lendair/iOS ./generate.sh -
Open the workspace in Xcode:
open Lendair.xcworkspace
Project Structure
iOS/
├── project.yml # XcodeGen configuration
├── generate.sh # Project generation script
├── README.md # This file
└── Lendair/
├── Lendair.xcodeproj # Generated Xcode project
├── Lendair/
│ ├── LendairApp.swift # App entry point
│ ├── ContentView.swift # Root view with auth routing
│ ├── Services/ # Business logic layer
│ │ ├── TRPCService.swift # tRPC client
│ │ ├── AuthService.swift # Authentication
│ │ ├── LoanService.swift # Loan operations
│ │ ├── TransactionService.swift
│ │ └── AppState.swift # Global state management
│ ├── Models/ # Data models
│ │ ├── User.swift
│ │ ├── Loan.swift
│ │ └── Transaction.swift
│ ├── Screens/ # Feature screens
│ │ ├── Auth/
│ │ │ ├── LoginView.swift
│ │ │ └── SignupView.swift
│ │ ├── Main/
│ │ │ └── MainTabView.swift
│ │ ├── Home/
│ │ │ └── HomeView.swift
│ │ ├── Loans/
│ │ │ └── LoansTabView.swift
│ │ ├── Activity/
│ │ │ └── ActivityTabView.swift
│ │ └── Profile/
│ │ └── ProfileTabView.swift
│ ├── Components/UI/ # Reusable components
│ │ ├── PrimaryButton.swift
│ │ ├── LendairTextField.swift
│ │ ├── BalanceCard.swift
│ │ ├── LoanCard.swift
│ │ ├── TransactionRow.swift
│ │ ├── StatusBadge.swift
│ │ ├── LoadingView.swift
│ │ ├── ErrorView.swift
│ │ └── EmptyStateView.swift
│ └── Assets.xcassets/ # App icons, colors, images
├── LendairTests/ # Unit tests
└── LendairUITests/ # UI tests
Architecture
- Pattern: MVVM with
@Observable(Swift 5.9+) - Navigation: NavigationStack with programmatic navigation
- Networking: tRPC over HTTPS via URLSession
- State Management: Singleton
AppStatewith@Observable
Dependencies
Managed via Swift Package Manager:
- swift-collections (v1.x): OrderedDictionary and other collection types
- swift-algorithms (v1.x): Pagination helpers and algorithms
Building
From Xcode or command line:
# Debug build
xcodebuild -workspace Lendair.xcworkspace -scheme Lendair -configuration Debug build
# Release build
xcodebuild -workspace Lendair.xcworkspace -scheme Lendair -configuration Release build
Running Tests
# Run all tests
xcodebuild test -workspace Lendair.xcworkspace -scheme Lendair -configuration Debug
# With coverage
xcodebuild test -workspace Lendair.xcworkspace -scheme Lendair -configuration Debug \
-enableCodeCoverage YES
Environment Configuration
The app supports multiple environments:
| Environment | Base URL |
|---|---|
| Development | https://dev.lendair.local |
| Staging | https://staging.lendair.app |
| Production | https://api.lendair.app |
Configure via TRPCEndpoint enum in TRPCService.swift.
API Endpoints
The iOS app communicates with the SolidStart backend via tRPC:
- Auth:
/auth/signin,/auth/signup,/auth/me - Loans:
/loans/available,/loans/my,/loans/create,/loans/accept - Transactions:
/transactions/recent,/transactions/list
See FRE-455 for full API specification.
Key Features
- ✅ Tab bar navigation (Home, Loans, Activity, Profile)
- ✅ Authentication screens (Login, Signup)
- ✅ Home dashboard with balance card
- ✅ Loan browsing and creation
- ✅ Transaction history
- ✅ Profile management
- ⏳ Create loan form (in progress)
- ⏳ Accept/repay loan flows (pending)
- ⏳ Unit tests at NASA standards (pending)