Capsule
Temporary Encrypted File Sharing
Rust (Axum, Tokio, SQLite) · Kotlin (Jetpack Compose) · Rust CLI · Cloudflare Workers · Astro/Starlight
Overview
Capsule is a multi-platform temporary file-sharing service built end-to-end: a Rust/Axum backend, a Rust/Clap CLI, a Kotlin/Jetpack Compose Android app, and a static Web UI. Files are automatically deleted after 1 hour with a 100 MB per-file limit enforced at the Cloudflare edge. The service supports optional client-side end-to-end encryption using the age crate with a BIP39 mnemonic passphrase — the server only ever stores encrypted bytes and never sees your keys.
Highlights
- Engineered Rust backend with SQLite (WAL mode), per-IP rate limiting (lazy-limit + axum-governor), and a 2 GB/hour per-IP bandwidth cap enforced via fixed-window tracking using DashMap; background cleanup task runs every 60s purging expired rows and orphaned upload directories
- Built Android app in Kotlin/Jetpack Compose: system share sheet integration, CameraX + Google ML Kit for QR code scanning, QR code generation for easy sharing, upload history with per-file time-remaining display, DataStore for persistent settings, optional encryption, and self-hosted server support
- Polished CLI experience: real-time upload/download progress bars (indicatif), terminal QR code rendering after upload (both download URL and mnemonic for encrypted files), and shell completions for bash/zsh/fish/PowerShell via clap_complete
- Distributed the CLI via a custom Homebrew tap (pre-built macOS/Linux arm64/x86_64 binaries) and Fedora COPR RPM packaging
- Deployed server behind Cloudflare Tunnels with a Cloudflare Worker proxy for analytics, strict CSP security headers, and static Web UI serving
- Published full Astro/Starlight documentation site at docs.withcapsule.dev, deployed to Cloudflare Workers