Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2026-01-14 17:56:38 -06:00
parent 08aa488eec
commit 9f2fb7ec48

View File

@ -16,63 +16,51 @@ StorageRouter (main entry point)
``` ```
```mermaid ```mermaid
%%{init: {'theme': 'base', 'themeVariables': { 'fontSize': '16px', 'primaryColor': '#ffffff', 'lineColor': '#000000', 'textColor': '#000000', 'mainBkg': '#ffffff', 'nodeBorder': '#000000' }}}%%
flowchart TD flowchart TD
%% Main Architecture Stack %% Vertical Flow
App(["📱 <b>APP / FEATURE LAYER</b>"]) App(("📱 <b>APP / FEATURE</b>"))
subgraph Config ["⚙️ GLOBAL CONFIGURATION"] SR["🔀 <b>STORAGE ROUTER</b><br/>(The Central Engine)"]
direction LR
SC["StorageConfig"]
EC["EncryptionConfig"]
FC["FileStorageConfig"]
SYC["SyncConfig"]
end
SR["🔀 <b>STORAGE ROUTER</b><br/>(Migration & Orchestration Engine)"] subgraph Config ["⚙️ GLOBAL CONFIGURATION"]
direction TB
C1["Encryption & Sync Config"]
C2["App Group & File Config"]
end
subgraph Helpers ["🛠️ INTERNAL HELPER ACTORS"] subgraph Helpers ["🛠️ INTERNAL HELPER ACTORS"]
direction TB direction TB
subgraph Logic ["Core Logic"] H1["Keychain & File Storage Helpers"]
direction LR H2["UserDefaults & Sync Helpers"]
KH["KeychainHelper"] H3["🔐 Encryption Service"]
FH["FileHelper"]
UH["UserDefaultsHelper"]
end
EH["🔐 EncryptionHelper"]
SH["🔄 SyncHelper"]
end end
subgraph Storage ["💾 HARDWARE STORAGE"] subgraph Storage ["💾 HARDWARE STORAGE LAYER"]
direction LR direction LR
KC[("🗝️ Keychain")] S1[("🗝️ Keychain")]
FS[("📁 File System")] S2[("📁 File System")]
UD[("⚙️ UserDefaults")] S3[("⚙️ UserDefaults")]
WatchOS["⌚ Apple Watch"]
end end
%% Flow Relationships %% Relationships
App -->|StorageKey| SR App -->|StorageKey| SR
SR -.->|Resolves| Config SR -.->|Resolves| Config
SR ==>|1. Orchestrate| Helpers
Helpers ==>|2. Persist| Storage
SR ==>|1. Routing Logic| Helpers %% Migration Loop
Storage -.->|<b>3. AUTOMATIC MIGRATION</b>| SR
KH --> KC
FH --> FS
UH --> UD
SH -->|WatchConnectivity| WatchOS
KH --- EH
FH --- EH
%% Migration Logic %% Explicit Styling for High Contrast
Storage -.->|<b>2. AUTOMATIC MIGRATION</b>| SR style App fill:#ffffff,stroke:#000,stroke-width:3px
style SR fill:#e1f5fe,stroke:#000,stroke-width:4px
%% Styling style Config fill:#fffde7,stroke:#000,stroke-dasharray: 5 5
style App fill:#fff,stroke:#333,stroke-width:2px style Helpers fill:#f5f5f5,stroke:#000,stroke-width:2px
style Config fill:#f9f9f9,stroke:#999,stroke-dasharray: 5 5 style Storage fill:#e8f5e9,stroke:#000,stroke-width:3px
style SR fill:#e1f5fe,stroke:#01579b,stroke-width:3px
style Storage fill:#f0f7ff,stroke:#0052cc,stroke-width:2px %% Link Styling
style Helpers fill:#fff,stroke:#666 linkStyle default stroke:#000,stroke-width:2px,color:#000
``` ```
## What Ships in the Package ## What Ships in the Package