Skip to content

Cross-platform inspirational quotes mobile app built with Kotlin Multiplatform (KMM). Features native UI with Jetpack Compose (Android) & SwiftUI (iOS), offline support, Clean Architecture, and daily quote notifications. Modern mobile development showcase.

License

Notifications You must be signed in to change notification settings

abbasiandev/DailyQuote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

65 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DailyQuote - Cross-Platform Inspirational Quotes App

Kotlin Multiplatform Android iOS Jetpack Compose SwiftUI

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.


πŸ“± Try

⭐ Star this repository if you find it helpful!

πŸ“– Read the Complete Development Guide on Medium


πŸ“Έ Demo

Daily Quote

Daily Quote App Screenshot


Table of Contents

  1. Features
  2. Architecture
  3. Project Structure
  4. Setup and Installation
  5. Usage
  6. Dependencies

Features

Cross-Platform Support

  • 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.

Daily Inspirational Quotes

  • 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.

Favorites Management

  • 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.

Offline Support

  • Local Storage: The app uses a local database to store quotes and user preferences, ensuring functionality even without an internet connection.

Architecture

The project follows a Clean Architecture approach, which separates concerns into distinct layers:

  1. Presentation Layer:

    • Android: Built using Jetpack Compose, a modern declarative UI toolkit.
    • iOS: Built using SwiftUI, Apple's declarative UI framework.
  2. Domain Layer:

    • Contains business logic and use cases, such as fetching quotes, managing favorites, and handling notifications.
  3. 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.

Project Structure

.
β”œβ”€β”€ 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

Setup and Installation

Steps to Build

Android

  1. Clone the repository:
    git clone https://github.com/abbasiandev/DailyQuote.git
  2. Open the project in Android Studio.
  3. Sync Gradle:
    ./gradlew build
  4. Run the app on an Android emulator or device.

iOS

  1. Open the iosApp/iosApp.xcodeproj in Xcode.
  2. Generate the shared framework:
    ./gradlew :shared:embedAndSignAppleFrameworkForXcode
  3. Build and run the app on an iOS simulator or device.

Usage

Android

  • Launch the app to view the daily quote.
  • Use the "Favorite" button to save quotes.
  • Access your saved quotes in the "Favorites" section.

iOS

  • 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.

Dependencies

Shared

  • Ktor: Networking library for API calls.
  • Kotlinx Serialization: JSON serialization.
  • Multiplatform Settings: Cross-platform preferences management.

Android

  • 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.

iOS

  • 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.

About

Cross-platform inspirational quotes mobile app built with Kotlin Multiplatform (KMM). Features native UI with Jetpack Compose (Android) & SwiftUI (iOS), offline support, Clean Architecture, and daily quote notifications. Modern mobile development showcase.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published