GithubHelp home page GithubHelp logo

nomadiqltd / finnews Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 738 KB

FinNews is demo app that displays articles related to Finance using the Guardian API and other third party APIs

Kotlin 100.00%

finnews's Introduction

FinNews

FinNews is a Jetpack Compose app using Material 3 design elements. This Android app sample is the leading FinTech and finance news app which allows the user to display a list of articles, view the details and has visually decorative actions such as: Search, Favourite and Bookmark.

Prerequisites:

Before running the app, ensure you have the following installed on your system:

Build System

  • Gradle
  • Kotlin

Latest App version : 1.0.0

| |

Running the App

Follow these steps to run the app:

  1. Clone the Repository: -> Clone this GitHub repository to your local machine using Git:

    git clone https://github.com/nomadiqltd/FinNews.git
    
    • On Github, check out the 'main' branch.
    • Request a new Guardian News API key from here.
    • Navigate to the build.gradle file within the app module (not the build.gradle at the root of the directory).
  • Replace the current Guardian News Api key inside the buildTypes{} closure (within the build.gradle file) with your new Guardian News Api Key.
  • Note: If you do not replace the API Key, you may be presented with a blue screen containing a error message similar to: "errorCode : 401 ==> ".
    val apiKey = "\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\""
    • Select Build -> Rebuild Project and then select Run after the project successfully builds.

Architecture

The chosen architecture is MVVM (Model View ViewModel) with a Clean-ish approach.

The main 3 layers are:

Presentation Layer

  • This layer displays the application data on the screen. This includes the Jetpack Compose functions, ViewModels and UI State.

Domain Layer

  • The domain layer is the mediator between the data layer and the presentation layer.
  • This app is a pretty small sample but for future scalability it will become more complex and all that logic that would have lived in the ViewModel would now reside in smaller UseCases instead (optional layer).

Data Layer

  • The data layer contains repositories that abstract away the complexity of the data's origins. In this case, it's all remote data but it has the capability to extend to a form of local storage i.e. a Database.

Project Dependencies

Below is a brief summary of the main dependencies below:

Jetpack libraries

Compose

  • Declarative UI with composable functions as opposed to the older Android View system (old school XML layouts)

Arch Core

  • Helper for other arch dependencies, including JUnit test rules

Hilt

  • Dependency injection library to allow the various app components to best utlisie their dependencies and improve testability

Navigation

  • Default navigation library for Compose

Kotlinx Coroutines

  • Asynchronous programming to obtain data from the network and leverage concurrency concepts for a more performant app

Retrofit

  • HTTP client that supports coroutines

Moshi

  • JSON Parser, used to parse requests on the data layer for Entities (coupled with okhhtp interceptors)

JUnit

  • This was used for unit testing the use cases, ViewModels, and the Repositories

Mockk / Mockito

  • Used to provide test fakes / doubles to aid in testing other components by reducing side effects of their intrinsic dependencies

Truth

  • Readable Assertions Library to aid test fidelity

Espresso

  • Used for writing Android UI tests (that require the Android system components i.e. Activities, some Composables)

Coil

  • Image loading for Android backed by Kotlin Coroutines.

Testing

Coverage can always be improved. Included a small sample of various test types to cover all three layers. Mainly unit, integrated, instrumented tests.

  • @Composables, ViewModels, Usecases, Repositories have automated tests.

Known Improvements:

  • Offline support - use of a snackbar to inform the user there is poor or no internet connectivity. Currently just a basic message.

Out of Scope

  • Offline mode
  • Minor testing in obfuscated mode / Proguard mode only
  • Persist the Articles to local storage so the user always has access even when offline

finnews's People

Contributors

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