How yunfie-twitter/pallasync works
PallaSync Server is an HTTP relay for encrypted sync events and control logs. Clients call the Axum v2 API to create and manage chains and devices, then submit and fetch records using cursor-based pagination. The server initializes SQLite before serving requests; API handlers use the database for relay state. Signature verification and JSON canonicalization form a separate protocol-security layer. Several handler internals are unsampled, so the API-to-cryptography relationship is shown as unverified rather than asserted.
Main entry points: lib.rs Route setup · mod.rs SQLite state · main.rs HTTP server · sync.rs Capability checks
Components 13
Server runtime
- HTTP server
src/main.rs - Route setup
src/lib.rs
Relay API
- Health endpoint
src/api/sync.rs - Chain management
src/api/sync.rs - Device management
src/api/sync.rs - Record relay
src/api/sync.rs - Capability checks
src/api/sync.rs
Persistence
- Database setup
src/db/mod.rs - SQLite schema
src/db/schema.sql - SQLite state
src/db/mod.rs
Protocol security
- Signature verification
src/crypto/verify.rs - JSON canonicalization
src/crypto/jcs.rs
Other components
- Sync client
Connections 15
- Sync client → HTTP server: sends HTTP requests
README.md - HTTP server → Database setup: initializes database
src/main.rs - HTTP server → Route setup: serves app
src/main.rs - Route setup → Health endpoint: routes health
src/lib.rs - Route setup → Chain management: routes chain operations
src/lib.rs - Route setup → Device management: routes device operations
src/lib.rs - Route setup → Record relay: routes record operations
src/lib.rs - Database setup → SQLite state: opens and migrates
src/db/mod.rs - Database setup → SQLite schema: loads schema
src/db/mod.rs - Chain management → SQLite state: reads and writes
src/api/sync.rs - Device management → SQLite state: reads and writes
src/api/sync.rs - Record relay → SQLite state: reads and writes
src/api/sync.rs - Capability checks → SQLite state: checks replay state
src/api/sync.rs - JSON canonicalization → Signature verification: canonicalizes signed JSON
src/crypto/verify.rs - Capability checks → Signature verification: verifies signatures