A modern, multiplatform book catalog application built with Kotlin and Compose Multiplatform, allowing users to search for books and view their details. This project demonstrates a clean architecture approach for building applications that share UI and business logic across Android and Desktop.
- Cross-Platform: Runs on both Android and Desktop (JVM) with a single shared codebase.
- Book Search: To search for books online.
- Detailed View: Displays comprehensive details for each book, including title, author, description, and cover image.
- Clean & Modern UI: A beautiful, responsive, and intuitive user interface built entirely with Compose Multiplatform.
- Shared Logic: Business logic, data handling, and API calls are all written in common Kotlin code, shared across platforms.
- Kotlin: The core programming language.
- Compose Multiplatform: For building the declarative UI for both Android and Desktop.
- Coroutines: For managing background threads and asynchronous operations.
- Ktor Client: A multiplatform asynchronous HTTP client for making API requests.
- Koin: A pragmatic and lightweight dependency injection framework for Kotlin.
- [Room]: Used for local data persistence.
- Coil: An image loading library for Android, backed by Kotlin Coroutines. (Or a similar multiplatform image loading library).
This project follows the principles of Clean Architecture, separating the code into three main layers:
:presentation: Contains the UI (Composables) and ViewModels. This layer is responsible for observing state and propagating user events.:domain: Includes business logic, and repository interfaces. This layer is pure Kotlin and independent of any framework.:data: Implements the repository interfaces and contains the data sources (network API calls with Ktor and local database with Room).
This separation of concerns makes the app scalable, maintainable, and easy to test.
- IntelliJ IDEA or Android Studio (latest version recommended).
- Kotlin Multiplatform Mobile plugin installed.
git clone [https://github.com/mena-rizkalla/CMP-Bookpedia](https://github.com/mena-rizkalla/CMP-Bookpedia)- Open the project in Android Studio or IntelliJ IDEA.
- Let Gradle sync and download all the required dependencies.
- To run on Android:
- Select the
composeApprun configuration. - Choose an emulator or connect a physical device.
- Click the 'Run' button.
- Select the
- To run on Desktop:
- Select the
desktopApprun configuration from the dropdown. - Click the 'Run' button.
- Select the
This project was created by following the excellent Compose Multiplatform tutorial by Philipp Lackner. thank to him for providing high-quality educational content for the developer community.
Learn more about Kotlin Multiplatform…