$ show CodyTseng/jumble
Jumble is a full-featured Nostr client for exploring relay feeds and engaging with the nostr social protocol. It is built as a Progressive Web App (PWA) with an optional Electron desktop wrapper, offering a rich set of features including notes, reactions, zaps, encrypted direct messages (NIP-17/NIP-4e), relay management, custom emoji packs, long-form articles, polls, media upload (Blossom/NIP-96), and translation services. The architecture is a React 18 + TypeScript single-page application with Vite as the build tool, using state management via React Context and service singletons with IndexedDB/localStorage persistence. The desktop variant adds native secret storage, auto-updater, and a custom media server. The codebase demonstrates high craftsmanship in areas such as relay connection management (SmartPool/ElectronPool with retry and health checks), an LRU-based caching abstraction (BoundedMap), a robust content parser, and a well-structured draft event creation pipeline. However, it also exhibits some monolithic services and tight coupling across providers, which limits modular reuse. Overall, it is a mature, production-grade implementation of a decentralized social media client with active development and a broad feature surface.
The LLM identified 5 files worth highlighting for reuse:
A generic Map-like data structure backed by an LRU cache (via the `lru-cache` library). It provides a simple put/get/has/delete/clear interface with a configurable max size. This is a self-contained, reusable caching utility suitable for any TypeScript project needing bounded in-memory caching.
Tokenizes Nostr note content into an array of typed embedded nodes (mentions, hashtags, URLs, images, emojis, lightning invoices, YouTube/X embeds, etc.). It is purely functional with no external dependencies beyond a regex-based parser. This pattern can be extracted and reused in any Nostr client to render event content in a structured way.
Wraps a WebSocket relay connection with subscription survival across reconnects, exponential backoff retry, health checks, and idle release. It implements a logical subscription abstraction that persists through disconnections, making it highly reusable for any application that needs resilient relay connections.
A collection of factory functions for creating draft Nostr events of various kinds (short text notes, reactions, reposts, zaps, long-form articles, polls, etc.). Each function creates a properly structured event object with appropriate tags. These are pure functions with no side effects, making them easy to extract and use in any Nostr context.
Implements a complete media upload pipeline supporting NIP-96 (HTTP file storage) and Blossom servers. It handles file reading, EXIF metadata stripping (preserving orientation), parallel upload with progress tracking, and imeta tag generation. The service is self-contained and can be adapted for any application needing media upload with metadata sanitization.