Skip to content
/ kmp-boilerplate Public template

🧱 The stable base upon which we build our Kotlin Multiplatform projects at Mirego.

License

Notifications You must be signed in to change notification settings

mirego/kmp-boilerplate


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.

Introduction

To learn more about why we created and maintain this boilerplate project, read our blog post.

Content

This boilerplate comes with batteries included, you’ll find:

Usage

There are 2 ways to use this boilerplate:

  1. 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.
  2. 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.

With GitHub template

  1. Pick your preferred branch (main or main-full)
  2. Click on the Use this template button to create a new repository
  3. Clone your newly created project (git clone https://github.com/you/repo.git)
  4. Run the boilerplate setup script (./boilerplate-setup.sh)
  5. Commit the changes (git commit -a -m "Rename kmp-boilerplate parts")

Without GitHub template

  1. Clone this project (git clone https://github.com/mirego/kmp-boilerplate.git)
  2. Pick your preferred branch (git checkout main or git checkout main-full)
  3. Delete the internal Git directory (rm -rf .git)
  4. Run the boilerplate setup script (./boilerplate-setup.sh)
  5. Create a new Git repository (git init)
  6. Create the initial Git commit (git commit -a -m "Initial commit using kmp-boilerplate")

Building the project

  • Run asdf install to install the dependencies described in .tool-versions on your system
  • Make sure you have Bundler installed (gem install bundler)

Android

  1. Install shared code specific gems at the root of the project (bundle install)
  2. Open the root folder using Android Studio
  3. Sync Gradle dependencies
  4. Build and run the app on your device or simulator 🚀

iOS

  1. Install iOS specific gems in the /ios folder (cd ios && bundle install)
  2. Open the workspace using Xcode
  3. Specify your Development Team under the Signing and Capabilities tab of the iosApp target
  4. Build and run the app on your device or simulator 🚀

Preferred libraries

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

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.

License

Kmp Boilerplate is © 2023 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

About Mirego

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.