jurajkusnier / stock-browser

Modern native android app providing real-time market data using multiple 3rd party APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stock Browser - Android App

DISCLAIMER: Work in progress

This project demonstrates how to write a modern android app in 2023. The main goal is to make the app robust, testable, and maintainable using minimal set of well-known libraries and following best practices.

The app itself is very simple. It loads market data from multiple 3rd party APIs and stores them in a local database. Then it allows users to search, browse and mark favorite items.

Architecture

Architecture follows principles of separation of concerns. App is divided into 3 main layers, every one with its own responsibilities.

  • UI Layer displays application data on screen using Jetpack Compose. It also holds the state of simple components as text fields.
  • Domain Layer is responsible for encapsulating complex business logic, or simple business logic that is used by multiple ViewModels.
  • Data Layer contains application data and business logic.

App uses MVI (Model View Intent) architecture pattern, implemented using Orbit-MVI library. Each screen has a matching ViewModel and ScreenState. ViewModel represents the source of truth for the screen. It handles all user input and returns the corresponding UI state that is displayed on the screen. In addition to state, ViewModel can also produce side effects used mainly for navigation between screens. ViewModel calls different use cases to get data to be displayed to the user. The logic for loading and saving data from different resources is implemented by repositories and data sources.

App Architecture

Libraries

  • Room - Abstraction layer over SQLite database
  • Jetpack Compose - Android’s recommended modern toolkit for building native UI
  • Compose Navigation - The Navigation component provides support for Jetpack Compose applications.
  • DataStore - Solution that allows you to store key-value pairs or typed objects
  • Retrofit 2 - A type-safe HTTP client for Android and Java.
  • kotlinx.serialization - Kotlin multiplatform / multi-format reflectionless serialization
  • Hilt - Provides a standard way to incorporate Dagger dependency injection into an Android application.
  • Orbit-MVI - Redux/MVI-like library - but without the baggage
  • mockito - Tasty mocking framework for unit tests in Java

CI/CD

  • GitHub Actions - CI/CD platform that allows you to automate your build, test, and deployment pipeline.

Screenshots

screenshot screenshot screenshot
screenshot screenshot screenshot

Video

device-2022-11-29-162543.mp4
device-2022-11-29-162404.mp4

About

Modern native android app providing real-time market data using multiple 3rd party APIs.


Languages

Language:Kotlin 100.0%