Skip to content

dalafiarisamuel/Unsplash-KMP

Repository files navigation

Unsplash-API-KMP CI

A project to display images from Unsplash API using Kotlin Multiplatform

Features

  • Jetpack Compose
  • Coil KMP
  • MVI Architecture
  • Kotlin Coroutines with Flow
  • Koin
  • Kotlin Gradle DSL
  • Cashapp Paging
  • Ktorfit
  • Compose Multiplatform Navigation

Libraries

  • Jetpack Compose - Android’s modern toolkit for building native UI.
  • Coil KMP - An image loading library for Android & KMP backed by Kotlin Coroutines.
  • View Model - Presenter for persisting view state across config changes
  • Ktorfit - type safe http client and supports coroutines out of the box.
  • Kotlin Serialization - JSON Parser,used to parse requests from the API
  • kotlinx.coroutines - Library Support for coroutines
  • Cashapp Paging - The Paging Library makes it easier for you to load data gradually and gracefully within your app based off Google's Paging3 Library
  • Compose Multiplatform navigation - Google's official Navigation library that is compatible with KMP
  • Koin - Kotlin Multiplatform Dependency Injection

Prerequisite

  • To successfully make API calls to Unsplash Endpoint, use a valid API Token from Unsplash.
  • Enter your valid API token here

Mobile App Screenshots

Screenshot 1 Screenshot 2
Screenshot 3 Screenshot 4

Desktop App Screenshots

Desktop Screenshot 1 Desktop Screenshot 2

Before running

  • Check your system with KDoctor
  • Install JDK 17 or higher on your machine

Android

To run the application on android device/emulator:

  • open project in Android Studio and run imported android run configuration

Desktop

Run the desktop application: ./gradlew :composeApp:run or ./gradlew run

iOS

To run the application on iPhone device/simulator:

  • Open iosApp/iosApp.xcproject in Xcode and run standard configuration
  • Or use Kotlin Multiplatform Mobile plugin for Android Studio Run iOS simulator UI tests: ./gradlew :composeApp:iosSimulatorArm64Test