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

This commit is contained in:
Matt Bruce 2026-01-14 17:52:14 -06:00
parent 91368666f6
commit fbfc1af84a

View File

@ -17,59 +17,43 @@ StorageRouter (main entry point)
```mermaid
flowchart TD
%% Node Definitions
App["📱 App / Feature"]
SR["🔀 StorageRouter"]
%% Vertical Stack Architecture
App(["<br/>📱 <b>APP / FEATURE LAYER</b><br/>"])
subgraph Config ["⚙️ Global Config"]
Config["<br/>⚙️ <b>GLOBAL CONFIGURATION</b><br/>Encryption, Sync, & App Group IDs<br/>"]
SR["<br/>🔀 <b>STORAGE ROUTER</b><br/>(Migration & Orchestration Engine)<br/>"]
subgraph Helpers ["🛠️ <b>INTERNAL HELPER ACTORS</b>"]
direction TB
SC["StorageConfiguration"]
EC["EncryptionConfiguration"]
FC["FileStorageConfiguration"]
SYC["SyncConfiguration"]
end
subgraph Helpers ["🛠️ Internal Helpers"]
KH["KeychainHelper"]
FH["FileStorageHelper"]
UH["UserDefaultsHelper"]
EH["🔐 EncryptionHelper"]
SH["SyncHelper"]
end
subgraph Storage ["💾 Hardware Storage"]
KC[("🗝️ Keychain")]
FS[("📁 File System")]
UD[("⚙️ UserDefaults")]
KH["Keychain & File Helpers"]
UH["UserDefaults & Sync Helpers"]
EH["🔐 Encryption Service"]
end
%% Flow
App -->|StorageKey| SR
SR --> SR
SR -.->|Resolves| Config
SR ==>|2. Get/Set| KH
SR ==>|2. Get/Set| FH
SR ==>|2. Get/Set| UH
SR ==>|Syncs| SH
KH --- EH
FH --- EH
KH --> KC
FH --> FS
UH --> UD
SH -->|WatchConnectivity| WatchOS["⌚ Apple Watch"]
subgraph Storage ["💾 <b>HARDWARE STORAGE</b>"]
direction TB
KC[("🗝️ SECURE KEYCHAIN")]
FS[("📁 LOCAL FILE SYSTEM")]
UD[("⚙️ USER DEFAULTS")]
end
%% Migration
UD -.->|Migrate| SR
KC -.->|Migrate| SR
FS -.->|Migrate| SR
%% Main Flow
App -->|StorageKey| Config
Config --> SR
SR ==>|1. Routing Logic| Helpers
Helpers ==>|2. Persistence| Storage
%% Migration Loop
Storage -.->|<b>3. AUTOMATIC MIGRATION</b>| SR
%% Styling
style Config fill:#f9f9f9,stroke:#ddd,stroke-dasharray: 5 5
style Storage fill:#f0f7ff,stroke:#0052cc,stroke-width:2px
style SR fill:#e1f5fe,stroke:#01579b,stroke-width:2px
%% Styling for Legibility
style App fill:#fff,stroke:#333,stroke-width:2px
style Config fill:#fff,stroke:#333,stroke-dasharray: 5 5
style SR fill:#e1f5fe,stroke:#01579b,stroke-width:4px
style Storage fill:#f0f7ff,stroke:#0052cc,stroke-width:3px
style Helpers fill:#f9f9f9,stroke:#666,stroke-width:2px
```
## What Ships in the Package