Skip to content

santimattius/kmp-entertainment-app

Repository files navigation

KMP Entertainment App

A Kotlin Multiplatform (KMP) sample application for Android and iOS that showcases movies and TV shows using TheMovieDB API. The UI is built with Compose Multiplatform, and shared logic lives in a single module consumed by both platforms.

Android screenshot iOS screenshot


Table of contents


Features

  • Shared UI — Common Compose Multiplatform screens for Android and iOS
  • TheMovieDB integration — Browse movies and TV shows via the official API
  • Offline-ready — Room for local persistence and SQLite
  • Dependency injection — Koin with Compose and ViewModel support
  • Networking — Ktor client with content negotiation and logging
  • Navigation — Navigation 3 (Nav3) with adaptive layouts

Tech stack

Layer Technology
UI Compose Multiplatform, Material 3, adaptive layouts
DI Koin (Core, Android, Compose, Compose ViewModel, Nav3)
Networking Ktor (core, OkHttp/Darwin, content negotiation, Kotlinx JSON, logging)
Persistence Room, SQLite (bundled)
Images Coil 3 (Compose, network)
Async Kotlin Coroutines
Config BuildKonfig (build-time config)
Logging Kermit

Build & tooling: Kotlin 2.3, AGP 9.0, Gradle 9.1, KSP 2.3, Compose Multiplatform 1.10.


Project structure

kmp-entertainment-app/
├── androidApp/          # Android application (Compose + KMP entry point)
├── shared/              # Shared KMP module (commonMain + androidMain + iosMain)
│   ├── commonMain/      # Shared UI, ViewModels, data, networking
│   ├── androidMain/      # Android-specific implementations
│   └── iosMain/         # iOS-specific implementations
├── iosApp/              # iOS app (Xcode project, consumes shared framework)
├── docs/                 # Project documentation
│   └── AGP9_KMP_MIGRATION.md
├── build.gradle.kts
├── settings.gradle.kts
└── gradle/
    └── libs.versions.toml
  • androidApp — Android app; depends on shared, uses androidTarget() and Compose.
  • shared — Kotlin Multiplatform library; Compose UI, Room, Ktor, Koin, and platform expect/actuals.
  • iosApp — Native iOS app (Swift/Xcode) that links the shared framework produced by shared.

Prerequisites

Verifying your environment

Use KDoctor to check that your machine is ready for KMP development:

  1. Install KDoctor (via Homebrew):

    brew install kdoctor
  2. Run the diagnostic:

    kdoctor

    A successful setup looks like:

    Environment diagnose (to see all details, use -v option):
    [✓] Operation System
    [✓] Java
    [✓] Android Studio
    [✓] Xcode
    [✓] Cocoapods
    
    Conclusion:
      ✓ Your system is ready for Kotlin Multiplatform Mobile development!
    

    If something fails, KDoctor will point out what to fix.


Getting started

1. Clone the repository

git clone https://github.com/santimattius/kmp-entertainment-app.git
cd kmp-entertainment-app

2. Configure the API key

The app uses TheMovieDB API. Create a local.properties file in the project root (if it does not exist) and add your API key:

api_key=YOUR_THEMOVIEDB_API_KEY

Replace YOUR_THEMOVIEDB_API_KEY with your key from TheMovieDB.


Building and running

Android

./gradlew :androidApp:assembleDebug

Install and run on a device or emulator from Android Studio, or:

./gradlew :androidApp:installDebug

iOS

  1. Build the shared framework and open the iOS app in Xcode:

    ./gradlew :shared:embedAndSignAppleFrameworkForXcode
  2. Open iosApp/iosApp.xcworkspace in Xcode (use the .xcworkspace, not the .xcodeproj).

  3. Select a simulator or device and run the app.


Navigation

This project uses Navigation 3 (Nav3) for Compose Multiplatform. For alternative navigation implementations:


Documentation

  • AGP 9 & Android-KMP migration — Current state with AGP 9, temporary compatibility flags, and steps to complete the migration to the Android-KMP plugin once KSP supports it.

Dependencies

Main versions are centralized in gradle/libs.versions.toml. Key entries:

Dependency area Version / note
Android Gradle Plugin 9.0.0
Kotlin 2.3.0
KSP 2.3.0
Compose Multiplatform 1.10.0
Room 2.8.4
Ktor 3.3.3
Koin 4.2.0-beta2
Coil 3.3.0

For the full list, see gradle/libs.versions.toml.


License

This project is provided as-is for reference and learning. Use of TheMovieDB is subject to TheMovieDB’s terms of use.

About

Kotlin Multiplaform App using Compose Multiplaform

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages