Refocus app around identity proof flows

This commit is contained in:
2026-04-18 01:05:22 +02:00
parent d195037eb6
commit ea6b45388f
45 changed files with 2784 additions and 3159 deletions

103
README.md
View File

@@ -1,95 +1,40 @@
# idp.global Swift App
Multiplatform SwiftUI companion app for `idp.global` across iPhone, iPad, and Mac.
Multiplatform SwiftUI scaffold for the personal `idp.global` companion app on iPhone, iPad, Mac, and Apple Watch.
The current build is a polished preview backed by a mock service layer. It already walks through the core product flow:
## Included in this first pass
- bind a device to an account with a QR payload
- review and approve identity or access requests
- track recent security and system events
- manage notification permissions and send a local test alert
- QR and NFC-based device pairing flows with a seeded preview payload fallback
- NFC authentication now attaches a signed GPS position on supported iPhone hardware
- Mocked approval inbox for accepting or rejecting identity requests
- Notification center with local notification permission flow and a test notification trigger
- Apple Watch companion target with a compact approval-first dashboard and request detail flow
- Shared app state and mock backend boundary so a real API can be connected later
## Current Product Surface
## Open the project
After pairing, the app opens into a passport-style dashboard with four sections:
1. Open [IDPGlobal.xcodeproj](/Users/philkunz/gitea/idp.global-swiftapp/IDPGlobal/IDPGlobal.xcodeproj).
2. Build the `IDPGlobal` scheme for:
- `My Mac`
- an iPad simulator
- an iPhone simulator
3. Build the `IDPGlobalWatch` scheme for an Apple Watch simulator when you want to verify the companion experience.
- `Passport`: digital identity summary, trust context, and quick actions
- `Requests`: approval queue with elevated-risk guidance and inline review
- `Activity`: timeline of pairing, approval, and system events
- `Account`: member profile, trusted-device context, and recovery summary
## Mock QR payload
The layout adapts by platform:
- iPhone uses a compact tab-based container
- iPad and Mac use a split-view workspace with richer side-by-side review
## Pairing Flow
The sign-in flow supports:
- live QR scanning through the camera
- manual payload paste for testing
- a seeded preview payload while the real backend is still being wired up
Seeded payload on first launch:
The app seeds this pairing payload on first launch:
`idp.global://pair?token=swiftapp-demo-berlin&origin=code.foss.global&device=Safari%20on%20Berlin%20MBP`
## Mocked Preview Behavior
You can paste it manually, scan it as a QR code, or use the preview pairing action while the backend is still mocked.
The app currently runs against `MockIDPService`, which seeds:
For NFC authentication, the app reads the pairing payload from the tag, captures the current device location, signs that GPS position, and submits both together.
- a paired member profile
- pending and handled approval requests
- recent notifications and security events
- simulated incoming requests from the toolbar
## Next integration step
This keeps the UI realistic while preserving a clean integration seam for the live backend later.
Replace `MockIDPService` with a live service that:
## Open And Run
1. Open `IDPGlobal.xcodeproj` in Xcode.
2. Build and run the `IDPGlobal` scheme on:
- `My Mac`
- an iPhone simulator
- an iPad simulator
You can also build from the command line:
```bash
xcodebuild -project IDPGlobal.xcodeproj -scheme IDPGlobal -configuration Debug -destination 'platform=macOS' build
```
## Useful Preview Launch Arguments
These launch arguments are already supported by the app model:
- `--mock-auto-pair`: automatically pair with the seeded preview payload on launch
- `--mock-section=overview`
- `--mock-section=requests`
- `--mock-section=activity`
- `--mock-section=account`
- `--mock-section=notifications`: opens the activity timeline using a notification-friendly alias
Example:
```text
--mock-auto-pair --mock-section=requests
```
## Project Structure
- `Sources/App`: app entry point and shared state in `AppViewModel`
- `Sources/Features/Auth`: first-run pairing flow and QR scanner UI
- `Sources/Features/Home`: passport dashboard, requests, activity, notifications, and account surfaces
- `Sources/Core/Models`: app-facing domain models
- `Sources/Core/Services`: mock backend boundary and local notification coordination
## Next Integration Step
Replace `MockIDPService` with a live implementation that:
- exchanges the QR payload for a real session
- loads profile, request, and activity data from the backend
- exchanges the pairing payload and signed NFC location proof for a session token
- loads approval requests and notifications from the backend
- posts approval decisions back to `idp.global`
- syncs notification state with server-side events
- syncs session and request state between iPhone and Apple Watch, likely through a shared backend session or WatchConnectivity bridge