# aaronroberson/datesnap-ios architecture

> Architecture diagram of the GitHub repository aaronroberson/datesnap-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aaronroberson/datesnap-ios
- Repository: https://github.com/aaronroberson/datesnap-ios

## Overview

DateSnap is an iOS app for turning event-flyer screenshots into reviewed calendar events and reminders. The main workflow runs from the scan UI through photo/OCR and event understanding, then into event review and an explicit save to Apple Calendar, Reminders, and local notifications. Other product areas include saved-event/history management, subscription entitlements, and settings. The graph reflects documented wiring and source-index references; where unsampled code leaves a runtime handoff unclear, it omits that edge rather than assuming a pipeline.

Main entry points: [`Sources/DateSnap/Services/ServiceContainer.swift`](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/ServiceContainer.swift) (Service container), [`Sources/DateSnap/ContentView.swift`](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ContentView.swift) (App shell), [`Sources/DateSnap/ViewModels/EventReviewViewModel.swift`](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/EventReviewViewModel.swift) (Review coordinator), [`Sources/DateSnap/DateSnap.swift`](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/DateSnap.swift) (DateSnap app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and screens"]
  node_app["DateSnap app<br/>[DateSnap.swift]"]
  node_shell["App shell<br/>[ContentView.swift]"]
  node_home["Home and scan UI"]
  node_reviewui["Event review UI"]
  node_history["History and saved events"]
  node_settings["Settings and help"]
end

subgraph group_scan["Scanning and understanding"]
  node_scanvm["Scan coordinator"]
  node_homevm["Home state"]
  node_photos["Photo library"]
  node_ocr["Image OCR<br/>[OCRService.swift]"]
  node_extract["Event extraction"]
  node_understand["Understanding pipeline"]
  node_rules["Rule-based analysis"]
  node_duration["Duration policy"]
  node_interpreter["On-device interpreter"]
end

subgraph group_events["Event review and actions"]
  node_reviewvm["Review coordinator"]
  node_similarity["Duplicate suggestions"]
end

subgraph group_platform["Platform services and state"]
  node_calendar["Apple Calendar"]
  node_reminders["Apple Reminders"]
  node_notifications["Local notifications"]
  node_store[("Saved event store")]
  node_state["App state<br/>[AppState.swift]"]
  node_services["Service container"]
end

subgraph group_plans["Plans and entitlements"]
  node_subscription["Subscriptions"]
  node_paywall["Plan purchase UI"]
end

node_user(("App user"))

node_user -->|"uses"| node_shell
node_app -->|"shows"| node_shell
node_app -->|"creates"| node_services
node_app -->|"configures"| node_store
node_shell -->|"shows"| node_home
node_shell -->|"routes to"| node_history
node_shell -->|"routes to"| node_settings
node_shell -->|"provides"| node_homevm
node_shell -->|"provides"| node_scanvm
node_shell -->|"shares"| node_state
node_home -->|"uses"| node_scanvm
node_home -->|"uses"| node_homevm
node_scanvm -->|"uses"| node_services
node_homevm -->|"uses"| node_services
node_services -->|"constructs"| node_photos
node_services -->|"constructs"| node_ocr
node_services -->|"constructs"| node_extract
node_services -->|"configures"| node_understand
node_services -->|"constructs"| node_calendar
node_services -->|"constructs"| node_reminders
node_services -->|"constructs"| node_notifications
node_services -->|"uses"| node_subscription
node_understand -->|"analyzes with"| node_rules
node_understand -.->|"may invoke"| node_interpreter
node_extract -->|"uses"| node_duration
node_rules -->|"uses"| node_duration
node_reviewui -->|"edits through"| node_reviewvm
node_reviewui -->|"reads and writes"| node_store
node_reviewvm -->|"commits to"| node_calendar
node_reviewvm -->|"updates"| node_reminders
node_reviewvm -->|"schedules"| node_notifications
node_reviewvm -->|"finds duplicates"| node_similarity
node_reviewvm -->|"saves drafts"| node_store
node_shell -->|"presents"| node_reviewui
node_state -->|"binds tier"| node_subscription
node_paywall -.->|"purchases"| node_subscription

click node_app "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/DateSnap.swift"
click node_shell "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ContentView.swift"
click node_home "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/HomeEmptyStateView.swift"
click node_reviewui "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/EventReviewEditView.swift"
click node_history "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/HistoryArchiveView.swift"
click node_settings "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/SettingsHubView.swift"
click node_scanvm "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/ScanViewModel.swift"
click node_homevm "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/HomeViewModel.swift"
click node_photos "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/PhotoLibraryService.swift"
click node_ocr "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/OCRService.swift"
click node_extract "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/EventExtractionService.swift"
click node_understand "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/EventUnderstandingPipeline.swift"
click node_rules "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/RuleBasedEventAnalyzer.swift"
click node_duration "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/EventDurationPolicy.swift"
click node_interpreter "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/AppleFoundationModelInterpreter.swift"
click node_reviewvm "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/EventReviewViewModel.swift"
click node_similarity "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Advisors/EventSimilarityService.swift"
click node_calendar "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/CalendarService.swift"
click node_reminders "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/ReminderService.swift"
click node_notifications "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/NotificationService.swift"
click node_store "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Persistence/SwiftDataEntities.swift"
click node_state "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Models/AppState.swift"
click node_services "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/ServiceContainer.swift"
click node_subscription "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/SubscriptionService.swift"
click node_paywall "https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/PurchaseViewModel.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_shell,node_home,node_reviewui,node_history,node_settings,node_user toneBlue
class node_scanvm,node_homevm,node_photos,node_ocr,node_extract,node_understand,node_rules,node_duration,node_interpreter toneAmber
class node_reviewvm,node_similarity toneMint
class node_calendar,node_reminders,node_notifications,node_store,node_state,node_services toneRose
class node_subscription,node_paywall toneIndigo
```

## Components

### App and screens

- [DateSnap app](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/DateSnap.swift): `Sources/DateSnap/DateSnap.swift`
- [App shell](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ContentView.swift): `Sources/DateSnap/ContentView.swift`
- [Home and scan UI](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/HomeEmptyStateView.swift): `Sources/DateSnap/Views/HomeEmptyStateView.swift`
- [Event review UI](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/EventReviewEditView.swift): `Sources/DateSnap/Views/EventReviewEditView.swift`
- [History and saved events](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/HistoryArchiveView.swift): `Sources/DateSnap/Views/HistoryArchiveView.swift`
- [Settings and help](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Views/SettingsHubView.swift): `Sources/DateSnap/Views/SettingsHubView.swift`

### Scanning and understanding

- [Scan coordinator](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/ScanViewModel.swift): `Sources/DateSnap/ViewModels/ScanViewModel.swift`
- [Home state](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/HomeViewModel.swift): `Sources/DateSnap/ViewModels/HomeViewModel.swift`
- [Photo library](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/PhotoLibraryService.swift): `Sources/DateSnap/Services/PhotoLibraryService.swift`
- [Image OCR](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/OCRService.swift): `Sources/DateSnap/Services/OCRService.swift`
- [Event extraction](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/EventExtractionService.swift): `Sources/DateSnap/Services/EventExtractionService.swift`
- [Understanding pipeline](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/EventUnderstandingPipeline.swift): `Sources/DateSnap/Services/Intelligence/EventUnderstandingPipeline.swift`
- [Rule-based analysis](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/RuleBasedEventAnalyzer.swift): `Sources/DateSnap/Services/Intelligence/RuleBasedEventAnalyzer.swift`
- [Duration policy](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/EventDurationPolicy.swift): `Sources/DateSnap/Services/Intelligence/EventDurationPolicy.swift`
- [On-device interpreter](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Intelligence/AppleFoundationModelInterpreter.swift): `Sources/DateSnap/Services/Intelligence/AppleFoundationModelInterpreter.swift`

### Event review and actions

- [Review coordinator](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/EventReviewViewModel.swift): `Sources/DateSnap/ViewModels/EventReviewViewModel.swift`
- [Duplicate suggestions](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/Advisors/EventSimilarityService.swift): `Sources/DateSnap/Services/Advisors/EventSimilarityService.swift`

### Platform services and state

- [Apple Calendar](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/CalendarService.swift): `Sources/DateSnap/Services/CalendarService.swift`
- [Apple Reminders](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/ReminderService.swift): `Sources/DateSnap/Services/ReminderService.swift`
- [Local notifications](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/NotificationService.swift): `Sources/DateSnap/Services/NotificationService.swift`
- [Saved event store](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Persistence/SwiftDataEntities.swift): `Sources/DateSnap/Persistence/SwiftDataEntities.swift`
- [App state](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Models/AppState.swift): `Sources/DateSnap/Models/AppState.swift`
- [Service container](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/ServiceContainer.swift): `Sources/DateSnap/Services/ServiceContainer.swift`

### Plans and entitlements

- [Subscriptions](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/Services/SubscriptionService.swift): `Sources/DateSnap/Services/SubscriptionService.swift`
- [Plan purchase UI](https://github.com/aaronroberson/datesnap-ios/blob/main/Sources/DateSnap/ViewModels/PurchaseViewModel.swift): `Sources/DateSnap/ViewModels/PurchaseViewModel.swift`

### Other components

- **App user**

## Connections

- App user → App shell: uses (evidence: `Sources/DateSnap/ContentView.swift`)
- DateSnap app → App shell: shows (evidence: `Sources/DateSnap/DateSnap.swift`)
- DateSnap app → Service container: creates (evidence: `Sources/DateSnap/DateSnap.swift`)
- DateSnap app → Saved event store: configures (evidence: `Sources/DateSnap/DateSnap.swift`)
- App shell → Home and scan UI: shows (evidence: `Sources/DateSnap/ContentView.swift`)
- App shell → History and saved events: routes to (evidence: `Sources/DateSnap/ContentView.swift`)
- App shell → Settings and help: routes to (evidence: `Sources/DateSnap/ContentView.swift`)
- App shell → Home state: provides (evidence: `Sources/DateSnap/ContentView.swift`)
- App shell → Scan coordinator: provides (evidence: `Sources/DateSnap/ContentView.swift`)
- App shell → App state: shares (evidence: `Sources/DateSnap/ContentView.swift`)
- Home and scan UI → Scan coordinator: uses (evidence: `Sources/DateSnap/Views/HomeEmptyStateView.swift`)
- Home and scan UI → Home state: uses (evidence: `Sources/DateSnap/Views/HomeEmptyStateView.swift`)
- Scan coordinator → Service container: uses (evidence: `Sources/DateSnap/ViewModels/ScanViewModel.swift`)
- Home state → Service container: uses (evidence: `Sources/DateSnap/ViewModels/HomeViewModel.swift`)
- Service container → Photo library: constructs (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Service container → Image OCR: constructs (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Service container → Event extraction: constructs (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Service container → Understanding pipeline: configures (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Service container → Apple Calendar: constructs (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Service container → Apple Reminders: constructs (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Service container → Local notifications: constructs (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Service container → Subscriptions: uses (evidence: `Sources/DateSnap/Services/ServiceContainer.swift`)
- Understanding pipeline → Rule-based analysis: analyzes with (evidence: `Sources/DateSnap/Services/Intelligence/EventUnderstandingPipeline.swift`)
- Understanding pipeline → On-device interpreter: may invoke
- Event extraction → Duration policy: uses (evidence: `Sources/DateSnap/Services/EventExtractionService.swift`)
- Rule-based analysis → Duration policy: uses (evidence: `Sources/DateSnap/Services/Intelligence/RuleBasedEventAnalyzer.swift`)
- Event review UI → Review coordinator: edits through (evidence: `Sources/DateSnap/Views/EventReviewEditView.swift`)
- Event review UI → Saved event store: reads and writes (evidence: `Sources/DateSnap/Views/EventReviewEditView.swift`)
- Review coordinator → Apple Calendar: commits to (evidence: `Sources/DateSnap/ViewModels/EventReviewViewModel.swift`)
- Review coordinator → Apple Reminders: updates (evidence: `Sources/DateSnap/ViewModels/EventReviewViewModel.swift`)
- Review coordinator → Local notifications: schedules (evidence: `Sources/DateSnap/ViewModels/EventReviewViewModel.swift`)
- Review coordinator → Duplicate suggestions: finds duplicates (evidence: `Sources/DateSnap/ViewModels/EventReviewViewModel.swift`)
- Review coordinator → Saved event store: saves drafts (evidence: `Sources/DateSnap/ViewModels/EventReviewViewModel.swift`)
- App shell → Event review UI: presents (evidence: `Sources/DateSnap/ContentView.swift`)
- App state → Subscriptions: binds tier (evidence: `Sources/DateSnap/Models/AppState.swift`)
- Plan purchase UI → Subscriptions: purchases
