How moss-apps/latch works
Latch is an Android private-media vault; its documented phone workflow imports and encrypts files, protects access, organizes and views vault contents, and can back up encrypted data to the desktop companion. The tree omits the Flutter implementation, so those mobile stages are documented capabilities rather than source-mapped components. The sampled Android code supports an autofill branch. The desktop workflow pairs a phone, receives a backup, then allows browsing, verification, restore, and export. Edges reflect shown calls or README behavior; unsampled wiring is not inferred.
Main entry points: App.tsx Web app shell · server.go Web UI server · main.go latchd commands · MainView.tsx Backup browser
Components 23
Android integration
- Autofill service
android/app/src/main/kotlin/com/mossapps/locker/AutofillService.kt - Pending fill state
android/app/src/main/kotlin/com/mossapps/locker/AutofillCallbackHolder.kt - Credential selection
android/app/src/main/kotlin/com/mossapps/locker/AutofillSelectionActivity.kt - Android platform bridge
android/app/src/main/kotlin/com/mossapps/locker/MainActivity.kt
Desktop backup
- latchd commands
latchd/cmd/latchd/main.go - Web UI server
latchd/internal/webui/server.go - Pairing receiver
latchd/internal/receiver/receiver.go
Web interface
- Web app shell
latchd/web-src/src/App.tsx - HTTP API client
latchd/web-src/src/lib/api.ts - Pairing screen
latchd/web-src/src/components/PairingView.tsx - Backup browser
latchd/web-src/src/components/MainView.tsx - File browser
latchd/web-src/src/components/BrowserPane.tsx - File viewer
latchd/web-src/src/components/Viewer.tsx - Backup unlock
latchd/web-src/src/components/UnlockPane.tsx - Legal gate
latchd/web-src/src/components/LegalGate.tsx
Backup operations
- Local backup
latchd/internal/backup/backup.go - Backup cryptography
latchd/internal/cryptoutil/crypto.go - Backup verification
latchd/internal/backup/verify.go - Decrypted export
latchd/internal/backup/export.go
Other components
- Latch phone
- Media vault
- Desktop user
- PocketBase sidecar
pocketbase/cmd/locker-pb/main.go
Connections 21
- Latch phone → Media vault: uses vault
- Latch phone → Pairing receiver: pushes encrypted backup
- Desktop user → latchd commands: runs
latchd/cmd/latchd/main.go - latchd commands → Web UI server: serves UI
latchd/cmd/latchd/main.go - Web UI server → Pairing receiver: starts receiver
latchd/internal/webui/server.go - Pairing receiver → Local backup: receives backup
- latchd commands → Backup verification: verifies backup
latchd/cmd/latchd/main.go - latchd commands → Decrypted export: exports plaintext
latchd/cmd/latchd/main.go - Web UI server → Backup verification: verifies manifest
latchd/internal/webui/server.go - Web UI server → Decrypted export: exports files
latchd/internal/webui/server.go - Web app shell → Pairing screen: renders pairing
latchd/web-src/src/App.tsx - Web app shell → Backup browser: renders browser
latchd/web-src/src/App.tsx - Web app shell → Legal gate: gates access
latchd/web-src/src/App.tsx - Web app shell → Backup unlock: uses unlock pane
latchd/web-src/src/App.tsx - Web app shell → HTTP API client: calls API
latchd/web-src/src/App.tsx - HTTP API client → Web UI server: HTTP requests
- Backup browser → File browser: browses files
latchd/web-src/src/components/MainView.tsx - Backup browser → File viewer: views files
- Autofill service → Pending fill state: stores callback
android/app/src/main/kotlin/com/mossapps/locker/AutofillService.kt - Autofill service → Credential selection: launches activity
android/app/src/main/kotlin/com/mossapps/locker/AutofillService.kt - Credential selection → Pending fill state: uses pending fill
android/app/src/main/kotlin/com/mossapps/locker/AutofillSelectionActivity.kt