KMP Movie app built with Compose Multiplatform, supporting Android, iOS, Desktop, and Web. The app
follows the MVVM architecture to ensure clean, maintainable code and delivers a responsive, modern
UI experience across all platforms, leveraging The Movie DB API.
- iOS
- Android
- Desktop
- Web
- π Now Playing, Popular, Top Rated & Upcoming movie sections
- π Movie Detail Pages with Cast & Crew
- π― Recommended Movies
- π Search Movies
- π€ Artist/Actor Detail Page with navigation from movie cast
- πΊ Airing Today, On The Air, Popular & Upcoming TV series sections
- π TV Series Detail Pages with Cast & Crew
- π― Recommended TV Series
- π Search TV Series
- π€ Artist/Actor Detail Page with navigation from TV series cast
- π Popular and Trending Celebrities/Persons sections
- π Celebrity Search functionality
- π€ Celebrity Detail Page with navigation from movie/tv cast
- π§ Bottom Navigation
- π¦ Navigation Rail
- π Pagination supports for all platforms
- MVVM Architecture (Model - ComposableView - ViewModel)
You will need to provide a developer key to fetch the data from TMDB API.
- Generate a new key (v3 auth) from here. Copy the key and go back to the project.
- Add a new entry in
local.properties
file:
API_KEY=superSecretSampleApiKeyOf32Chars
β οΈ If you havenβt generated an API key yet, feel free to use the demo key below for development use only.
API_KEY=59cd6896d8432f9c69aed9b86b9c2931
- Compose Multiplatform - Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces.
- PreCompose - Compose Multiplatform Navigation && State Management
- Ktor Client - Ktor includes a multiplatform asynchronous HTTP client, which allows you to make requests and handle responses.
- Koin - A pragmatic lightweight dependency injection framework for Kotlin
- kotlinx.serialization - Kotlin multiplatform / multi-format reflectionless serialization
- View Model - The ViewModel class is a business logic or screen level state holder. It exposes state to the UI and encapsulates related business logic
- Coroutines - For asynchronous and more.
- Flow - A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.
- Landscapist - π» A pluggable, highly optimized Jetpack Compose and Kotlin Multiplatform image loading library that fetches and displays network images with Glide, Coil, and Fresco.
- Android Studio - Android Studio is the official Integrated Development Environment (IDE) for Android app development.
- XCode - Xcode 14 includes everything you need to develop, test, and distribute apps across all Apple platforms.
- check your system with KDoctor
- install JDK 11 or higher on your machine
- add
local.properties
file to the project root and set a path to Android SDK there
To run the application on Android device/emulator:
- open the project in Android Studio and run the imported android run configuration
To build the application bundle:
- run
./gradlew :composeApp:assembleDebug
- find
.apk
file incomposeApp/build/outputs/apk/debug/composeApp-debug.apk
Run android simulator UI tests:./gradlew :composeApp:pixel5Check
To run the application on an 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
- Run the desktop application:
./gradlew :composeApp:run
- Run desktop UI tests:
./gradlew :composeApp:jvmTest
- Before running make sure you have
yarn 1.22.22
- Run the web application:
./gradlew wasmJsBrowserDevelopmentRun
This is a Kotlin module that contains the logic common for all platforms.
This shared module is where you write your Compose Multiplatform code. In
composeApp/src/commonMain/kotlin/App.kt
, you can find the shared root @Composable
function for
your app.
It uses Gradle as the build system. You can add dependencies and change settings in
composeApp/build.gradle.kts
. The shared module builds into platform-specific libraries:
- Android library for Android
- Framework for iOS
- JVM library for Desktop
- JavaScript library for Web
The complete structure of the composeApp
module showing all platform-specific directories:
composeApp/
βββ build.gradle.kts
βββ src/
β βββ androidMain/
β β βββ kotlin/
β β βββ res/
β β β βββ drawable/
β β β βββ drawable-v24/
β β β βββ mipmap-anydpi-v26/
β β β βββ mipmap-hdpi/
β β β βββ mipmap-mdpi/
β β β βββ mipmap-xhdpi/
β β β βββ mipmap-xxhdpi/
β β β βββ mipmap-xxxhdpi/
β β β βββ values/
β β βββ AndroidManifest.xml
β βββ commonMain/
β β βββ composeResources/
β β β βββ drawable/
β β β βββ values/
β β βββ kotlin/
β β βββ constant/
β β β βββ AppConstant.kt
β β βββ data/
β β β βββ model/
β β β β βββ artist/
β β β β βββ celebrities/
β β β β βββ movie_detail/
β β β β βββ tv_detail/
β β β β βββ BaseModel.kt
β β β β βββ MovieItem.kt
β β β β βββ TvSeriesItem.kt
β β β βββ remote/
β β β β βββ ApiClient.kt
β β β β βββ ApiInterface.kt
β β β β βββ ApiService.kt
β β β βββ repository/
β β β βββ Repository.kt
β β βββ di/
β β β βββ AppModule.kt
β β β βββ KoinApplication.kt
β β β βββ KoinInitializer.kt
β β β βββ PlatformModule.kt
β β βββ navigation/
β β β βββ NavGraph.kt
β β β βββ NavigationScreen.kt
β β βββ theme/
β β β βββ Color.kt
β β β βββ Shape.kt
β β β βββ Theme.kt
β β β βββ Type.kt
β β βββ ui/
β β β βββ component/
β β β βββ screens/
β β β βββ App.kt
β β βββ utils/
β β βββ network/
β β βββ CommonExtension.kt
β β βββ Platform.kt
β β βββ UIExtension.kt
β β βββ Utils.kt
β βββ desktopMain/
β β βββ kotlin/
β βββ iosMain/
β β βββ kotlin/
β βββ wasmJsMain/
β βββ kotlin/
β βββ resources/
This is a Kotlin module that builds into an Android application. It uses Gradle as the build system.
The androidApp
module depends on and uses the shared module as a regular Android library.
This is an Xcode project that builds into an iOS application. It depends on and uses the shared module as a regular iOS framework.
- Kotlin Multiplatform Wizard For Starter template
Mehedi Hassan Piash
Copyright 2024 piashcse (Mehedi Hassan Piash)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.