Kmplate is a template to easily create a new Kotlin Multiplatform project based on Clean Architecture with modularization by layer.
Current stack:
- UI framework: Compose Multiplatform - Powered by C·ZAN design system
- ViewModel: Jetpack ViewModel
- Navigation: Voyager
- Toast message portage for KMP: Compose Sonner
- Dependency Injection: Koin
- Build Config portage for KMP: BuildKonfig
- Threading: Coroutines
- Network: Ktor
- Local database: Realm Kotlin - Powered by kmp-realm
- Logging: Napier
- Images loading: Coil
- Firebase portage for KMP: GitLiveApp Firebase SDK - Powered by kmp-firebase
Create your repository by cloning this template, using the green button at the top-right corner of the homepage.
- For Github Actions to post messages on Slack, you must create a new webhook URL by using the Incoming Webhook app.
- Create a new Github Actions secret with name
SLACK_WEBHOOK_URL
, and copy paste the webhook created in the previous step as value of this secret.
We will configure 2 Slack bots to post message on Slack: one bot to check for outdated dependencies, and one bot for the build status. To configure these 2 Slack bots, we need to create 3 Github Actions variables:
SLACK_GITHUB_ACTIONS_CHANNEL_NAME
: the name of the Slack channel where Github Actions will post messages (ie.myproject_build_status
).SLACK_GITHUB_ACTIONS_DEPENDENCY_UPDATES_ICON_URL
: the icon URL to be used as a profile picture for the "Dependency Updates" Slack bot.SLACK_GITHUB_ACTIONS_ICON_URL
: the icon URL to be used as a profile picture for the "Github Actions CI" Slack bot.
- Open
buildSrc/src/main/kotlin/Dependencies.kt
and rename the following things:- Line 13: Replace
MyProject
object name with your own project name, - Line 14: Replace
com.tweener.changehere
package name with your own package name.
- Line 13: Replace
- Open
settings.gradle.kts
and replaceMyProjectName
on line 18 with your own project name. - Rename packages name (
import
andpackage
) in all existing files:- Click on
Edit
>Find
>Replace in files
, - In the first input field, type
com.tweener.changehere
, - In the second input field, type your own package name,
- Click on
Replace all
button.
- Click on
- Replace
com/tweener/changehere
with your own directory path in the following directories:androidApp/src/main/kotlin/com/tweener/changehere
shared/src/commonMain/kotlin/com/tweener/changehere
shared/data/src/androidMain/kotlin/com/tweener/changehere
shared/data/src/androidUnitTest/kotlin/com/tweener/changehere
shared/data/src/commonMain/kotlin/com/tweener/changehere
shared/data/src/iosMain/kotlin/com/tweener/changehere
shared/data/src/iosTest/kotlin/com/tweener/changehere
shared/domain/src/commonMain/kotlin/com/tweener/changehere
shared/domain/src/commonTest/kotlin/com/tweener/changehere
- Open file
Theme.kt
and renameMyProjectTheme
to your own project name. ie:AmazingAppTheme
. - Rename file
MyProjectUIDefaults.kt
to your own project name. ie:AmazingAppUIDefaults.kt
. - Open file
NavigationBar.kt
and renameMyProjectNavigationBar
to your own project name. ie:AmazingAppNavigationBar
. - Build and run the
androidApp
target from Android Studio.
- Open
iosApp/myProjectName.xcworkspace
in Xcode and build the project. - In Xcode, in the left panel, click on
iosApp
, then in tabSigning & Capabilities
and replace theBundle identifier
value with your own bundleID (ie. "com.mycompany.myproject"), - Close Xcode and go back to Android Studio.
- Run the
iosApp
target.
- Open
.github/workflows/buildRelease.xml
and replaceKmplate
on lines 1, 42 and 54 with your own name. - Open
.github/workflows/notify.xml
and replaceKmplate
on lines 21 and 33 with your own name.
- For Android, replace
androidApp/google-services.json
with your owngoogle-services.json
generated by Firebase. - For iOS, replace
iosApp/iosApp/GoogleService-Info.plist
with your ownGoogleService-Info.plist
generated by Firebase.