docs/architecture/feature-modules.md
The Thunderbird for Android project is organized into multiple feature modules, each encapsulating a specific functionality of the application. This document provides an overview of the main feature modules, how they are split into subfeatures, and how the application can be extended with additional features.
When developing new feature modules or extending existing ones, follow these best practices:
By following these guidelines, the Thunderbird for Android application can maintain a clean, modular architecture while expanding its functionality to meet user needs.
The application is composed of several core feature modules, each responsible for a specific aspect of the application's functionality:
graph TB
subgraph FEATURE[App Features]
direction TB
subgraph ROW_2[" "]
direction LR
SETTINGS["`**Settings**
App configuration`"]
NOTIFICATION["`**Notification**
Push and alert handling`"]
SEARCH["`**Search**
Content discovery`"]
WIDGET["`**Widget**
Home screen components`"]
end
subgraph ROW_1[" "]
direction LR
ACCOUNT["`**Account**
User accounts management`"]
MAIL["`**Mail**
Email handling and display`"]
DRAWER["`**Navigation**
App navigation UI components`"]
ONBOARDING["`**Onboarding**
User setup and introduction`"]
end
end
classDef row fill: #d9ffd9, stroke: #d9ffd9, color: #d9ffd9
classDef feature fill: #d9ffd9,stroke: #000000, color: #000000
classDef feature_module fill: #33cc33, stroke: #000000, color:#000000
class ROW_1,ROW_2 row
class FEATURE feature
class ACCOUNT,MAIL,NAVIGATION,ONBOARDING,SETTINGS,NOTIFICATION,SEARCH,WIDGET feature_module
The Account module manages all aspects of email accounts, including setup, configuration, and authentication.
feature:account
āāā feature:account:api
āāā feature:account:internal
āāā feature:account:setup
ā āāā feature:account:setup:api
ā āāā feature:account:setup:internal
āāā feature:account:settings
ā āāā feature:account:settings:api
ā āāā feature:account:settings:internal
āāā feature:account:server
ā āāā feature:account:server:api
ā āāā feature:account:server:internal
ā āāā feature:account:server:certificate
ā ā āāā feature:account:server:certificate:api
ā ā āāā feature:account:server:certificate:internal
ā āāā feature:account:server:settings
ā ā āāā feature:account:server:settings:api
ā ā āāā feature:account:server:settings:internal
ā āāā feature:account:server:validation
ā āāā feature:account:server:validation:api
ā āāā feature:account:server:validation:internal
āāā feature:account:auth
ā āāā feature:account:auth:api
ā āāā feature:account:auth:internal
ā āāā feature:account:auth:oauth
ā āāā feature:account:auth:oauth:api
ā āāā feature:account:auth:oauth:internal
āāā feature:account:storage
āāā feature:account:storage:api
āāā feature:account:storage:internal
āāā feature:account:storage:legacy
āāā feature:account:storage:legacy:api
āāā feature:account:storage:legacy:internal
The Mail module handles core email functionality, including message display, composition, and folder management.
feature:mail
āāā feature:mail:api
āāā feature:mail:internal
āāā feature:mail:account
ā āāā feature:mail:account:api
ā āāā feature:mail:account:internal
āāā feature:mail:folder
ā āāā feature:mail:folder:api
ā āāā feature:mail:folder:internal
āāā feature:mail:compose
ā āāā feature:mail:compose:api
ā āāā feature:mail:compose:internal
āāā feature:mail:message
āāā feature:mail:message:api
āāā feature:mail:message:internal
āāā feature:mail:message:view
ā āāā feature:mail:message:view:api
ā āāā feature:mail:message:view:internal
āāā feature:mail:message:list
āāā feature:mail:message:list:api
āāā feature:mail:message:list:internal
The Navigation module is part of the core UI and provides infrastructure for navigating through the application.
core:ui:navigation
The Navigation Drawer module provides UI components for the main application navigation drawer, including dropdown and other variations if any.
feature:navigation:drawer
āāā feature:navigation:drawer:api
āāā feature:navigation:drawer:internal
āāā feature:navigation:drawer:dropdown
āāā feature:navigation:drawer:dropdown:api
āāā feature:navigation:drawer:dropdown:internal
The Onboarding module guides new users through the initial setup process.
feature:onboarding
āāā feature:onboarding:api
āāā feature:onboarding:internal
āāā feature:onboarding:main
ā āāā feature:onboarding:main:api
ā āāā feature:onboarding:main:internal
āāā feature:onboarding:welcome
ā āāā feature:onboarding:welcome:api
ā āāā feature:onboarding:welcome:internal
āāā feature:onboarding:permissions
ā āāā feature:onboarding:permissions:api
ā āāā feature:onboarding:permissions:internal
āāā feature:onboarding:migration
āāā feature:onboarding:migration:api
āāā feature:onboarding:migration:internal
āāā feature:onboarding:migration:thunderbird
ā āāā feature:onboarding:migration:thunderbird:api
ā āāā feature:onboarding:migration:thunderbird:internal
āāā feature:onboarding:migration:noop
āāā feature:onboarding:migration:noop:api
āāā feature:onboarding:migration:noop:internal
The Settings module provides interfaces for configuring application behavior.
feature:settings
āāā feature:settings:api
āāā feature:settings:internal
āāā feature:settings:import
ā āāā feature:settings:import:api
ā āāā feature:settings:import:internal
āāā feature:settings:ui
āāā feature:settings:ui:api
āāā feature:settings:ui:internal
The Notification module handles push notifications and alerts for new emails and events.
feature:notification
āāā feature:notification:api
āāā feature:notification:internal
āāā feature:notification:email
ā āāā feature:notification:email:api
ā āāā feature:notification:email:internal
āāā feature:notification:push
āāā feature:notification:push:api
āāā feature:notification:push:internal
The Search module provides functionality for searching through emails and contacts.
feature:search
āāā feature:search:api
āāā feature:search:internal
āāā feature:search:email
ā āāā feature:search:email:api
ā āāā feature:search:email:internal
āāā feature:search:contact
ā āāā feature:search:contact:api
ā āāā feature:search:contact:internal
āāā feature:search:ui
āāā feature:search:ui:api
āāā feature:search:ui:internal
The Widget module provides home screen widgets for quick access to email functionality.
feature:widget
āāā feature:widget:api
āāā feature:widget:internal
āāā feature:widget:message-list
ā āāā feature:widget:message-list:api
ā āāā feature:widget:message-list:internal
āāā feature:widget:message-list-glance
ā āāā feature:widget:message-list-glance:api
ā āāā feature:widget:message-list-glance:internal
āāā feature:widget:shortcut
ā āāā feature:widget:shortcut:api
ā āāā feature:widget:shortcut:internal
āāā feature:widget:unread
āāā feature:widget:unread:api
āāā feature:widget:unread:internal
In addition to the core email functionality, the application includes several supporting feature modules:
The Autodiscovery module automatically detects email server settings.
feature:autodiscovery:api): Public interfacesfeature:autodiscovery:autoconfig): Automatic configurationfeature:autodiscovery:service): Service implementationfeature:autodiscovery:demo): Demonstration implementationThe Funding module handles in-app financial contributions and funding options.
feature:funding:api): Public interfacesfeature:funding:googleplay): Google Play billing integrationfeature:funding:link): External funding link handlingfeature:funding:noop): No-operation implementationThe Migration module handles data migration between different email clients.
feature:migration:provider): Migration data providersfeature:migration:qrcode): QR code-based migrationfeature:migration:launcher): Migration launcher
feature:migration:launcher:api): Launcher interfacesfeature:migration:launcher:noop): No-operation implementationfeature:migration:launcher:thunderbird): Thunderbird-specific implementationThe Telemetry module handles usage analytics and reporting.
feature:telemetry:api): Public interfacesfeature:telemetry:noop): No-operation implementationfeature:telemetry:glean): Mozilla Glean integrationThe modular architecture of Thunderbird for Android allows for easy extension with additional features. To give you an idea how the app could be extended when building a new feature, here are some theoretical examples along with their structure:
A Calendar feature could be added to integrate calendar functionality with email.
feature:calendar
āāā feature:calendar:api
āāā feature:calendar:internal
āāā feature:calendar:event
ā āāā feature:calendar:event:api
ā āāā feature:calendar:event:internal
āāā feature:calendar:sync
āāā feature:calendar:sync:api
āāā feature:calendar:sync:internal
An Appointments feature could manage meetings and appointments.
feature:appointment
āāā feature:appointment:api
āāā feature:appointment:internal
āāā feature:appointment:scheduler
ā āāā feature:appointment:scheduler:api
ā āāā feature:appointment:scheduler:internal
āāā feature:appointment:notification
āāā feature:appointment:notification:api
āāā feature:appointment:notification:internal
Features in the application interact with each other through well-defined APIs. The diagram below illustrates the relationships between different features:
graph TB
subgraph CORE[Core Features]
ACCOUNT[Account]
MAIL[Mail]
end
subgraph EXTENSIONS[Potential Extensions]
CALENDAR[Calendar]
APPOINTMENT[Appointments]
end
MAIL --> |uses| ACCOUNT
CALENDAR --> |integrates with| MAIL
CALENDAR --> |uses| ACCOUNT
APPOINTMENT --> |uses| ACCOUNT
APPOINTMENT --> |integrates with| CALENDAR
APPOINTMENT --> |uses| MAIL
linkStyle default stroke:#999,stroke-width:2px
classDef core fill:#e8c8ff,stroke:#000000,color:#000000
classDef core_module fill:#c090ff,stroke:#000000,color:#000000
classDef extension fill:#d0e0ff,stroke:#000000,color:#000000
classDef extension_module fill:#8090ff,stroke:#000000,color:#000000
class CORE core
class ACCOUNT,MAIL,NAVIGATION,SETTINGS core_module
class EXTENSIONS extension
class CALENDAR,TODO,SYNC,NOTES,APPOINTMENT extension_module