# joseph-bond-github/emailclient architecture

> Architecture diagram of the GitHub repository joseph-bond-github/emailclient, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joseph-bond-github/emailclient
- Repository: https://github.com/joseph-bond-github/emailclient

## Overview

EmailClient is an in-progress SwiftUI email client. The visible workflow is app launch into a login screen, credential submission through a login view model to an IMAP-backed service, and—after successful login—a home screen intended to show a folder’s message list. The mail-service protocol separates login from its SwiftMail implementation. Inbox loading and message presentation are placeholders; the README’s offline storage, search, and full IMAP/SMTP support are roadmap items, not implemented capabilities. Edges reflect shown calls or documented structure; no message-fetching or persistence flow is established by the excerpts.

Main entry points: [`EmailClient/App/ContentView.swift`](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/App/ContentView.swift) (Root view), [`Shared/Views/HomeView.swift`](https://github.com/joseph-bond-github/emailclient/blob/main/Shared/Views/HomeView.swift) (Home view), [`EmailClient/Services/SwiftMailService.swift`](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Services/SwiftMailService.swift) (SwiftMail adapter), [`EmailClient/Features/Login/LoginView.swift`](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Login/LoginView.swift) (Login view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app_entry["App entry"]
  node_root_view["Root view<br/>[ContentView.swift]"]
  node_home["Home view<br/>[HomeView.swift]"]
  node_home_model["Home model"]
end

subgraph group_authentication["Login and mail access"]
  node_login_view["Login view<br/>[LoginView.swift]"]
  node_login_model["Login model"]
  node_mail_protocol["Mail protocol<br/>[MailService.swift]"]
  node_swiftmail["SwiftMail adapter"]
end

subgraph group_inbox["Inbox interface"]
  node_message_list["Message list"]
  node_list_model["List model"]
end

node_user(("User"))
node_imap_server["IMAP server"]

node_user -.->|"uses app"| node_root_view
node_app_entry -->|"launches"| node_root_view
node_root_view -->|"shows logged out"| node_login_view
node_root_view -->|"shows logged in"| node_home
node_login_view -->|"submits credentials"| node_login_model
node_login_model -->|"checks login"| node_swiftmail
node_swiftmail -->|"implements"| node_mail_protocol
node_swiftmail -->|"connects and logs in"| node_imap_server
node_home -->|"reads folder"| node_home_model
node_home -->|"shows list"| node_message_list
node_message_list -->|"owns view model"| node_list_model

click node_app_entry "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/App/EmailClientApp.swift"
click node_root_view "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/App/ContentView.swift"
click node_home "https://github.com/joseph-bond-github/emailclient/blob/main/Shared/Views/HomeView.swift"
click node_home_model "https://github.com/joseph-bond-github/emailclient/blob/main/Shared/Views/HomeViewModel.swift"
click node_login_view "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Login/LoginView.swift"
click node_login_model "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Login/LoginViewModel.swift"
click node_mail_protocol "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Services/MailService.swift"
click node_swiftmail "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Services/SwiftMailService.swift"
click node_message_list "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Inbox/MessageListView.swift"
click node_list_model "https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Inbox/MessageListViewModel.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_entry,node_root_view,node_home,node_home_model,node_user toneBlue
class node_login_view,node_login_model,node_mail_protocol,node_swiftmail toneAmber
class node_message_list,node_list_model,node_imap_server toneMint
```

## Components

### App and navigation

- [App entry](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/App/EmailClientApp.swift): `EmailClient/App/EmailClientApp.swift`
- [Root view](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/App/ContentView.swift): `EmailClient/App/ContentView.swift`
- [Home view](https://github.com/joseph-bond-github/emailclient/blob/main/Shared/Views/HomeView.swift): `Shared/Views/HomeView.swift`
- [Home model](https://github.com/joseph-bond-github/emailclient/blob/main/Shared/Views/HomeViewModel.swift): `Shared/Views/HomeViewModel.swift`

### Login and mail access

- [Login view](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Login/LoginView.swift): `EmailClient/Features/Login/LoginView.swift`
- [Login model](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Login/LoginViewModel.swift): `EmailClient/Features/Login/LoginViewModel.swift`
- [Mail protocol](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Services/MailService.swift): `EmailClient/Services/MailService.swift`
- [SwiftMail adapter](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Services/SwiftMailService.swift): `EmailClient/Services/SwiftMailService.swift`

### Inbox interface

- [Message list](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Inbox/MessageListView.swift): `EmailClient/Features/Inbox/MessageListView.swift`
- [List model](https://github.com/joseph-bond-github/emailclient/blob/main/EmailClient/Features/Inbox/MessageListViewModel.swift): `EmailClient/Features/Inbox/MessageListViewModel.swift`

### Other components

- **User**
- **IMAP server**

## Connections

- User → Root view: uses app
- App entry → Root view: launches (evidence: `EmailClient/App/EmailClientApp.swift`)
- Root view → Login view: shows logged out (evidence: `EmailClient/App/ContentView.swift`)
- Root view → Home view: shows logged in (evidence: `EmailClient/App/ContentView.swift`)
- Login view → Login model: submits credentials (evidence: `EmailClient/Features/Login/LoginView.swift`)
- Login model → SwiftMail adapter: checks login (evidence: `EmailClient/Features/Login/LoginViewModel.swift`)
- SwiftMail adapter → Mail protocol: implements (evidence: `EmailClient/Services/SwiftMailService.swift`)
- SwiftMail adapter → IMAP server: connects and logs in (evidence: `EmailClient/Services/SwiftMailService.swift`)
- Home view → Home model: reads folder (evidence: `Shared/Views/HomeView.swift`)
- Home view → Message list: shows list (evidence: `Shared/Views/HomeView.swift`)
- Message list → List model: owns view model (evidence: `EmailClient/Features/Inbox/MessageListView.swift`)
