Manages device pairing and peer-to-peer syncing without cloud storage.
Data Model
er Synchronization data model erDiagram
device {
string id PK
datetime pairedAt
datetime lastSyncedAt
}
lastSyncedAt datetime [null]
API
Propertiestarget-device-idstring
| Parameter | Type | Required | Description |
target-device-id | string | — | |
Propertiesdevice-idstringtimestampDate
| Parameter | Type | Required | Description |
device-id | string | — | |
timestamp | Date | — | |
Propertiestarget-device-idstringtimestampDate
| Parameter | Type | Required | Description |
target-device-id | string | — | |
timestamp | Date | — | |
Input Parameterslocal-dataobjectremote-dataobject
| Parameter | Type | Required | Description |
local-data | object | — | |
remote-data | object | — | |
| Error ID | Code | Category | Description |
sync-failed | TODO | domain | Thrown when the peer-to-peer connection drops or fails to authenticate. |
Reactive Topology
autoflow Synchronization reactive topology flowchart LR;
classDef actionNode fill:#e3f2fd,stroke:#1e88e5,color:#0d47a1;
classDef eventNode fill:#e8f5e9,stroke:#4caf50,color:#1b5e20;
classDef errorNode fill:#ffebee,stroke:#ef5350,color:#b71c1c;
classDef externalNode fill:#f5f5f5,stroke:#9e9e9e,color:#616161,stroke-dasharray:4 4;
subgraph synchronization ["Synchronization"]
n0(["pair-device"])
n1(["sync-data"])
n2{{"device-paired"}}
n3{{"data-synced"}}
n4{{"sync-failed"}}
end
class n0,n1 actionNode;
class n2,n3 eventNode;
class n4 errorNode;
click n0 href "/domains/synchronization#pair-device" _self;
click n1 href "/domains/synchronization#sync-data" _self;
click n2 href "/domains/synchronization#device-paired" _self;
click n3 href "/domains/synchronization#data-synced" _self;
click n4 href "/domains/synchronization#sync-failed" _self;