This repository is the stable base upon which we build our Kotlin Multiplatform projects at Mirego.
We want to share it with the world so you can build awesome multiplatform applications too.
To learn more about why we created and maintain this boilerplate project, read our blog post.
This boilerplate comes with batteries included, you’ll find:
- A brand new Kotlin Multiplatform project using Kotlin 1.9.21 and the Cocoapods Plugin
- An Android app using Jetpack Compose
- An iOS app using SwiftUI
- Asynchronous & multithreading support with Coroutines
- Model serialization support with kotlinx.serialization
- Opinionated Kotlin linting with Ktlint
- Opinionated Swift linting with SwiftLint
- A CI workflow using GitHub actions
- Translations with Trikot.KWord and Accent (using a scheduled GitHub Actions workflow)
- A clean and useful
README.md
template (in english)
There are 2 ways to use this boilerplate:
- From the
main
branch — This branch is the "lean" version, it does not contain any strongly opinionated libraries or tools. It is a good starting point if you want to build your own boilerplate. - From the
main-full
branch — This branch contains all the opinionated libraries and tools described in the Preferred libraries section. It is a good starting point if you want to quickly start building your app the Mirego way.
- Pick your preferred branch (
main
ormain-full
) - Click on the Use this template button to create a new repository
- Clone your newly created project (
git clone https://github.com/you/repo.git
) - Run the boilerplate setup script (
./boilerplate-setup.sh
) - Commit the changes (
git commit -a -m "Rename kmp-boilerplate parts"
)
- Clone this project (
git clone https://github.com/mirego/kmp-boilerplate.git
) - Pick your preferred branch (
git checkout main
orgit checkout main-full
) - Delete the internal Git directory (
rm -rf .git
) - Run the boilerplate setup script (
./boilerplate-setup.sh
) - Create a new Git repository (
git init
) - Create the initial Git commit (
git commit -a -m "Initial commit using kmp-boilerplate"
)
- Run
asdf install
to install the dependencies described in.tool-versions
on your system - Make sure you have Bundler installed (
gem install bundler
)
- Install shared code specific gems at the root of the project (
bundle install
) - Open the root folder using Android Studio
- Sync Gradle dependencies
- Build and run the app on your device or simulator 🚀
- Install iOS specific gems in the
/ios
folder (cd ios && bundle install
) - Open the workspace using Xcode
- Specify your Development Team under the
Signing and Capabilities
tab of theiosApp
target - Build and run the app on your device or simulator 🚀
Some frequently used libraries aren’t included by default in this boilerplate since all projects have their own needs and requirements. Here’s a list of our preferred libraries to help you get started:
Category | Libraries |
---|---|
HTTP networking | ktor |
GraphQL client | apollo-kotlin |
Persisted preferences | multiplatform-setttings |
I/O & File system | okio |
Mocking (Unit tests) | mockk |
Declarative UI framework | trikot-viewmodels-declarative-flow |
Date & time | kotlinx-datetime |
OWASP Dependency-Check is installed as a Gradle plugin to scan your project to identify the use of known vulnerable components. It mainly checks for vulnerabilities in Gradle dependencies, but if bundle-audit is present on the system, it will also scan the Ruby Gems dependencies. It also has the capability to scan for Cocoapods/Swift Package Manager dependencies if executed on a macOS system.
Kmp Boilerplate is © 2023 Mirego and may be freely distributed under
the New BSD license. See
the LICENSE.md
file.
Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We’re a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.
We also love open-source software and we try to give back to the community as much as we can.