The Movie DB app using The Movie DB built with Kotlin Multiplatform & Compose Multiplatform.
- Android π±
- iOS π±
- WearOS β
- TV πΊ (in progress)
- Android Studio - Android Studio is the official Integrated Development Environment (IDE) for Android app development.
- XCode - Xcode 15.2 includes everything you need to develop, test, and distribute apps across all Apple platforms.
- Kotlin Multiplatform Mobile - The Kotlin Multiplatform technology, to use it you must integrate the following plugins plugin
- Compose Multiplatform - Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces.
- Navigation Compose - Compose Multiplatform Navigation
- Lifecycle Viewmodel Compose - Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development.
- kotlinx.serialization - Kotlin multiplatform / multi-format reflectionless serialization
- Coroutines - For asynchronous and more.
- Flow - A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.
- Ktor Client - Ktor includes a multiplatform asynchronous HTTP client, which allows you to make requests and handle responses.
- Koin - Koin a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform.
- Coil3 - An image loading library for Android backed by Kotlin Coroutines for Kotlin Multiplatform.
- Paging - A library that adds additional Kotlin Multiplatform targets to AndroidX Paging, and provides UI components to use Paging on iOS.
- Kermit - Kermit is a Kotlin Multiplatform centralized logging utility
- BuildKonfig - Supports embedding values from gradle file.
βΉοΈ Please note, I used some libraries which are not yet in stable version, this remains as an example of a project to gain expertise on new technologies.
The app architecture has three layers : a data layer, a domain layer and a UI layer.
I followed the Guide to app architecture by google.
Also I applied the SOLID principles
The project follows the standard Kotlin Multiplatform structure, with the following notable files and directories, that targeting Android, iOS, wearOS and TV (in Progress).
-
uiCompose
Contains the project code common.src/commonMain
This is a Kotlin module that contains the UI common for both Android and iOS applications, the code you share between platforms. This shared module is also where you write your Compose Multiplatform code. InuiCompose/src/commonMain/kotlin/AppScreen.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 inuiCompose/build.gradle.kts
. The shared module builds into an Android library and an iOS framework..src/androidMain
Contains the Android-specific code and specific configuration files.src/iosMain
Contains the iOS-specific code and specific configuration files.
-
data
This is the network layer module. -
domain
This is the logic layer module. -
model
This is the module that contains the models of the ui layer. -
androidApp
Contains the android-specific configuration files. -
iosApp
Contains the iOS-specific configuration files. -
wearOS
Contains the wearOS-specific code ui and specific configuration files. -
build.gradle.kts
The main Gradle build script for the project.
-
Clone this repository to your local machine.
git clone https://github.com/ibenabdallah/the-movie-db.git
-
Open the project in Android Studio.
-
Set up your Android and iOS device/emulator/simulator.
-
You must create an account on the site The Movie DB to create a key afterwards, then set up the
local.properties
file in the project's root directory (if it doesn't already exist) by adding the following properties :
api_key=<YOUR TMDB API KEY>
- Build and run the project.
To run the application on android device/emulator:
- open project in Android Studio and run imported android run configuration
To build the application bundle:
- run
./gradlew :androidApp:assembleDebug
- find
.apk
file inandroidApp/build/outputs/apk/debug/androidApp-debug.apk
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
To run the application on android device/emulator:
- open project in Android Studio and run imported android run configuration
To build the application bundle:
- run
./gradlew :wearOS:assembleDebug
- find
.apk
file inwearOS/build/outputs/apk/debug/wearOS-debug.apk
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Please ensure that your contributions adhere to the project's coding style and guidelines.
This project is licensed under the MIT License.