diff --git a/docs/docs/developer-guide/modules.md b/docs/docs/developer-guide/modules.md index e64e4ff7..577d9ef2 100644 --- a/docs/docs/developer-guide/modules.md +++ b/docs/docs/developer-guide/modules.md @@ -4,13 +4,13 @@ sidebar_position: 3 # Modules -The project contains of multiple Gradle modules. The structure is kinde scuffed because I didn't know shit when I -started this project so future refacorings are to be expected. This is the current structure: +The project contains of multiple Gradle modules. The structure is kinda scuffed because I didn't know shit when I +started this project so future refactorings are to be expected. This is the current structure: - `:app`: - - `:app`: The app module. Contains almost nothing except for the `Application` class (`de.mm20.launcher2.LauncherApplication`) + - `:app`: The app module. Contains almost nothing except the `Application` class (`de.mm20.launcher2.LauncherApplication`) - `:ui`: Contains almost the entire user interface (except for account sign-in UIs). The only module that uses Jetpack Compose. -- `:services`: Higher level APIs for the app's business logic +- `:services`: Higher level APIs for the app's business logic. Each module represents a specific functionality of the launcher - `:accounts`: Common APIs to manage different account types (Google, Microsoft, Nextcloud, …) - `:backup`: Backup and restore functionality - `:badges`: Provide different types of badges that are displayed on app icons @@ -18,7 +18,8 @@ started this project so future refacorings are to be expected. This is the curre - `:music`: Manage media sessions and extract metadata - `:search`: The search. - `:tags`: Edit, copy and delete tags -- `:data`: Lower level APIs for CRUD operations for different kinds of data. Most of these should be refactored. + - `:widgets`: High-level APIs to manage widgets +- `:data`: Lower level APIs. Generally, these modules are more multi-purpose and provide the data that is consumed by the `:services` modules. - `:applications`: Installed apps and app search - `:appshortcuts`: Query apps shortcuts for apps and shortcut search - `:calendar`: query calendar events for the calendar widget and calendar search @@ -32,7 +33,7 @@ started this project so future refacorings are to be expected. This is the curre - `:notifications`: APIs to read notifications. Contains the app's `NotificationListenerService` - `:websites`: Website search - `:weather`: APIs to fetch weather data - - `:widgets`: Manages configuration of widgets (which widgets and which order). Actual widget implementation (for built-in widgets) is in `:ui`. + - `:widgets`: CRUD operations to store and retrieve widgets in/from the database - `:wikipedia`: APIs to search Wikipedia - `:core` - `:base`: Commonly used data classes, helper functions and utilities. Also icon resources (if they do not need localization). @@ -52,6 +53,6 @@ started this project so future refacorings are to be expected. This is the curre - `:owncloud`: Owncloud APIs and Owncloud sign-in; used by `:accounts` and `:files` -Most of the modules have a `Module.kt` file in their root which contains Koin definitions to make the APIs accessable for other modules. +Most of the modules have a `Module.kt` file in their root which contains Koin definitions to make the APIs accessible to other modules. [![](/img/dependency-graph.dot.png)](/img/dependency-graph.dot.png)) diff --git a/docs/static/img/dependency-graph.dot b/docs/static/img/dependency-graph.dot index 82eb6d58..b504a77f 100644 --- a/docs/static/img/dependency-graph.dot +++ b/docs/static/img/dependency-graph.dot @@ -40,10 +40,12 @@ digraph { ":services:accounts" [fillcolor="#ff9498"]; ":services:backup" [fillcolor="#ff9498"]; ":services:badges" [fillcolor="#ff9498"]; + ":services:global-actions" [fillcolor="#ff9498"]; ":services:icons" [fillcolor="#ff9498"]; ":services:music" [fillcolor="#ff9498"]; ":services:search" [fillcolor="#ff9498"]; ":services:tags" [fillcolor="#ff9498"]; + ":services:widgets" [fillcolor="#ff9498"]; {rank = same;} @@ -76,6 +78,7 @@ digraph { ":app:app" -> ":core:permissions" [style=dotted] ":app:app" -> ":core:preferences" [style=dotted] ":app:app" -> ":services:search" [style=dotted] + ":app:app" -> ":services:tags" [style=dotted] ":app:app" -> ":data:unitconverter" [style=dotted] ":app:app" -> ":app:ui" [style=dotted] ":app:app" -> ":data:weather" [style=dotted] @@ -84,6 +87,8 @@ digraph { ":app:app" -> ":data:wikipedia" [style=dotted] ":app:app" -> ":core:database" [style=dotted] ":app:app" -> ":data:search-actions" [style=dotted] + ":app:app" -> ":services:global-actions" [style=dotted] + ":app:app" -> ":services:widgets" [style=dotted] ":app:ui" -> ":app:ui" ":app:ui" -> ":libs:material-color-utilities" [style=dotted] ":app:ui" -> ":core:base" [style=dotted] @@ -92,6 +97,7 @@ digraph { ":app:ui" -> ":core:ktx" [style=dotted] ":app:ui" -> ":services:icons" [style=dotted] ":app:ui" -> ":services:music" [style=dotted] + ":app:ui" -> ":services:tags" [style=dotted] ":app:ui" -> ":data:weather" [style=dotted] ":app:ui" -> ":data:calendar" [style=dotted] ":app:ui" -> ":services:search" [style=dotted] @@ -117,6 +123,8 @@ digraph { ":app:ui" -> ":services:accounts" [style=dotted] ":app:ui" -> ":services:backup" [style=dotted] ":app:ui" -> ":data:search-actions" [style=dotted] + ":app:ui" -> ":services:global-actions" [style=dotted] + ":app:ui" -> ":services:widgets" [style=dotted] ":core:base" -> ":core:base" ":core:base" -> ":core:ktx" [style=dotted] ":core:base" -> ":core:i18n" [style=dotted] @@ -192,6 +200,7 @@ digraph { ":data:files" -> ":libs:owncloud" [style=dotted] ":data:files" -> ":core:i18n" [style=dotted] ":data:files" -> ":core:permissions" [style=dotted] + ":data:files" -> ":core:crashreporter" [style=dotted] ":data:notifications" -> ":data:notifications" ":data:notifications" -> ":core:permissions" [style=dotted] ":data:search-actions" -> ":data:search-actions" @@ -266,6 +275,11 @@ digraph { ":services:badges" -> ":core:preferences" [style=dotted] ":services:badges" -> ":core:base" [style=dotted] ":services:badges" -> ":data:files" [style=dotted] + ":services:global-actions" -> ":services:global-actions" + ":services:global-actions" -> ":core:preferences" [style=dotted] + ":services:global-actions" -> ":core:base" [style=dotted] + ":services:global-actions" -> ":core:i18n" [style=dotted] + ":services:global-actions" -> ":core:permissions" [style=dotted] ":services:icons" -> ":data:customattrs" ":services:icons" -> ":services:icons" ":services:icons" -> ":core:database" [style=dotted] @@ -301,4 +315,10 @@ digraph { ":services:tags" -> ":core:base" [style=dotted] ":services:tags" -> ":core:ktx" [style=dotted] ":services:tags" -> ":core:crashreporter" [style=dotted] + ":services:tags" -> ":data:customattrs" [style=dotted] + ":services:tags" -> ":data:favorites" [style=dotted] + ":services:widgets" -> ":services:widgets" + ":services:widgets" -> ":core:base" [style=dotted] + ":services:widgets" -> ":core:i18n" [style=dotted] + ":services:widgets" -> ":data:widgets" [style=dotted] } diff --git a/docs/static/img/dependency-graph.dot.png b/docs/static/img/dependency-graph.dot.png index 8c70fca5..a3957425 100644 Binary files a/docs/static/img/dependency-graph.dot.png and b/docs/static/img/dependency-graph.dot.png differ