# Chrono Mail - Phase 0 (Proof of Concept) ## Goal Build a minimal working email client. Features: * Google Login * Generic IMAP Login * Fetch Inbox * Read Email * Send Email * Download Attachments * Local Cache * Offline Reading * Background Sync (basic) * Local Notifications Ignore * Clean Architecture * Plugin System * AI * Encryption * Remote Config * Themes * Backend * Advanced UI --- # Flutter Version Latest Stable --- # Packages ## Authentication ```yaml google_sign_in: flutter_appauth: flutter_secure_storage: ``` --- ## Email ```yaml enough_mail: mailer: ``` --- ## State ```yaml flutter_riverpod: riverpod_annotation: riverpod_generator: ``` --- ## Database ```yaml objectbox: objectbox_flutter_libs: ``` --- ## Network ```yaml dio: connectivity_plus: ``` --- ## Notifications ```yaml flutter_local_notifications: workmanager: ``` --- ## Utilities ```yaml logger: path_provider: file_picker: permission_handler: intl: uuid: collection: ``` --- # Folder Structure ```text lib/ main.dart app.dart core/ models/ services/ providers/ pages/ widgets/ database/ ``` --- # Models ## EmailAccount Fields ``` id email displayName provider accessToken refreshToken ``` --- ## EmailFolder ``` id name unreadCount ``` --- ## EmailMessage ``` id folderId subject from to cc bcc body htmlBody date isRead isStarred hasAttachment ``` --- ## Attachment ``` id emailId name size mimeType path ``` --- # Services ## AuthService Methods ``` loginGoogle() loginImap() logout() refreshToken() ``` --- ## MailService Methods ``` connect() disconnect() fetchFolders() fetchInbox() fetchMessage() fetchAttachments() downloadAttachment() sendEmail() delete() move() markRead() search() idle() ``` --- ## DatabaseService Methods ``` saveEmails() getEmails() getEmail() saveFolders() saveAttachments() delete() clear() ``` --- ## NotificationService Methods ``` initialize() showNewMail() ``` --- ## BackgroundSyncService Methods ``` start() stop() sync() ``` --- # Riverpod Providers ``` authProvider mailProvider databaseProvider notificationProvider backgroundSyncProvider ``` --- # Pages ``` SplashPage LoginPage AccountsPage InboxPage EmailViewPage ComposePage SettingsPage ``` --- # Flow ``` Splash ↓ Check Login ↓ Login ↓ Fetch Inbox ↓ Save to ObjectBox ↓ Open Inbox ↓ Open Email ↓ Read Body ↓ Compose ↓ Send ``` --- # Sync Every app launch ``` Connect ↓ Fetch latest emails ↓ Compare IDs ↓ Save new emails ↓ Notify UI ``` --- # Background Use ``` Workmanager ↓ Run sync ↓ Show Local Notification ``` --- # ObjectBox Create Boxes ``` Accounts Folders Emails Attachments ``` --- # MVP Checklist * Google Login * Generic IMAP Login * Fetch Inbox * Read Email * Compose * Send Email * Local Database * Offline Reading * Attachment Download * Background Sync * Local Notification --- # Ignore Until Phase 1 * Clean Architecture * SOLID * Modularization * Plugin System * AI * Encryption * Remote Config * Logging * Testing * Animations * Responsive Layout * Multiple Accounts * Threading * Search * Themes * Push Notifications * Backend Goal is only to prove that the complete email flow works.