$ show kurrier-org/kurrier
Kurrier is a self-hosted unified communication platform designed to aggregate email, calendars, contacts, and cloud storage into a single workspace. It functions as a multi-tenant SaaS application, supporting various protocols including IMAP/SMTP for email, CalDAV/CardDAV for scheduling and contacts, and WebDAV/S3 for file storage. The system emphasizes data ownership and privacy, allowing users to manage multiple email identities and storage volumes within isolated workspaces. The architecture follows a monorepo structure with a clear separation of concerns. The frontend (`apps/web`) is built on Next.js 16 with React 19, utilizing Server Actions for business logic and a Nitro-based worker (`apps/worker`) for background jobs like IMAP sync and email delivery. Data persistence is handled by PostgreSQL with Drizzle ORM, while Redis manages job queues and caching. The platform integrates with external providers via a strategy pattern, supporting services like Google Workspace, AWS SES, and various SMTP providers. Key components include a robust provider abstraction layer for pluggable email and storage backends, a centralized encryption vault for sensitive credentials, and a standardized Server Action wrapper for consistent error handling. The codebase demonstrates high craftsmanship in its sync logic and multi-tenancy implementation, though it carries some technical debt related to type safety and complex DAV/IMAP state management.
The LLM identified 4 files worth highlighting for reuse:
Defines the `Mailer` and `StorageProvider` interfaces, enabling a pluggable architecture for external services. This component allows the platform to support multiple email providers (SMTP, Google, SES) and storage backends (S3, Garage) without coupling the core logic to specific implementations.
Implements a centralized AES-256-GCM encryption/decryption service for sensitive data like OAuth tokens and passwords. This component abstracts the complexity of secret management, ensuring credentials are stored securely in the database and decrypted only at runtime.
Contains core Server Actions for identity and provider management. It demonstrates the use of the `handleAction` wrapper to standardize error handling, form data decoding, and path revalidation, providing a reusable pattern for UI interactions.
Provides standardized API response handling (`apiSuccess`, `apiError`) and validation logic (`validateApiKey`, `validateIdentityOwnership`). This component ensures consistent error responses and security checks across the worker's API routes.