Git Product home page Git Product logo

crypto-demo's Introduction

This is a demo project using Kotlin Multiplatform with Compose for both Android and iOS. Previously I never used Compose or Kotlin Multiplatform for a real-world app, so I decided to use this project as a diving-deep opportunity to get more familiar with these technologies.

The app displays a simple list of cryptocurrencies and their prices by fetching data from the Bitfinex API. It also uses the Github Cryptofonts URLs to fetch the icons for each displayed cryptocurrency.

The requirements are the following:

  • Data should update every 5 seconds
  • The user should be able to filter the list of items via a search bar
  • The app should be able to handle connectivity changes
  • The UX should be built with the user in mind, ready to be released
  • Unit tests should be included for the business logic
  • I was free to use any technologies, patterns or libraries I wanted

I used the following technologies:

  • Kotlin Multiplatform with Compose for the UI for both Android and iOS
  • Ktor for networking
  • Kotlin Serialization for JSON parsing
  • Kotlin Coroutines for asynchronous programming
  • Koin for dependency injection
  • Kamel image for loading and displaying the icons

I went a bit overboard with the project, as I wanted to dive into this new technology as deep as possible, so I included a lot of features that are not necessary for the project's scope. Some of these are:

  • A custom navigation system for the app to go on a details page when the user clicks an item
  • A more complex layered architecture that uses the repository and datasource patterns, use cases, and "view models" for the business logic. (I put view models in quotes because they are not the same as the Android ViewModel, but they are similar in the sense that they hold the business logic for the UI.)
  • I used Compose for the UI on both platforms which is still in alpha for iOS. I wanted to see how well it works on iOS and if it's worth using it for a real-world app.
  • I also implemented a multi-data source system that would be able to fetch data from multiple APIs. This is not necessary for the project, but I let myself get carried away with this feature. I only implemented the Bitfinex API, but I could easily add more APIs in the future.
  • The only platform specific code is choosing the networking library for each platform + building the necessary data for setting up the compose App(). For networking, I used Ktor for both platforms which abstract away the underlying library.
  • Testing via stubbing instead of mocks

Demo image: Demo image

crypto-demo's People

Contributors

tmdroid avatar

Watchers

 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.