# rebirth39/meqr architecture

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

- Interactive diagram: https://gitdiagram.com/rebirth39/meqr
- Repository: https://github.com/rebirth39/meqr

## Overview

喜劳转扩 (formerly MeQR) is an iOS QR-profile card manager for in-person social and fan-event use. The main user journey is to create a card, add platform QR profiles, customize and display the card, then optionally share selected details through an exchange code; scanning can support saving encounter records. Separate capabilities include event-linked encounters, widgets, tag catalogs, announcements, and local backup. The app is documented as local-first, with selected exchange data and refreshed event information using online services. Some feature wiring is based on README descriptions because those view implementations were not sampled.

Main entry points: [`QRID/QRID/QRIDApp.swift`](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/QRIDApp.swift) (App bootstrap), [`QRID/QRID/Views/MeQRScannerView.swift`](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/MeQRScannerView.swift) (Exchange scanner), [`QRID/QRID/Models/QRCluster.swift`](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Models/QRCluster.swift) (Card and tags), [`QRID/QRID/Helpers/MeQRRemoteService.swift`](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/MeQRRemoteService.swift) (MeQR service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app["App bootstrap<br/>[QRIDApp.swift]"]
  node_main["Main screen<br/>[MainView.swift]"]
end

subgraph group_profiles["Profile cards"]
  node_onboarding["Profile onboarding"]
  node_card_edit["Card editing"]
  node_profile_edit["QR profile editing"]
  node_card_display["Card display"]
  node_qr_generator["QR generation"]
  node_card_model[("Card and tags<br/>[QRCluster.swift]")]
  node_profile_model[("Platform profiles<br/>[QRProfile.swift]")]
end

subgraph group_exchange["Sharing and encounters"]
  node_exchange_code["Exchange code"]
  node_scanner["Exchange scanner"]
  node_link_review["QR link review"]
  node_encounters["Encounter records"]
  node_events["Event selection"]
end

subgraph group_support["Local services"]
  node_tag_catalog["Tag catalog"]
  node_tag_outbox["Tag reports"]
  node_announcements["Announcements"]
  node_backup["Local backup"]
  node_widget_sync["Widget data sync"]
  node_widget["Home and lock widgets<br/>[MeQRWidget.swift]"]
end

subgraph group_integrations["External integrations"]
  node_remote["MeQR service"]
  node_service{{"MeQR API"}}
end

node_user(("App user"))
node_widget_actor(("Widget viewer"))
node_photo_library{{"Photo library"}}

node_user -->|"launches"| node_app
node_app -->|"presents"| node_main
node_main -->|"starts setup"| node_onboarding
node_user -->|"customizes"| node_card_edit
node_user -->|"adds profiles"| node_profile_edit
node_onboarding -->|"decodes imports"| node_qr_generator
node_card_edit -->|"updates"| node_card_model
node_profile_edit -->|"updates"| node_profile_model
node_card_display -->|"reads card"| node_card_model
node_card_display -->|"reads profiles"| node_profile_model
node_card_display -->|"renders codes"| node_qr_generator
node_user -->|"selects sharing"| node_exchange_code
node_exchange_code -->|"publishes profile"| node_remote
node_remote -->|"uploads and fetches"| node_service
node_user -->|"scans code"| node_scanner
node_scanner -->|"reviews QR content"| node_link_review
node_scanner -->|"retrieves shared data"| node_remote
node_scanner -->|"saves encounter"| node_encounters
node_encounters -->|"associates event"| node_events
node_events -->|"syncs sessions"| node_remote
node_app -->|"refreshes catalog"| node_tag_catalog
node_app -->|"drains reports"| node_tag_outbox
node_app -->|"refreshes feed"| node_announcements
node_announcements -.->|"fetches announcements"| node_service
node_card_model -->|"backs up locally"| node_backup
node_card_model -->|"syncs card data"| node_widget_sync
node_widget_sync -->|"provides widget data"| node_widget
node_widget_actor -->|"views card"| node_widget
node_user -->|"saves card image"| node_photo_library

click node_app "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/QRIDApp.swift"
click node_main "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/MainView.swift"
click node_onboarding "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/OnboardingView.swift"
click node_card_edit "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/EditClusterView.swift"
click node_profile_edit "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/EditProfileView.swift"
click node_card_display "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/ClusterCardView.swift"
click node_qr_generator "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/QRCodeGenerator.swift"
click node_card_model "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Models/QRCluster.swift"
click node_profile_model "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Models/QRProfile.swift"
click node_exchange_code "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/MeQRProfileCodeView.swift"
click node_scanner "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/MeQRScannerView.swift"
click node_link_review "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/QRLinkReviewView.swift"
click node_encounters "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/EncountersView.swift"
click node_events "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/EncounterStore.swift"
click node_remote "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/MeQRRemoteService.swift"
click node_tag_catalog "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/RemoteTagCatalog.swift"
click node_tag_outbox "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/CardTagOutbox.swift"
click node_announcements "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/AnnouncementManager.swift"
click node_backup "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/BackupManager.swift"
click node_widget_sync "https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/WidgetDataHelper.swift"
click node_widget "https://github.com/rebirth39/meqr/blob/main/MeQRWidget/MeQRWidget.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_main,node_user,node_widget_actor toneBlue
class node_onboarding,node_card_edit,node_profile_edit,node_card_display,node_qr_generator,node_card_model,node_profile_model toneAmber
class node_exchange_code,node_scanner,node_link_review,node_encounters,node_events toneMint
class node_tag_catalog,node_tag_outbox,node_announcements,node_backup,node_widget_sync,node_widget toneRose
class node_remote,node_service,node_photo_library toneIndigo
```

## Components

### App experience

- [App bootstrap](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/QRIDApp.swift): `QRID/QRID/QRIDApp.swift`
- [Main screen](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/MainView.swift): `QRID/QRID/Views/MainView.swift`

### Profile cards

- [Profile onboarding](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/OnboardingView.swift): `QRID/QRID/Views/OnboardingView.swift`
- [Card editing](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/EditClusterView.swift): `QRID/QRID/Views/EditClusterView.swift`
- [QR profile editing](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/EditProfileView.swift): `QRID/QRID/Views/EditProfileView.swift`
- [Card display](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/ClusterCardView.swift): `QRID/QRID/Views/ClusterCardView.swift`
- [QR generation](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/QRCodeGenerator.swift): `QRID/QRID/Helpers/QRCodeGenerator.swift`
- [Card and tags](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Models/QRCluster.swift): `QRID/QRID/Models/QRCluster.swift`
- [Platform profiles](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Models/QRProfile.swift): `QRID/QRID/Models/QRProfile.swift`

### Sharing and encounters

- [Exchange code](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/MeQRProfileCodeView.swift): `QRID/QRID/Views/MeQRProfileCodeView.swift`
- [Exchange scanner](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/MeQRScannerView.swift): `QRID/QRID/Views/MeQRScannerView.swift`
- [QR link review](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/QRLinkReviewView.swift): `QRID/QRID/Views/QRLinkReviewView.swift`
- [Encounter records](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Views/EncountersView.swift): `QRID/QRID/Views/EncountersView.swift`
- [Event selection](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/EncounterStore.swift): `QRID/QRID/Helpers/EncounterStore.swift`

### Local services

- [Tag catalog](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/RemoteTagCatalog.swift): `QRID/QRID/Helpers/RemoteTagCatalog.swift`
- [Tag reports](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/CardTagOutbox.swift): `QRID/QRID/Helpers/CardTagOutbox.swift`
- [Announcements](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/AnnouncementManager.swift): `QRID/QRID/Helpers/AnnouncementManager.swift`
- [Local backup](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/BackupManager.swift): `QRID/QRID/Helpers/BackupManager.swift`
- [Widget data sync](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/WidgetDataHelper.swift): `QRID/QRID/Helpers/WidgetDataHelper.swift`
- [Home and lock widgets](https://github.com/rebirth39/meqr/blob/main/MeQRWidget/MeQRWidget.swift): `MeQRWidget/MeQRWidget.swift`

### External integrations

- [MeQR service](https://github.com/rebirth39/meqr/blob/main/QRID/QRID/Helpers/MeQRRemoteService.swift): `QRID/QRID/Helpers/MeQRRemoteService.swift`
- **MeQR API**

### Other components

- **App user**
- **Widget viewer**
- **Photo library**

## Connections

- App user → App bootstrap: launches
- App bootstrap → Main screen: presents
- Main screen → Profile onboarding: starts setup
- App user → Card editing: customizes
- App user → QR profile editing: adds profiles
- Profile onboarding → QR generation: decodes imports
- Card editing → Card and tags: updates
- QR profile editing → Platform profiles: updates
- Card display → Card and tags: reads card
- Card display → Platform profiles: reads profiles
- Card display → QR generation: renders codes
- App user → Exchange code: selects sharing
- Exchange code → MeQR service: publishes profile
- MeQR service → MeQR API: uploads and fetches
- App user → Exchange scanner: scans code
- Exchange scanner → QR link review: reviews QR content
- Exchange scanner → MeQR service: retrieves shared data
- Exchange scanner → Encounter records: saves encounter
- Encounter records → Event selection: associates event
- Event selection → MeQR service: syncs sessions
- App bootstrap → Tag catalog: refreshes catalog
- App bootstrap → Tag reports: drains reports
- App bootstrap → Announcements: refreshes feed
- Announcements → MeQR API: fetches announcements
- Card and tags → Local backup: backs up locally
- Card and tags → Widget data sync: syncs card data
- Widget data sync → Home and lock widgets: provides widget data
- Widget viewer → Home and lock widgets: views card
- App user → Photo library: saves card image
