Skip to content

Kotlin-Multiplatform Mobile app which connects to PetFinder Api and let's you browse adorable pets.

License

Notifications You must be signed in to change notification settings

msa1422/KMM-Arch-PetSearch

Repository files navigation

KMM-Arch-PetSearch

PetSearch is an effort to explore and showcase the Kotlin-Multiplatform possibilities.
100% Jetpack Compose, 100% SwiftUI. This project is all about learning.
With that said, author has realised that,
"The more you know, the more you realize you don't know." - Aristotle


Android Screenshots

iOS Screenshots

Project Architecture

PetSearch has blended the following coding practices and techniques to create a flavor of its own.

  • Clean Architecture
  • MVI (Redux inspired)
  • SOLID
  • Feature-wise and Layer-wise Modularized code (Android and Shared)
  • Shared ViewModel with SavedStateHandle (Android and iOS)
  • ViewModel Navigation with args (Android and iOS)

Project Setup

PetFinder Api

  • Generate PetFinder ApiKey and Secret from here.
  • Create apikey.properties in root dir
  • Add the following in properties file
    API_KEY=<YOUR_API_KEY>
    API_SECRET=<YOUR_API_SECRET>
    
  • Run ./gradlew generateBuildKonfig

Android

  • Java 11
  • You require Android Studio Dolphin
  • Install Kmm Plugin. Checkout this setup guide.
  • Create keystore.properties in root dir and add the following lines in the file. Values can be anything as long as you're not generating a signed APK
    STORE_FILE=<YOUR_STORE_FILE>
    STORE_PASSWORD=<YOUR_STORE_PASSWORD>
    KEY_ALIAS=<YOUR_KEY_ALIAS>
    KEY_PASSWORD=<YOUR_KEY_PASSWORD>
    

Opening iOS Project

  • Navigate to ios directory & open .xcworkspace & not .xcodeproj

Code Quality

Tools Check command Fix command
lint ./gradlew lint -
detekt ./gradlew detekt -
ktlint ./gradlew ktlintCheck ./gradlew ktlintFormat
spotless ./gradlew spotlessCheck ./gradlew spotlessApply

Tests

Kotest Plugin doesn't support running common tests in Multiplatform project via green run icons in editor. Only way to run common tests is via Gradle command ./gradlew check


Libraries Used

Android

Kmm - Shared

iOS


Inspiration

Following projects have played a huge role in development of KMM-Arch-PetSearch. I am grateful to authors of projects below for sharing such highly valuable material.


License

MIT license. See the LICENSE file for more information.