3.1 KiB
3.1 KiB
AI Implementation Context
This file summarizes project-specific context, architecture, and conventions to speed up future AI work.
Project Summary
BusinessCard is a SwiftUI app for building and sharing digital business cards with QR codes. It includes iOS screens for cards, sharing, customization, contact tracking, and widget previews, plus a watchOS companion to show a default card QR code.
Key Constraints
- iOS 26+, watchOS 12+, Swift 6.2.
- SwiftUI with
@Observableclasses and@MainActor. - Protocol‑oriented architecture is prioritized.
- No UIKit unless explicitly requested.
- String Catalogs only (
.xcstrings). - No magic numbers in views; use design constants.
Core Data Flow
AppStateowns:CardStore(cards and selection)ContactsStore(contact list + search)ShareLinkService(share URLs)QRCodeService(QR generation)
- Views read state via environment and render UI only.
Important Files
Models
BusinessCard/Models/BusinessCard.swift— business card data + vCard payloadBusinessCard/Models/Contact.swift— contact tracking modelBusinessCard/Models/CardTheme.swift— card theme paletteBusinessCard/Models/CardLayoutStyle.swift— stacked/split/photo
Protocols (POP)
BusinessCard/Protocols/BusinessCardProviding.swiftBusinessCard/Protocols/ContactTracking.swiftBusinessCard/Protocols/QRCodeProviding.swiftBusinessCard/Protocols/ShareLinkProviding.swift
State
BusinessCard/State/AppState.swiftBusinessCard/State/CardStore.swiftBusinessCard/State/ContactsStore.swift
Services
BusinessCard/Services/QRCodeService.swift— CoreImage QR generationBusinessCard/Services/ShareLinkService.swift— share URL helpers
Views
BusinessCard/Views/RootTabView.swift— tabbed shellBusinessCard/Views/CardsHomeView.swift— hero + card carouselBusinessCard/Views/ShareCardView.swift— QR + share actionsBusinessCard/Views/CustomizeCardView.swift— theme/layout controlsBusinessCard/Views/ContactsView.swift— tracking list + searchBusinessCard/Views/WidgetsView.swift— preview mockups
Design + Localization
BusinessCard/Design/DesignConstants.swiftBusinessCard/Resources/Localizable.xcstrings
watchOS
BusinessCardWatch/BusinessCardWatchApp.swiftBusinessCardWatch/Views/WatchContentView.swiftBusinessCardWatch/State/WatchCardStore.swiftBusinessCardWatch/Resources/Localizable.xcstrings
Localization
- All user-facing strings are in
.xcstrings. - Supported locales: en, es‑MX, fr‑CA.
- Use
String.localized("Key")for non-Text strings.
Testing
BusinessCardTests/BusinessCardTests.swiftincludes basic unit tests.
Known Stubs / TODOs
- Apple Wallet and NFC flows are alert-only placeholders.
- Share URLs are sample placeholders.
- Widget previews are not WidgetKit extensions.
If You Extend The App
- Add new strings to the String Catalogs.
- Add new constants to
DesignConstants.swiftinstead of literals. - Keep view logic UI-only; push business logic to state classes.
- Prefer protocols for new capabilities.