# louiscambier/auramail architecture

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

- Interactive diagram: https://gitdiagram.com/louiscambier/auramail
- Repository: https://github.com/louiscambier/auramail

## Overview

AuraMail is a Tauri desktop email client: users organize mail in workspaces, connect accounts, read and triage messages, and refine AI behavior through feedback. The graph separates the React workspace and message interface from Rust IPC orchestration, mail/auth, AI, and local learning storage. Major README capabilities such as provider choices, search, and quick replies are retained where supported by documentation; source excerpts do not establish every runtime wiring detail.

Main entry points: [`src/App.tsx`](https://github.com/louiscambier/auramail/blob/main/src/App.tsx) (App shell), [`src-tauri/src/commands.rs`](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/commands.rs) (IPC commands), [`src-tauri/src/ai/mod.rs`](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/ai/mod.rs) (AI providers and triage), [`src-tauri/src/db/mod.rs`](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/db/mod.rs) (Local SQLite store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["App shell<br/>[App.tsx]"]
  node_workspace["Workspace switcher"]
  node_sidebar["Zen sidebar<br/>[ZenSidebar.tsx]"]
  node_mail_list["Mail list<br/>[MailList.tsx]"]
  node_reader["Message reader<br/>[MailReader.tsx]"]
  node_account_ui["Account setup<br/>[AccountModal.tsx]"]
  node_settings["AI and theme settings<br/>[SettingsModal.tsx]"]
  node_triage_badge["Triage badge<br/>[TriageBadge.tsx]"]
  node_palette["Command palette<br/>[CommandPalette.tsx]"]
end

subgraph group_ipc["Rust application core"]
  node_commands["IPC commands<br/>[commands.rs]"]
  node_runtime["Tauri runtime<br/>[lib.rs]"]
end

subgraph group_mail["Mail and authentication"]
  node_mail_engine["IMAP and SMTP<br/>[imap.rs]"]
  node_oauth["OAuth flow<br/>[oauth2.rs]"]
end

subgraph group_intelligence["AI and learning"]
  node_ai_engine["AI providers and triage<br/>[mod.rs]"]
  node_database[("Local SQLite store<br/>[mod.rs]")]
  node_learning["Correction learning<br/>[learning.rs]"]
end

node_user(("User"))
node_email_service["Mail providers"]
node_ai_service["Chosen AI endpoint"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_mail_list
node_app -->|"renders"| node_reader
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_palette
node_app -->|"renders"| node_account_ui
node_sidebar -->|"renders"| node_workspace
node_mail_list -->|"renders"| node_triage_badge
node_reader -->|"renders"| node_triage_badge
node_app -->|"invokes learning"| node_commands
node_account_ui -.->|"configures accounts"| node_commands
node_runtime -->|"registers handlers"| node_commands
node_runtime -->|"initializes"| node_database
node_commands -->|"dispatches mail"| node_mail_engine
node_commands -->|"dispatches OAuth"| node_oauth
node_commands -->|"dispatches AI"| node_ai_engine
node_commands -->|"uses store"| node_database
node_database -->|"declares learning module"| node_learning
node_ai_engine -->|"uses corrections"| node_learning
node_mail_engine -.->|"syncs and sends"| node_email_service
node_oauth -.->|"authenticates accounts"| node_email_service
node_ai_engine -.->|"requests completions"| node_ai_service
node_settings -.->|"selects provider"| node_ai_engine
node_mail_list -.->|"searches locally"| node_database
node_reader -.->|"requests AI replies"| node_commands

click node_app "https://github.com/louiscambier/auramail/blob/main/src/App.tsx"
click node_workspace "https://github.com/louiscambier/auramail/blob/main/src/components/workspace/WorkspaceSwitcher.tsx"
click node_sidebar "https://github.com/louiscambier/auramail/blob/main/src/components/layout/ZenSidebar.tsx"
click node_mail_list "https://github.com/louiscambier/auramail/blob/main/src/components/mail/MailList.tsx"
click node_reader "https://github.com/louiscambier/auramail/blob/main/src/components/mail/MailReader.tsx"
click node_account_ui "https://github.com/louiscambier/auramail/blob/main/src/components/mail/AccountModal.tsx"
click node_settings "https://github.com/louiscambier/auramail/blob/main/src/components/ai/SettingsModal.tsx"
click node_triage_badge "https://github.com/louiscambier/auramail/blob/main/src/components/ai/TriageBadge.tsx"
click node_palette "https://github.com/louiscambier/auramail/blob/main/src/components/layout/CommandPalette.tsx"
click node_commands "https://github.com/louiscambier/auramail/blob/main/src-tauri/src/commands.rs"
click node_mail_engine "https://github.com/louiscambier/auramail/blob/main/src-tauri/src/mail/imap.rs"
click node_oauth "https://github.com/louiscambier/auramail/blob/main/src-tauri/src/auth/oauth2.rs"
click node_ai_engine "https://github.com/louiscambier/auramail/blob/main/src-tauri/src/ai/mod.rs"
click node_database "https://github.com/louiscambier/auramail/blob/main/src-tauri/src/db/mod.rs"
click node_learning "https://github.com/louiscambier/auramail/blob/main/src-tauri/src/db/learning.rs"
click node_runtime "https://github.com/louiscambier/auramail/blob/main/src-tauri/src/lib.rs"

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,node_workspace,node_sidebar,node_mail_list,node_reader,node_account_ui,node_settings,node_triage_badge,node_palette,node_user toneBlue
class node_commands,node_runtime toneAmber
class node_mail_engine,node_oauth toneMint
class node_ai_engine,node_database,node_learning toneRose
class node_email_service,node_ai_service toneIndigo
```

## Components

### Desktop interface

- [App shell](https://github.com/louiscambier/auramail/blob/main/src/App.tsx): `src/App.tsx`
- [Workspace switcher](https://github.com/louiscambier/auramail/blob/main/src/components/workspace/WorkspaceSwitcher.tsx): `src/components/workspace/WorkspaceSwitcher.tsx`
- [Zen sidebar](https://github.com/louiscambier/auramail/blob/main/src/components/layout/ZenSidebar.tsx): `src/components/layout/ZenSidebar.tsx`
- [Mail list](https://github.com/louiscambier/auramail/blob/main/src/components/mail/MailList.tsx): `src/components/mail/MailList.tsx`
- [Message reader](https://github.com/louiscambier/auramail/blob/main/src/components/mail/MailReader.tsx): `src/components/mail/MailReader.tsx`
- [Account setup](https://github.com/louiscambier/auramail/blob/main/src/components/mail/AccountModal.tsx): `src/components/mail/AccountModal.tsx`
- [AI and theme settings](https://github.com/louiscambier/auramail/blob/main/src/components/ai/SettingsModal.tsx): `src/components/ai/SettingsModal.tsx`
- [Triage badge](https://github.com/louiscambier/auramail/blob/main/src/components/ai/TriageBadge.tsx): `src/components/ai/TriageBadge.tsx`
- [Command palette](https://github.com/louiscambier/auramail/blob/main/src/components/layout/CommandPalette.tsx): `src/components/layout/CommandPalette.tsx`

### Rust application core

- [IPC commands](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`
- [Tauri runtime](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Mail and authentication

- [IMAP and SMTP](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/mail/imap.rs): `src-tauri/src/mail/imap.rs`
- [OAuth flow](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/auth/oauth2.rs): `src-tauri/src/auth/oauth2.rs`

### AI and learning

- [AI providers and triage](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/ai/mod.rs): `src-tauri/src/ai/mod.rs`
- [Local SQLite store](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/db/mod.rs): `src-tauri/src/db/mod.rs`
- [Correction learning](https://github.com/louiscambier/auramail/blob/main/src-tauri/src/db/learning.rs): `src-tauri/src/db/learning.rs`

### Other components

- **User**
- **Mail providers**
- **Chosen AI endpoint**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Zen sidebar: renders (evidence: `src/App.tsx`)
- App shell → Mail list: renders (evidence: `src/App.tsx`)
- App shell → Message reader: renders (evidence: `src/App.tsx`)
- App shell → AI and theme settings: renders (evidence: `src/App.tsx`)
- App shell → Command palette: renders (evidence: `src/App.tsx`)
- App shell → Account setup: renders (evidence: `src/App.tsx`)
- Zen sidebar → Workspace switcher: renders (evidence: `src/components/layout/ZenSidebar.tsx`)
- Mail list → Triage badge: renders (evidence: `src/components/mail/MailList.tsx`)
- Message reader → Triage badge: renders (evidence: `src/components/mail/MailReader.tsx`)
- App shell → IPC commands: invokes learning (evidence: `src/App.tsx`)
- Account setup → IPC commands: configures accounts
- Tauri runtime → IPC commands: registers handlers (evidence: `src-tauri/src/lib.rs`)
- Tauri runtime → Local SQLite store: initializes (evidence: `src-tauri/src/lib.rs`)
- IPC commands → IMAP and SMTP: dispatches mail (evidence: `src-tauri/src/commands.rs`)
- IPC commands → OAuth flow: dispatches OAuth (evidence: `src-tauri/src/commands.rs`)
- IPC commands → AI providers and triage: dispatches AI (evidence: `src-tauri/src/commands.rs`)
- IPC commands → Local SQLite store: uses store (evidence: `src-tauri/src/commands.rs`)
- Local SQLite store → Correction learning: declares learning module (evidence: `src-tauri/src/db/mod.rs`)
- AI providers and triage → Correction learning: uses corrections (evidence: `src-tauri/src/ai/mod.rs`)
- IMAP and SMTP → Mail providers: syncs and sends (evidence: `README.md`)
- OAuth flow → Mail providers: authenticates accounts (evidence: `README.md`)
- AI providers and triage → Chosen AI endpoint: requests completions (evidence: `README.md`)
- AI and theme settings → AI providers and triage: selects provider (evidence: `README.md`)
- Mail list → Local SQLite store: searches locally (evidence: `README.md`)
- Message reader → IPC commands: requests AI replies (evidence: `README.md`)
