LastVet iOS¶
Initial scaffold for the LastVet veteran-facing iOS app (SwiftUI, iOS 17+).
Implemented (Sprint 1 baseline)¶
- App entry/state/config files
- VA OAuth PKCE config + generator
- Auth manager with
ASWebAuthenticationSession - Secure token storage via Keychain
- VA FHIR client with core resource pull methods
- Theme tokens + basic onboarding view with "Sign in with VA"
Project bootstrap (compilable)¶
project.yml(XcodeGen source-of-truth)LastVet.xcodeprojgenerated fromproject.ymlLastVet/Resources/Info.plistincluding OAuth URL schemelastvet://LastVet/Resources/LastVet.entitlements(minimal, ready for capabilities)- Asset catalog scaffold with
AppIcon.appiconset
XcodeGen source of truth¶
- Do not rely on manual Xcode project edits for signing/identity fields; they are overwritten when
xcodegen generateruns. - Keep these values in
project.yml:DEVELOPMENT_TEAM,PRODUCT_BUNDLE_IDENTIFIER,INFOPLIST_KEY_CFBundleDisplayName,INFOPLIST_KEY_LSApplicationCategoryType, and entitlements path. - After changing
project.yml, regenerate with:
Local secrets (Bitwarden Secrets Manager)¶
Gate 0 Facilities/Forms need the developer.va.gov sandbox open-data apikey (VA_OPEN_DATA_API_KEY in the lastvet SM project). VA OAuth approval does not include this key.
Setup (once per machine)¶
lastvet-gates/scripts/install-bws.sh
cp lastvet-gates/.bitwarden.env.example lastvet-gates/.bitwarden.env
# Add BWS_ACCESS_TOKEN from Secrets Manager → Machine accounts → lastvet project read token
lastvet-gates/scripts/audit-bitwarden-secrets.sh # what's missing in SM
lastvet-gates/scripts/sync-bitwarden-secrets.sh ios # → gitignored Secrets.xcconfig
git check-ignore Secrets.xcconfig
Shortcut from this repo:
Full manifest and all repos: lastvet-gates/bitwarden/README.md
Manual fallback: copy Secrets.xcconfig.example → Secrets.xcconfig and paste the keys.
Debug vs Release API targets¶
| Xcode configuration | LastVet API | Session exchange secret key in Secrets.xcconfig |
|---|---|---|
| Debug (simulator / device run) | https://api.last.vet/api |
VETERAN_SESSION_EXCHANGE_SECRET_PRODUCTION |
| Release (TestFlight / App Store) | https://api.last.vet/api |
VETERAN_SESSION_EXCHANGE_SECRET_PRODUCTION |
Routing is set in checked-in Configuration/Debug.xcconfig and Configuration/Release.xcconfig (visible under Project → Info → Configurations in Xcode). Gitignored Secrets.xcconfig holds per-environment session exchange secrets only.
Build locally¶
brew install xcodegen bitwarden-cli jq
cd last.vet-ios
./scripts/sync-secrets-from-bitwarden.sh # when credentials are configured
xcodegen generate
xcodebuild -project LastVet.xcodeproj -scheme LastVet -destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' -configuration Debug build
Next steps¶
- Add actual app icon PNGs to
AppIcon.appiconset. - Flesh out remaining feature modules from the full spec.
- Expand FHIR models/parsing against real VA sandbox payloads.
- Enable signing/capabilities (push, keychain groups, etc.) when provisioning is ready.