$ show Dhravya/notty
Notty is a full-stack, cross-platform notes application (an Apple Notes-style clone) built with a React 19 + Vite + Tailwind 4 frontend, a Hono API running on Cloudflare Workers, and per-user Durable Objects that each own a SQLite database. Clients include a web app, a Tauri 2 desktop app (with local SQLite, markdown export/import, cloud sync, deep-link auth, and a quick-note hot corner), and a mobile variant. Realtime collaboration is powered by Yjs with three persistence paths (Durable Object SQLite, browser IndexedDB, and Cloudflare R2), and authentication uses Better Auth with passkeys, Google/GitHub/Apple social login, and anonymous sessions. The backend also serves server-rendered public pages generated from TipTap JSON with URL sanitization and RSS 2.0 feeds, and integrates Supermemory for AI-powered note indexing. File storage and full version-history snapshots live in R2, with branch management (create/checkout/merge/delete), diff views, and restore-with-auto-backup. The architecture is notable for its platform adapter pattern (web/desktop/mobile adapters abstracting storage and sync) and per-user Durable Object isolation, but the codebase carries meaningful baggage: dead code from an earlier NextAuth-based iteration (src/lib/auth.ts, old NotesContext, DarkModeSwitch, search-results.tsx), no visible unit tests beyond a race-condition QA script, a non-standard FNV-1a-based lock token instead of a real HMAC, and a merge operation that is actually a replace. Optimistic update logic in the notes context is fragile and can diverge from server state under rapid tab switches. Despite these issues, the core architecture is sound and the adapter pattern is genuinely reusable.
The LLM identified 4 files worth highlighting for reuse:
A trio of platform adapters implementing a common interface for storage, sync, and auth across web (IndexedDB + R2), desktop (Tauri local SQLite + cloud sync), and mobile. This is a clean, self-contained abstraction that another engineer could extract into any cross-platform app needing platform-specific persistence without changing business logic. It demonstrates non-obvious skill in isolating platform concerns behind a single contract.
AuthDurableObject encapsulates Better Auth configuration, passkey and social login flows, token exchange, share handling, and user profiles within a per-user Durable Object. The pattern of colocating auth state with the user's data partition (per-user DO isolation) is a strong Cloudflare Workers architecture worth replicating in other DO-based multi-tenant apps.
The Hono server is the central entry point: it wires all API routes, proxies auth, handles WebSocket sync for Yjs, and serves public pages. It also generates server-rendered HTML from TipTap JSON with URL sanitization and RSS 2.0 output. This demonstrates a compact single-file server pattern for a Workers-based full-stack app, though it is tightly coupled to the rest of the codebase and less extractable than the adapters.
Notes context implements optimistic updates with undo-on-delete and realtime event subscription from the Yjs sync layer. The pattern is instructive for building responsive collaborative UIs, but the local edit merge logic is fragile and can diverge from server state under rapid tab switches, so it should be treated as a reference pattern rather than production-ready reusable code.