$ show kenn-io/msgvault
MsgVault is a self-hosted, local-first personal communications archive system. It ingress messages from email (IMAP, Gmail, mbox, PST), chat (Slic, Discord, Matrix, Beeper, WhatsApp, Facebook Messenger), SMS, meeting ttranscripts (Granola, Circlback, Plaud, Muelsi), and contacts (CardDAV, vCard). It store them in SQLite or PostgreSQL with full-text and vector embeddings search, provides a rich HTTP API, a Svelte web UI, a CLI, and an MCP serve for AI tools. The system es also feature person identity matching across source, contact syn, document indexing, and telemetry. Technically, it is a monolithic Go binary with modular packages, abdecking both interactive use and automated daemon operation. While it is alpha software with frequent API changes, its architecture is well-structure, extensively tested, and includes several reusable component like robust error classification, HTTP retry logic, and cross-process cache locking. The frontend uses generated TypeScript clients from the OpenAPI spec, and the entire system is deployable via Docker or native binaries.
The LLM identified 5 files worth highlighting for reuse:
Stable error kind classification system that wraps errors with types (Invalid, NotFound, Internal) without importing internal packages. It can be extracted as a standalone Go library for any application needing structured error types.
Configurable HTTP retry with automatic Retry-After header parsing and exponential backoff. Uses a pluggable clock interface for testability. Self-contained module that can be reused in any HTTP client application.
Job preemption and progress tracking via Go context values. Provides a clean pattern for cooperative cancellation with cause filtering and progress reporting. No internal dependencies, can be extracted as a utility library.
HMAC challenge-response authentication proof generation and verification. Allows a daemon to authenticate clients without transmitting the API key over the network. Self-contained cryptographic pattern suitable for local socket auth.
Cross-process shared/exclusive lock using flock() on a lock file. Used to coordinate DuckDB Parquet cache reads and builds across multiple processes. Isolated file-system locking utility that can be extracted for any multi-process cache coordination.