Skip to content

Commit d4ac7c5

Browse files
committed
release 1.0.0: simplify app structure
release 1.0.0: simplify app structure
1 parent 686fa71 commit d4ac7c5

File tree

446 files changed

+2368
-2684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

446 files changed

+2368
-2684
lines changed

README.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Run your project to check what is included and how it works, and once everything
4848

4949
## Frontend
5050

51-
The overall client architecture follows [the recommended guidelines](https://developer.android.com/modern-android-development) and is built on:
51+
The overall client architecture follows [the recommended guidelines](https://developer.android.com/topic/architecture/recommendations) and is built on:
5252
- [Compose Multiplatform UI Framework](https://www.jetbrains.com/lp/compose-multiplatform/)
5353
- [Compose Multiplatform Images and resources](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-images-resources.html)
5454
- [Jetpack Compose](https://developer.android.com/develop/ui/compose)
@@ -62,20 +62,21 @@ Application logic is implemented in the `app` module and contains only app-speci
6262

6363
All common logic is part of the shared group, which is split into three modules:
6464

65-
- **presentation** - architectural solutions to integrate app components with each other.
66-
- **data** - data sources to use in the app.
67-
- **design** - the design system of the app (fonts, themes, UI components, etc.).
65+
- **presentation** - [Presentation Layer](https://developer.android.com/topic/architecture/ui-layer).
66+
- **data** - [Data Layer](https://developer.android.com/topic/architecture/data-layer).
67+
- **domain** - [Domain Layer](https://developer.android.com/topic/architecture/domain-layer).
6868

6969
These modules are used only at the app level. This approach lets you develop all three components independently and create a more complex app structure. For example, app-specific features can be implemented as separate modules, having the same shared dependencies.
7070

7171
### Module - presentation
7272

73-
Provides architectural solutions to implement user flows and integrate all components with each other in a lifecycle-aware manner.
73+
Provides architectural solutions and design system of the app to implement user flows and integrate all components with each other in a lifecycle-aware manner.
7474

7575
It includes:
7676

7777
- **MVVM pattern implementation** - based on the [Jetpack ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) and [Jetpack Lifecycle](https://developer.android.com/topic/libraries/architecture/lifecycle) components.
7878
- **Navigation integration** - based on the [Jetpack Navigation](https://developer.android.com/guide/navigation) component.
79+
- **UI Components** - [Design System](https://en.m.wikipedia.org/wiki/Design_system) of the entire app based on the [Google Material 3 Design](https://m3.material.io).
7980

8081
The included solutions are not mandatory to follow, as all required dependencies are properly included to enable you to use your own patterns with Jetpack components.
8182

@@ -85,23 +86,14 @@ Feel free to choose what fits your needs best.
8586

8687
### Module - data
8788

88-
Provides a fundamental implementation of commonly used data sources in different apps. During project setup via [Kotli](https://kotli.xyz), only the required data sources will be included.
89+
Provides a fundamental implementation of commonly used data sources. During project setup via [Kotli](https://kotli.xyz), only the required data sources will be included.
8990

9091
All data sources have been configured to access the necessary data layer in a flexible and convenient manner.
9192

92-
### Module - design
93+
### Module - domain
9394

94-
Provides pre-configured themes, fonts, and UI components to establish the initial [Design System](https://en.m.wikipedia.org/wiki/Design_system) of the entire app.
95-
96-
The default module implementation is based on the [Google Material 3 Design](https://m3.material.io), which offers all fundamental UI components and guidelines out of the box, enabling the creation of your own Design System with ease.
97-
98-
In addition to the Material 3 library, the module implements several components and containers used in different user flows.
99-
100-
The main idea of this module is to create a **Design System** that can be used by any UI feature of the app without dependency on the underlying UI kit.
101-
102-
```
103-
Existing composables in this module are examples and can be changed/removed based on your needs.
104-
```
95+
Encapsulates core business logic and shared data models (Use Cases) that are reusable across all feature-specific modules of the app.
96+
This layer serves as the backbone for handling business rules, decoupling feature modules from one another while maintaining consistency and scalability.
10597

10698
### Module - app
10799

@@ -170,14 +162,14 @@ The generated project will include a similar table in its README.MD file, but wi
170162
| Dataflow | Multiplatform Settings | [Link](docs/Dataflow/Multiplatform%20Settings/overview.md) | - | [Link](docs/Dataflow/Multiplatform%20Settings/usage.md) |
171163
| Dataflow | DataStore | [Link](docs/Dataflow/DataStore/overview.md) | - | [Link](docs/Dataflow/DataStore/usage.md) |
172164
| Dataflow | Korlibs Crypto Library | [Link](docs/Dataflow/Korlibs%20Crypto%20Library/overview.md) | - | [Link](docs/Dataflow/Korlibs%20Crypto%20Library/usage.md) |
173-
| Dataflow | Basic In-Memory Cache API | [Link](docs/Dataflow/Basic%20In-Memory%20Cache%20API/overview.md) | - | [Link](docs/Dataflow/Basic%20In-Memory%20Cache%20API/usage.md) |
174-
| Dataflow | Facade Config API | [Link](docs/Dataflow/Facade%20Config%20API/overview.md) | - | [Link](docs/Dataflow/Facade%20Config%20API/usage.md) |
165+
| Dataflow | Basic Cache API | [Link](docs/Dataflow/Basic%20Cache%20API/overview.md) | - | [Link](docs/Dataflow/Basic%20Cache%20API/usage.md) |
166+
| Dataflow | Basic Config API | [Link](docs/Dataflow/Basic%20Config%20API/overview.md) | - | [Link](docs/Dataflow/Basic%20Config%20API/usage.md) |
175167
| Dataflow | SQLDelight | [Link](docs/Dataflow/SQLDelight/overview.md) | - | [Link](docs/Dataflow/SQLDelight/usage.md) |
176168
| Dataflow | SQLite (Room) | [Link](docs/Dataflow/SQLite%20%28Room%29/overview.md) | - | [Link](docs/Dataflow/SQLite%20%28Room%29/usage.md) |
177-
| Dataflow | Ktor Client | [Link](docs/Dataflow/Ktor%20Client/overview.md) | - | [Link](docs/Dataflow/Ktor%20Client/usage.md) |
178-
| Dataflow | Cash App Paging Library | [Link](docs/Dataflow/Cash%20App%20Paging%20Library/overview.md) | - | [Link](docs/Dataflow/Cash%20App%20Paging%20Library/usage.md) |
179-
| Dataflow | Facade Analytics API | [Link](docs/Dataflow/Facade%20Analytics%20API/overview.md) | - | [Link](docs/Dataflow/Facade%20Analytics%20API/usage.md) |
180-
| Dataflow | Gemini | [Link](docs/Dataflow/Gemini/overview.md) | - | [Link](docs/Dataflow/Gemini/usage.md) |
169+
| Dataflow | Ktor HTTP Client | [Link](docs/Dataflow/Ktor%20HTTP%20Client/overview.md) | - | [Link](docs/Dataflow/Ktor%20HTTP%20Client/usage.md) |
170+
| Dataflow | Multiplatform Paging Library | [Link](docs/Dataflow/Multiplatform%20Paging%20Library/overview.md) | - | [Link](docs/Dataflow/Multiplatform%20Paging%20Library/usage.md) |
171+
| Dataflow | Basic Analytics API | [Link](docs/Dataflow/Basic%20Analytics%20API/overview.md) | - | [Link](docs/Dataflow/Basic%20Analytics%20API/usage.md) |
172+
| Dataflow | Gemini AI | [Link](docs/Dataflow/Gemini%20AI/overview.md) | - | [Link](docs/Dataflow/Gemini%20AI/usage.md) |
181173
| Userflow | Coil Image Library | [Link](docs/Userflow/Coil%20Image%20Library/overview.md) | - | [Link](docs/Userflow/Coil%20Image%20Library/usage.md) |
182174
| Userflow | Markdown Text Renderer | [Link](docs/Userflow/Markdown%20Text%20Renderer/overview.md) | - | [Link](docs/Userflow/Markdown%20Text%20Renderer/usage.md) |
183175
| Userflow | Adaptive Navigation | [Link](docs/Userflow/Adaptive%20Navigation/overview.md) | - | [Link](docs/Userflow/Adaptive%20Navigation/usage.md) |

processor/src/main/resources/kotli/template/multiplatform/compose/dataflow/analytics/facade/description.md renamed to docs/Dataflow/Basic Analytics API/overview.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
Sooner or later, the app may need to log events into an analytics system (Google Analytics, Amplitude, AppsFlyer, etc.).
1+
# About
22

3-
The Facade Analytics API provides a general functionality to start logging events from the beginning, even without an actual implementation. Later, you can add the required implementation without impacting the entire codebase.
3+
Sooner or later, the app may need to log events into an analytics system (Google Analytics, Amplitude, AppsFlyer, etc.).
4+
The Basic Analytics API provides a general functionality to start logging events from the beginning, even without an actual implementation. Later, you can add the required implementation without impacting the entire codebase.

docs/Dataflow/Facade Analytics API/usage.md renamed to docs/Dataflow/Basic Analytics API/usage.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
## Overview
44

55
The API can be accessed through:
6-
- `shared.data.source.analytics.AnalyticsSource` - facade interface at the core module level.
7-
- `app.common.data.source.analytics.AppAnalyticsSource` - decorator class at the app level.
86

9-
The difference is that the class serves as a **decorator** and can provide extra methods without impacting facade implementations.
7+
- `shared.data.source.analytics.AnalyticsSource` - facade interface at the shared module level.
108

119
Facade **AnalyticsSource** provides the following methods:
1210

@@ -18,13 +16,13 @@ Facade **AnalyticsSource** provides the following methods:
1816

1917
## Example
2018

21-
Both the **facade** and **decorator** are pre-configured via dependency injection (DI) as singletons in `app.di.common.AnalyticsSourceModule`.
19+
The **facade** is pre-configured via dependency injection (DI) as singletons in `app.common.CommonConfig`.
2220

23-
To start using, just inject any of them to your DI managed class. Recommended to use from `ViewModel` or `Repository` level.
21+
To start using, just inject your DI managed class.
2422

2523
```kotlin
26-
class TemplateViewModel (
27-
private val analyticsSource: AnalyticsSource // AppAnalyticsSource
24+
class TemplateViewModel(
25+
private val analyticsSource: AnalyticsSource
2826
) : BaseViewModel() {
2927

3028
fun onSomeAction() {
File renamed without changes.

docs/Dataflow/Basic In-Memory Cache API/usage.md renamed to docs/Dataflow/Basic Cache API/usage.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
The API can be accessed through:
66
- `shared.data.source.cache.CacheSource` - facade interface at the core module level.
7-
- `app.common.data.source.cache.AppCacheSource` - decorator class at the app level.
8-
9-
The difference is that the class serves as a **decorator** and can provide extra methods without impacting facade implementations.
107

118
Facade **CacheSource** provides the following methods:
129

@@ -19,7 +16,7 @@ Facade **CacheSource** provides the following methods:
1916

2017
## Example
2118

22-
Both the **facade** and **decorator** are pre-configured via dependency injection (DI) as singletons in `app.di.common.CacheSourceModule`.
19+
The **facade** is pre-configured via dependency injection (DI) as singletons in `app.common.CommonConfig`.
2320

2421
To start using, just inject it to your DI managed class.
2522

File renamed without changes.
Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44

55
The API can be accessed through:
66
- `shared.data.source.config.ConfigSource` - facade interface at the core module level.
7-
- `app.common.data.source.config.AppConfigSource` - decorator class at the app level.
8-
9-
The difference is that the class serves as a **decorator** and can provide extra methods without impacting facade implementations.
107

118
Facade **ConfigSource** provides the following methods:
129

13-
- `<T> get(key: String, type: Class<T>, defaultValue: () -> T): T` - Retrieves the value associated with the specified key from the configuration source.
10+
- `<T> get(key: String, encodingStrategy: EncodingStrategy<T>, defaultValue: () -> T): T` - Retrieves the value associated with the specified key from the configuration source.
1411
- `getString(key: String, defaultValue: () -> String): String` - Retrieves string value associated with the specified key from the configuration source.
1512
- `getBoolean(key: String, defaultValue: () -> Boolean): Boolean` - Retrieves boolean value associated with the specified key from the configuration source.
1613
- `getLong(key: String, defaultValue: () -> Long): Long` - Retrieves long value associated with the specified key from the configuration source.
@@ -20,25 +17,17 @@ Facade **ConfigSource** provides the following methods:
2017

2118
## Example
2219

23-
Both the **facade** and **decorator** are pre-configured via dependency injection (DI) as singletons in `app.di.common.ConfigSourceModule`.
24-
25-
However, it is recommended to use decorator methods instead of directly accessing facade methods,
26-
as the latter requires providing an extra parameter `defaultValue`, which might be hidden in the decorator.
20+
The **facade** is pre-configured via dependency injection (DI) as singletons in `app.common.CommonConfig`.
2721

28-
To start using, just inject any of them to your DI managed class.
22+
To start using, just inject it to your DI managed class.
2923

3024
```kotlin
31-
class AppConfigSource : DelegateConfigSource() {
32-
fun getCounterInitialValue(): Int = getInt("counter_initial_value") { 100 }
33-
...
34-
}
35-
36-
class TemplateViewModel (
37-
private val configSource: AppConfigSource // ConfigSource
25+
class TemplateViewModel(
26+
private val configSource: ConfigSource
3827
) : BaseViewModel() {
3928

40-
private val counter by lazy { AtomicInteger(configSource.getCounterInitialValue()) }
41-
29+
private val counter = AtomicInteger(configSource.getInt("counter_initial_value") { 100 })
30+
4231
...
4332
}
4433
```

docs/Dataflow/Cash App Paging Library/usage.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

docs/Dataflow/DataStore/usage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
The API can be accessed through:
66
- `shared.data.source.settings.SettingsSource` - base class at the core module level.
7-
- `shared.data.source.settings.DataStoreSource` - implementation of the base class.
7+
- `shared.data.source.settings.datastore.DataStoreSource` - implementation of the base class.
88

99
**SettingsSource** provides the following methods:
1010

@@ -17,15 +17,15 @@ The API can be accessed through:
1717

1818
## Example
1919

20-
Class instance is pre-configured via dependency injection (DI) as a singleton in `app.di.platform.configureKoin`.
20+
Class instance is pre-configured via dependency injection (DI) as a singleton in `app.platform.PlatformConfig`.
2121

2222
To start using, just inject it to your DI managed class.
2323

2424
```kotlin
25-
class TemplateViewModel @Inject constructor(
25+
class TemplateViewModel(
2626
private val settingsSource: SettingsSource
2727
) : BaseViewModel() {
28-
28+
2929
override fun doBind() = async("Init settings") {
3030
...
3131
val passcode: String? = settingsSource.read("name")

docs/Dataflow/Facade Analytics API/overview.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)