Git Product home page Git Product logo

spotify-kmp's Introduction

Spotify-KMP

๐Ÿ—ก๏ธ Spotify-KMP is a Kotlin Multiplatform sample that mirrors the architecture of a production-level app!

License API

๐Ÿ›  How to run?

  • Clone the repository
  • Add a file called token.properties in top level folder.
  • Add the following content to the file:
client_id=your_client_id_here
client_secret=your_client_secret_here
grant_type=client_credentials 
  • And that's it!! You can run the app now.

NOTE: You can register your app on spotify dashboard & generate above credentials.

Tech stack & Open-source libraries

  • Minimum SDK level

    • Android 21
    • iOS 15
  • Language

  • UI Framework

  • Architecture

  • Coroutines + Flow for asynchronous.

  • Ktor: HTTP Client Franework for REST Apis.

  • SKIE: SKIE is a tool for Kotlin Multiplatform development that enhances the Swift API published from Kotlin.

  • KMMBridge: KMMBridge is a set of Gradle tooling that facilitates publishing and consuming pre-built KMM Xcode Framework binaries.

  • Kotlinx.serialization: A modern JSON serialization library for Kotlin.

  • Coil: Loading and caching images images from network (Android).

  • Kingfisher: Loading and caching images images from network (Ios).

  • Kermit: Multiplatform centralized logging utility.

  • Paging3: Multiplatform Paging Library

  • Multiplatform-Settings: Multiplatform library for saving simple key-value data (SharedPreferences / NSUserDefaults)

  • BuildKonfig: BuildConfig for Kotlin Multiplatform Project + Product Flavour in Shared Module

  • Koin : A pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform

  • Store : A Kotlin Multiplatform library for building network-resilient applications (Build offline first apps)

  • SqlDelight: Multiplatform SQLite Database (Generates typesafe Kotlin APIs from SQL)


Pagination Loading State Footer

Android

IOS

Pagination Initial Load Error

Android

IOS

Pagination Error State Footer

Android

IOS

Features

  • Playlist + Album Listing on HomePage
  • Track listing inside playlist & album
  • Paging Support in track listing screen using Paging3
  • Loading / Error footer support while paging + retry functionlity in listing (supported in both android & ios)
  • Offline first (Load from in-memory cache -> disk -> network) using Store
  • Multi module support in android & shared modules
  • Better support for suspend + flows + sealed classes using SKIE
  • Publish IOS Binary as POD framework using KMMBridge
  • BuildConfig + Product Flavour inside shared module using BuildKonfig
  • Dependency injection using Koin
  • Database caching using SqlDelight
  • Access/Refresh Token functionality using Ktor Auth Plugin

Modularization

Spotift-KMP adopted modularization strategies below:

  • Reusability: Modulizing reusable codes properly enable opportunities for code sharing and limits code accessibility in other modules at the same time.
  • Parallel Building: Each module can be run in parallel and it reduces the build time.
  • Strict visibility control: Modules restrict to expose dedicated components and access to other layers, so it prevents they're being used outside the module
  • Decentralized focusing: Each developer team can assign their dedicated module and they can focus on their own modules.

NOTE: The same modularization strategies are used for shared module as well

For more information, check out the Guide to app modularization.

TODO

  • Shared resource support using moko-resources
  • MultiModule structure in iOS project
  • Test cases for the common code

Find this repository useful? โค๏ธ

Support it by joining stargazers for this repository. โญ
Also, follow me on GitHub for my next creations! ๐Ÿคฉ

License

Designed and developed by 2024 AshuTyagi16 (Ashu Tyagi)

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.

spotify-kmp's People

Contributors

ashutyagi16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.