$ account RiskyMH
EmailThing is a self-hosted email service providing web (PWA), CLI, and API interfaces for sending and receiving emails with custom domains. The system consists of a Bun-based backend API using PostgreSQL with Drizzle ORM, a React/Next.js PWA with Dexie IndexedDB for offline capabilities, and a CLI tool for management. It handles email storage via S3, authentication with JWT/sessions and passkeys, rate limiting with Redis, and integrates with external email services for sending while using Cloudflare Workers for reception. The architecture follows a monorepo pattern with clear separation: apps/api (backend server), apps/pwa (frontend interface), apps/cli (terminal tool), and shared packages for database, constants, and SDK. Key features include multi-user mailbox management, aliases, custom domain support, team collaboration, end-to-end encryption for sensitive data, and real-time synchronization between client and server. The system emphasizes user control over email infrastructure while providing modern web application experiences.