A modern cross-platform mobile application built with Kotlin Multiplatform that delivers daily inspirational quotes. Features native UI with Jetpack Compose for Android and SwiftUI for iOS, implementing Clean Architecture with offline-first approach.
β Star this repository if you find it helpful!
π Read the Complete Development Guide on Medium
- Shared Business Logic: The application uses Kotlin Multiplatform to share core business logic between Android and iOS platforms, reducing code duplication and ensuring consistency.
- Platform-Specific UI: While the business logic is shared, the UI is implemented natively for each platform (Jetpack Compose for Android and SwiftUI for iOS) to provide a seamless user experience.
- Fetch Daily Quotes: The app fetches a new inspirational quote every day from a remote API.
- Caching: Quotes are cached locally to ensure offline access.
- Save Quotes: Users can mark quotes as favorites for quick access later.
- Observe Favorites: The app uses reactive programming to update the UI whenever the list of favorite quotes changes.
- Local Storage: The app uses a local database to store quotes and user preferences, ensuring functionality even without an internet connection.
The project follows a Clean Architecture approach, which separates concerns into distinct layers:
-
Presentation Layer:
- Android: Built using Jetpack Compose, a modern declarative UI toolkit.
- iOS: Built using SwiftUI, Apple's declarative UI framework.
-
Domain Layer:
- Contains business logic and use cases, such as fetching quotes, managing favorites, and handling notifications.
-
Data Layer:
- Remote Data Source: Fetches quotes from a remote API using Ktor.
- Local Data Source: Stores quotes and user preferences locally using Multiplatform Settings and platform-specific storage solutions.
.
βββ androidApp/ # Android-specific code and resources
β βββ src/main/ # Main source code for Android
β βββ build.gradle.kts # Android module Gradle configuration
β βββ ... # Other Android-specific files
βββ iosApp/ # iOS-specific code and resources
β βββ iosApp.xcodeproj # Xcode project configuration
β βββ SwiftUI Views # iOS UI components
β βββ ... # Other iOS-specific files
βββ shared/ # Shared Kotlin Multiplatform code
β βββ src/commonMain/ # Shared business logic
β βββ src/androidMain/ # Android-specific implementations
β βββ src/iosMain/ # iOS-specific implementations
β βββ build.gradle.kts # Shared module Gradle configuration
βββ build.gradle.kts # Root Gradle configuration
βββ settings.gradle.kts # Gradle settings
βββ README.md # Project documentation
- Clone the repository:
git clone https://github.com/abbasiandev/DailyQuote.git
- Open the project in Android Studio.
- Sync Gradle:
./gradlew build
- Run the app on an Android emulator or device.
- Open the
iosApp/iosApp.xcodeprojin Xcode. - Generate the shared framework:
./gradlew :shared:embedAndSignAppleFrameworkForXcode
- Build and run the app on an iOS simulator or device.
- Launch the app to view the daily quote.
- Use the "Favorite" button to save quotes.
- Access your saved quotes in the "Favorites" section.
- Open the app to see the daily quote.
- Swipe to save quotes to your favorites.
- Access your saved quotes in the "Favorites" section.
- iOS code should be written and maintained in Xcode, as Android Studio's Swift support plugins are limited and not robust enough for full development.
- Ktor: Networking library for API calls.
- Kotlinx Serialization: JSON serialization.
- Multiplatform Settings: Cross-platform preferences management.
- Jetpack Compose: Modern UI toolkit for Android.
- Coil: Image loading library.
- Koin: Dependency injection framework.
- DataStore: Used for managing local storage and preferences on the Android side.
- SwiftUI: Declarative UI framework for iOS.
- Kingfisher: Image caching and loading library.
- Russhwolf Multiplatform Settings: Used for managing local storage and preferences on the iOS side.

