How ahmedkhaleel2004/mach works
Mach is a native Mac and iPhone mail client built around a local-first mailbox: users sign in, read and search locally stored mail, act or compose offline, and synchronize changes with Gmail or Outlook. The graph highlights the shared app model, local store and provider integrations, plus conversation rendering and optional push delivery. Several feature paths are documented in the README but their implementation files were not sampled; those links cite the README rather than implying source inspection.
Main entry points: MailService.swift Mail service · AppModel.swift App model · PhoneApp.swift iPhone app · MacApp.swift Mac app
Components 25
Native clients
- Mac app
App/Mac/MacApp.swift - iPhone app
App/iOS/PhoneApp.swift - App bootstrap
App/Shared/Bootstrap.swift - App model
App/Shared/AppModel.swift - Mail views
App/Shared/Views.swift - Themes
App/Shared/Theme.swift
Mail and sync core
- Mail service
Core/Sources/MachCore/MailService.swift - OAuth sign-in
Core/Sources/MachCore/Auth.swift - Mailbox synchronization
Core/Sources/MachCore/Sync.swift - Local mailbox store
Core/Sources/MachCore/Store.swift - Gmail API client
Core/Sources/MachCore/GmailAPI.swift - Microsoft Graph client
Core/Sources/MachCore/GraphAPI.swift - Contacts and photos
Core/Sources/MachCore/People.swift
Mail experience
- Compose view
App/Shared/ComposeView.swift - Conversation web view
App/Shared/ThreadWeb.swift - Sender avatars
App/Shared/AvatarStore.swift
Push notifications
- Mail notifications
App/Shared/Notifier.swift - Push state sharing
App/Shared/PushShare.swift - Notification extension
App/NotifyExtension/NotificationService.swift - iPhone push handling
App/iOS/PublicPush.swift - Push relay worker
Relay/worker.js
Other components
- Mail user
- Gmail
- Outlook / Graph
- Apple push service
Connections 36
- Mail user → Mac app: uses
README.md - Mail user → iPhone app: uses
README.md - Mac app → App bootstrap: opens service
App/Mac/MacApp.swift - iPhone app → App bootstrap: opens service
App/iOS/PhoneApp.swift - App bootstrap → Mail service: creates
App/Shared/Bootstrap.swift - Mac app → App model: presents
App/Mac/MacApp.swift - iPhone app → App model: uses
App/iOS/PhoneApp.swift - App model → Mail service: requests mail
App/Shared/AppModel.swift - App model → Local mailbox store: observes drafts
App/Shared/AppModel.swift - App model → Mail views: drives
App/Shared/Views.swift - Mail views → Themes: styles
App/Shared/Views.swift - Mail views → Sender avatars: shows
App/Shared/Views.swift - App model → Conversation web view: loads thread
App/Shared/AppModel.swift - App model → Compose view: opens compose
README.md - Mail service → Local mailbox store: uses
Core/Sources/MachCore/MailService.swift - Mail service → Gmail API client: uses
Core/Sources/MachCore/MailService.swift - Mail service → Microsoft Graph client: uses
Core/Sources/MachCore/MailService.swift - Mail service → OAuth sign-in: authenticates
README.md - OAuth sign-in → Gmail: signs in
README.md - OAuth sign-in → Outlook / Graph: signs in
README.md - Gmail API client → Gmail: requests mail
README.md - Microsoft Graph client → Outlook / Graph: requests mail
README.md - Mail service → Mailbox synchronization: coordinates sync
README.md - Mailbox synchronization → Local mailbox store: updates local copy
README.md - Mailbox synchronization → Gmail API client: fetches changes
README.md - App model → Mail notifications: announces mail
App/Shared/AppModel.swift - Mail notifications → Mail service: checks accounts
App/Shared/Notifier.swift - iPhone app → iPhone push handling: handles push
App/iOS/PhoneApp.swift - iPhone push handling → Push state sharing: uses shared state
App/iOS/PublicPush.swift - Notification extension → Push state sharing: reads shared state
App/NotifyExtension/NotificationService.swift - Push relay worker → Apple push service: sends notifications
README.md - Gmail → Push relay worker: signals new mail
README.md - Outlook / Graph → Push relay worker: signals new mail
README.md - Mail service → Contacts and photos: looks up contacts
Core/Sources/MachCore/MailService.swift - Contacts and photos → Outlook / Graph: reads Outlook contacts
README.md - Mail service → Gmail: reads and changes mail
README.md