# the-djmaze/snappymail architecture

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

- Interactive diagram: https://gitdiagram.com/the-djmaze/snappymail
- Repository: https://github.com/the-djmaze/snappymail

## Overview

SnappyMail is a browser-based email client with separate user and administrator interfaces. A user signs in, works with mail and attachments, manages contacts and account settings, and can edit server-side Sieve filters; encryption and groupware integrations extend that workflow. The graph reflects the provided tree, README capabilities, and sampled storage, Sieve, and Nextcloud code. Frontend and core request wiring was not sampled, so some subsystem connections are intentionally omitted.

Main entry points: [`dev/Remote/User/Fetch.js`](https://github.com/the-djmaze/snappymail/blob/master/dev/Remote/User/Fetch.js) (User requests), [`dev/app.js`](https://github.com/the-djmaze/snappymail/blob/master/dev/app.js) (User application), [`dev/boot.js`](https://github.com/the-djmaze/snappymail/blob/master/dev/boot.js) (Client bootstrap), [`dev/Screen/User/MailBox.js`](https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/User/MailBox.js) (Mailbox screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_boot["Client bootstrap<br/>[boot.js]"]
  node_userapp["User application<br/>[app.js]"]
  node_adminapp["Admin application<br/>[admin.js]"]
  node_login["Login screens<br/>[Login.js]"]
end

subgraph group_mail["Mail workflow"]
  node_mailbox["Mailbox screens<br/>[MailBox.js]"]
  node_mailviews["Mail views<br/>[MessageView.js]"]
  node_compose["Compose view<br/>[Compose.js]"]
  node_mailmodels["Mail models<br/>[Email.js]"]
  node_attachments["Attachments<br/>[Attachment.js]"]
end

subgraph group_account["Accounts and settings"]
  node_contacts["Contacts<br/>[Contact.js]"]
  node_settings["User settings<br/>[Settings.js]"]
  node_adminsettings["Admin settings<br/>[Settings.js]"]
end

subgraph group_server["Server services"]
  node_userfetch["User requests<br/>[Fetch.js]"]
  node_adminfetch["Admin requests<br/>[Fetch.js]"]
  node_storageapi["Storage provider<br/>[Storage.php]"]
  node_filestorage["File storage<br/>[FileStorage.php]"]
  node_files["File service<br/>[FileStorage.php]"]
  node_sieve["Sieve service<br/>[SieveStorage.php]"]
  node_datafiles[("Local data files")]
end

subgraph group_extensions["Extensions"]
  node_sieveui["Sieve editor<br/>[Filter.js]"]
  node_crypto["Encryption options<br/>[OpenPGP.js]"]
  node_groupware["Kolab support"]
  node_nextcloud["Nextcloud integration"]
end

node_user(("User"))
node_browser(("Browser"))
node_mailservers["Mail servers"]
node_sieveserver["Sieve server"]

node_user -->|"uses"| node_browser
node_browser -->|"loads"| node_boot
node_boot -->|"starts"| node_userapp
node_boot -->|"starts"| node_adminapp
node_userapp -->|"presents"| node_login
node_userapp -->|"presents"| node_mailbox
node_userapp -->|"presents"| node_settings
node_adminapp -->|"presents"| node_adminsettings
node_mailbox -->|"displays"| node_mailviews
node_mailviews -->|"uses"| node_mailmodels
node_compose -->|"edits"| node_mailmodels
node_compose -->|"manages"| node_attachments
node_mailbox -->|"requests"| node_userfetch
node_login -->|"requests"| node_userfetch
node_settings -->|"requests"| node_userfetch
node_adminsettings -->|"requests"| node_adminfetch
node_userfetch -->|"exchanges mail"| node_mailservers
node_userfetch -->|"uses"| node_storageapi
node_storageapi -->|"delegates"| node_filestorage
node_filestorage -->|"reads and writes"| node_datafiles
node_userfetch -->|"uses"| node_files
node_settings -->|"opens filters"| node_sieveui
node_sieveui -->|"requests"| node_userfetch
node_sieve -->|"connects"| node_sieveserver
node_crypto -.->|"supports encryption"| node_mailviews
node_mailservers -.->|"supports"| node_groupware
node_nextcloud -.->|"integrates"| node_userapp

click node_boot "https://github.com/the-djmaze/snappymail/blob/master/dev/boot.js"
click node_userapp "https://github.com/the-djmaze/snappymail/blob/master/dev/app.js"
click node_adminapp "https://github.com/the-djmaze/snappymail/blob/master/dev/admin.js"
click node_login "https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/User/Login.js"
click node_mailbox "https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/User/MailBox.js"
click node_mailviews "https://github.com/the-djmaze/snappymail/blob/master/dev/View/User/MailBox/MessageView.js"
click node_compose "https://github.com/the-djmaze/snappymail/blob/master/dev/View/Popup/Compose.js"
click node_mailmodels "https://github.com/the-djmaze/snappymail/blob/master/dev/Model/Email.js"
click node_attachments "https://github.com/the-djmaze/snappymail/blob/master/dev/Model/Attachment.js"
click node_contacts "https://github.com/the-djmaze/snappymail/blob/master/dev/Model/Contact.js"
click node_settings "https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/User/Settings.js"
click node_adminsettings "https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/Admin/Settings.js"
click node_userfetch "https://github.com/the-djmaze/snappymail/blob/master/dev/Remote/User/Fetch.js"
click node_adminfetch "https://github.com/the-djmaze/snappymail/blob/master/dev/Remote/Admin/Fetch.js"
click node_storageapi "https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Storage.php"
click node_filestorage "https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Storage/FileStorage.php"
click node_files "https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Files/FileStorage.php"
click node_sieve "https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php"
click node_sieveui "https://github.com/the-djmaze/snappymail/blob/master/dev/Sieve/View/Filter.js"
click node_crypto "https://github.com/the-djmaze/snappymail/blob/master/dev/Stores/User/OpenPGP.js"
click node_nextcloud "https://github.com/the-djmaze/snappymail/blob/master/integrations/nextcloud/snappymail/lib/Controller/FetchController.php"

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_boot,node_userapp,node_adminapp,node_login,node_user,node_browser toneBlue
class node_mailbox,node_mailviews,node_compose,node_mailmodels,node_attachments toneAmber
class node_contacts,node_settings,node_adminsettings,node_mailservers,node_sieveserver toneMint
class node_userfetch,node_adminfetch,node_storageapi,node_filestorage,node_files,node_sieve,node_datafiles toneRose
class node_sieveui,node_crypto,node_groupware,node_nextcloud toneIndigo
```

## Components

### Web client

- [Client bootstrap](https://github.com/the-djmaze/snappymail/blob/master/dev/boot.js): `dev/boot.js`
- [User application](https://github.com/the-djmaze/snappymail/blob/master/dev/app.js): `dev/app.js`
- [Admin application](https://github.com/the-djmaze/snappymail/blob/master/dev/admin.js): `dev/admin.js`
- [Login screens](https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/User/Login.js): `dev/Screen/User/Login.js`

### Mail workflow

- [Mailbox screens](https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/User/MailBox.js): `dev/Screen/User/MailBox.js`
- [Mail views](https://github.com/the-djmaze/snappymail/blob/master/dev/View/User/MailBox/MessageView.js): `dev/View/User/MailBox/MessageView.js`
- [Compose view](https://github.com/the-djmaze/snappymail/blob/master/dev/View/Popup/Compose.js): `dev/View/Popup/Compose.js`
- [Mail models](https://github.com/the-djmaze/snappymail/blob/master/dev/Model/Email.js): `dev/Model/Email.js`
- [Attachments](https://github.com/the-djmaze/snappymail/blob/master/dev/Model/Attachment.js): `dev/Model/Attachment.js`

### Accounts and settings

- [Contacts](https://github.com/the-djmaze/snappymail/blob/master/dev/Model/Contact.js): `dev/Model/Contact.js`
- [User settings](https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/User/Settings.js): `dev/Screen/User/Settings.js`
- [Admin settings](https://github.com/the-djmaze/snappymail/blob/master/dev/Screen/Admin/Settings.js): `dev/Screen/Admin/Settings.js`

### Server services

- [User requests](https://github.com/the-djmaze/snappymail/blob/master/dev/Remote/User/Fetch.js): `dev/Remote/User/Fetch.js`
- [Admin requests](https://github.com/the-djmaze/snappymail/blob/master/dev/Remote/Admin/Fetch.js): `dev/Remote/Admin/Fetch.js`
- [Storage provider](https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Storage.php): `snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Storage.php`
- [File storage](https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Storage/FileStorage.php): `snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Storage/FileStorage.php`
- [File service](https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Files/FileStorage.php): `snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Files/FileStorage.php`
- [Sieve service](https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php): `snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Filters/SieveStorage.php`
- **Local data files**

### Extensions

- [Sieve editor](https://github.com/the-djmaze/snappymail/blob/master/dev/Sieve/View/Filter.js): `dev/Sieve/View/Filter.js`
- [Encryption options](https://github.com/the-djmaze/snappymail/blob/master/dev/Stores/User/OpenPGP.js): `dev/Stores/User/OpenPGP.js`
- **Kolab support**
- [Nextcloud integration](https://github.com/the-djmaze/snappymail/blob/master/integrations/nextcloud/snappymail/lib/Controller/FetchController.php): `integrations/nextcloud/snappymail/lib/Controller/FetchController.php`

### Other components

- **User**
- **Browser**
- **Mail servers**
- **Sieve server**

## Connections

- User → Browser: uses
- Browser → Client bootstrap: loads
- Client bootstrap → User application: starts
- Client bootstrap → Admin application: starts
- User application → Login screens: presents
- User application → Mailbox screens: presents
- User application → User settings: presents
- Admin application → Admin settings: presents
- Mailbox screens → Mail views: displays
- Mail views → Mail models: uses
- Compose view → Mail models: edits
- Compose view → Attachments: manages
- Mailbox screens → User requests: requests
- Login screens → User requests: requests
- User settings → User requests: requests
- Admin settings → Admin requests: requests
- User requests → Mail servers: exchanges mail
- User requests → Storage provider: uses
- Storage provider → File storage: delegates
- File storage → Local data files: reads and writes
- User requests → File service: uses
- User settings → Sieve editor: opens filters
- Sieve editor → User requests: requests
- Sieve service → Sieve server: connects
- Encryption options → Mail views: supports encryption
- Mail servers → Kolab support: supports
- Nextcloud integration → User application: integrates
