{"id":13773300,"url":"https://github.com/nuhkoca/libbra","last_synced_at":"2025-05-11T05:34:29.969Z","repository":{"id":42566026,"uuid":"252193036","full_name":"nuhkoca/libbra","owner":"nuhkoca","description":"A currency tracker app demonstration. It refreshes currency list every single second based on the main currency. In addition to that, main currency is selectable.","archived":false,"fork":false,"pushed_at":"2025-05-06T19:49:12.000Z","size":3181,"stargazers_count":53,"open_issues_count":2,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T20:37:41.986Z","etag":null,"topics":["android","architecture-components","bindingadapter","coil","dagger2","kotlin","lifecycle-components","navigation-architecture-component","retrofit2","viewbinding"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuhkoca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-01T14:08:03.000Z","updated_at":"2025-05-06T19:49:15.000Z","dependencies_parsed_at":"2023-09-24T11:34:34.319Z","dependency_job_id":"7747737b-cdf4-49e9-940f-fb02c58546bb","html_url":"https://github.com/nuhkoca/libbra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhkoca%2Flibbra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhkoca%2Flibbra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhkoca%2Flibbra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhkoca%2Flibbra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuhkoca","download_url":"https://codeload.github.com/nuhkoca/libbra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523690,"owners_count":21921815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","architecture-components","bindingadapter","coil","dagger2","kotlin","lifecycle-components","navigation-architecture-component","retrofit2","viewbinding"],"created_at":"2024-08-03T17:01:14.037Z","updated_at":"2025-05-11T05:34:27.617Z","avatar_url":"https://github.com/nuhkoca.png","language":"Kotlin","funding_links":[],"categories":[":art: Pattern"],"sub_categories":["MVVM"],"readme":"## Libbra\n![Libbra](https://github.com/nuhkoca/revolut-task-libbra/workflows/Libbra/badge.svg)\n[![CodeStyle](https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg)](https://ktlint.github.io/)\n[![Kotlin Version](https://img.shields.io/badge/kotlin-1.3.61-blue.svg)](http://kotlinlang.org/)\n[![Gradle](https://lv.binarybabel.org/catalog-api/gradle/latest.svg)](https://lv.binarybabel.org/catalog/gradle/latest)\n[![API](https://img.shields.io/badge/API-21%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=21)\n[![License](https://img.shields.io/badge/License-Apache%202.0-lightgrey.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"art/preview.png\" alt=\"Libbra Preview\" height=\"800\"\u003e\u003c/p\u003e\n\nLibbra is a sample app that allows to track currency exchanges. This app presents modern approach to [Android](https://www.android.com/) application development using [Kotlin](https://kotlinlang.org/) and latest tech-stack.\n\nThis project is a hiring task by [Revolut](https://www.revolut.com/). The goal of the project is to demonstrate best practices, provide a set of guidelines, and present modern Android\napplication architecture that is modular, scalable, maintainable and testable. This application may look simple, but it\nhas all of these small details that will set the rock-solid foundation of the larger app suitable for bigger teams and\nlong application lifecycle management.\n\n## Table of Contents\n\n-   [Development](https://github.com/nuhkoca/revolut-task-libbra#development)\n-   [Design](https://github.com/nuhkoca/revolut-task-libbra#design)\n-   [Architecture](https://github.com/nuhkoca/revolut-task-libbra#architecture)\n-   [Tech-stack](https://github.com/nuhkoca/revolut-task-libbra#tech-stack)\n-   [Author](https://github.com/nuhkoca/revolut-task-libbra#author)\n-   [License](https://github.com/nuhkoca/revolut-task-libbra#license)\n\n## Development\n\n### Environment setup\n\nFirst off, you require the latest Android Studio 3.6.0 (or newer) to be able to build the app.\n\nMoreover, to sign your app for release, please refer to `keystore.properties` to find required fields.\n\n```properties\n# Signing Config\nsigning.store.password=\u003clook\u003e\nsigning.key.password=\u003clook\u003e\nsigning.key.alias=\u003clook\u003e\nsigning.store.file=\u003clook\u003e\n```\n\n### Code style\n\nTo maintain the style and quality of the code, are used the bellow static analysis tools. All of them use properly configuration and you find them in the project root directory `.{toolName}`.\n\n| Tools                                                   | Config file                                                                       | Check command             | Fix command               |\n|---------------------------------------------------------|----------------------------------------------------------------------------------:|---------------------------|---------------------------|\n| [detekt](https://github.com/arturbosch/detekt)          | [default-detekt-config](https://github.com/nuhkoca/revolut-task-libbra/tree/master/default-detekt-config.yml)     | `./gradlew detekt`        | -                         |\n| [ktlint](https://github.com/JLLeitschuh/ktlint-gradle)  | -                                                                                 | `./gradlew ktlintCheck`   | `./gradlew ktlintFormat`  |\n| [spotless](https://github.com/diffplug/spotless)        | [/spotless](https://github.com/nuhkoca/revolut-task-libbra/tree/master/spotless) | `./gradlew spotlessCheck` | `./gradlew spotlessApply` |\n| [lint](https://developer.android.com/studio/write/lint) | [/.lint](https://github.com/nuhkoca/revolut-task-libbra/tree/master/.lint)        | `./gradlew lint`          | -                         |\n\nAll these tools are integrated in [pre-commit git hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), in order\nensure that all static analysis and tests passes before you can commit your changes. To skip them for specific commit add this option at your git command:\n\n```shell\ngit commit --no-verify\n```\n\nThe pre-commit git hooks have exactly the same checks as [Github Actions](https://github.com/actions) and are defined in this [script](https://github.com/nuhkoca/revolut-task-libbra/blob/master/scripts/git-hooks/pre-commit.sh). This step ensures that all commits comply with the established rules. However the continuous integration will ultimately be validated that the changes are correct.\n\n## Design\n\nApp [support different screen sizes](https://developer.android.com/training/multiscreen/screensizes) and the content has been adapted to fit for mobile devices and tablets. To do that, it has been created a flexible layout using one or more of the following concepts:\n\n-   [Use constraintLayout](https://developer.android.com/training/multiscreen/screensizes#ConstraintLayout)\n-   [Avoid hard-coded layout sizes](https://developer.android.com/training/multiscreen/screensizes#TaskUseWrapMatchPar)\n-   [Create alternative layouts](https://developer.android.com/training/multiscreen/screensizes#alternative-layouts)\n-   [Use the smallest width qualifier](https://developer.android.com/training/multiscreen/screensizes#TaskUseSWQuali)\n-   [Use the available width qualifier](https://developer.android.com/training/multiscreen/screensizes#available-width)\n-   [Add orientation qualifiers](https://developer.android.com/training/multiscreen/screensizes#TaskUseOriQuali)\n\nIn terms of design has been followed recommendations [android material design](https://developer.android.com/guide/topics/ui/look-and-feel) comprehensive guide for visual, motion, and interaction design across platforms and devices. Granting the project in this way a great user experience (UX) and user interface (UI). For more info about UX best practices visit [link](https://developer.android.com/topic/google-play-instant/best-practices/apps).\n\nMoreover, has been implemented support for [dark theme](https://developer.android.com/guide/topics/ui/look-and-feel/darktheme) with the following benefits:\n-   Can reduce power usage by a significant amount (depending on the device’s screen technology).\n-   Improves visibility for users with low vision and those who are sensitive to bright light.\n-   Makes it easier for anyone to use a device in a low-light environment.\n\n| Page  | Light Mode                                        | Dark Mode |\n|-------|---------------------------------------------------|------------------------------------------|\n| Currency | \u003cimg src=\"art/light_mode.png\" width=\"300\"\u003e |\u003cimg src=\"art/dark_mode.png\" width=\"300\"\u003e |\n## Architecture\n\nThe architecture of the application is based, apply and strictly complies with each of the following 5 points:\n\n-   A single-activity architecture, using the [Navigation component](https://developer.android.com/guide/navigation/navigation-getting-started) to manage fragment operations.\n-   [Android architecture components](https://developer.android.com/topic/libraries/architecture/), part of Android Jetpack for give to project a robust design, testable and maintainable.\n-   Pattern [Model-View-ViewModel](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel) (MVVM) facilitating a [separation](https://en.wikipedia.org/wiki/Separation_of_concerns) of development of the graphical user interface.\n-   [S.O.L.I.D](https://en.wikipedia.org/wiki/SOLID) design principles intended to make software designs more understandable, flexible and maintainable.\n-   [Modular app architecture](https://proandroiddev.com/build-a-modular-android-app-architecture-25342d99de82) allows to be developed features in isolation, independently from other features.\n\n### Modules\n\nModules are collection of source files and build settings that allow you to divide a project into discrete units of functionality. In this case apart from dividing by functionality/responsibility, existing the following dependence between them:\n\nThe above graph shows the app modularisation:\n\n-   `:app` depends on `:rules`.\n-   `:rules` depends on nothing.\n\n#### App module\n\nThe `:app` module is an [com.android.application](https://developer.android.com/studio/build/), which is needed to create the app bundle.  It is also responsible for initiating the [dependency graph](https://github.com/google/dagger) and another project global libraries, differentiating especially between different app environments.\n\n#### Rules modules\n\nThe `:rules` module is an [com.android.library](https://developer.android.com/studio/projects/android-library), basically contains lint checks for the entire project.\n\n### Architecture components\n\nIdeally, ViewModels shouldn’t know anything about Android. This improves testability, leak safety and modularity. ViewModels have different scopes than activities or fragments. While a ViewModel is alive and running, an activity can be in any of its lifecycle states. Activities and fragments can be destroyed and created again while the ViewModel is unaware.\n\nPassing a reference of the View (activity or fragment) to the ViewModel is a serious risk. Lets assume the ViewModel requests data from the network and the data comes back some time later. At that moment, the View reference might be destroyed or might be an old activity that is no longer visible, generating a memory leak and, possibly, a crash.\n\n\u003cimg src=\"art/design_pattern.png\"\u003e\n\nThe communication between the different layers follow the above diagram using the reactive paradigm, observing changes on components without need of callbacks avoiding leaks and edge cases related with them.\n\n## Tech-stack\n\nThis project takes advantage of many popular libraries, plugins and tools of the Android ecosystem. Most of the libraries are in the stable version, unless there is a good reason to use non-stable dependency.\n\n### Dependencies\n\n-   [Jetpack](https://developer.android.com/jetpack):\n    -   [Android KTX](https://developer.android.com/kotlin/ktx.html) - provide concise, idiomatic Kotlin to Jetpack and Android platform APIs.\n    -   [AndroidX](https://developer.android.com/jetpack/androidx) - major improvement to the original Android [Support Library](https://developer.android.com/topic/libraries/support-library/index), which is no longer maintained.\n    -   [Data Binding](https://developer.android.com/topic/libraries/data-binding/) - allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.\n    -   [ViewBinding](https://developer.android.com/topic/libraries/view-binding) - allows you to more easily write code that interacts with views.\n    -   [Lifecycle](https://developer.android.com/topic/libraries/architecture/lifecycle) - perform actions in response to a change in the lifecycle status of another component, such as activities and fragments.\n    -   [LiveData](https://developer.android.com/topic/libraries/architecture/livedata) - lifecycle-aware, meaning it respects the lifecycle of other app components, such as activities, fragments, or services.\n    -   [Navigation](https://developer.android.com/guide/navigation/) - helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer.\n    -   [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) - designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations.\n-   [Coroutines](https://kotlinlang.org/docs/reference/coroutines-overview.html) - managing background threads with simplified code and reducing needs for callbacks.\n-   [Dagger2](https://dagger.dev/) - dependency injector for replacement all FactoryFactory classes.\n-   [Retrofit](https://square.github.io/retrofit/) - type-safe HTTP client.\n-   [Coil](https://github.com/coil-kt/coil) - image loading library for Android backed by Kotlin Coroutines.\n-   [Kotlinx Serialization](https://github.com/Kotlin/kotlinx.serialization) - consists of a compiler plugin, that generates visitor code for serializable classes, runtime library with core serialization API and JSON format, and support libraries with ProtoBuf, CBOR and properties formats.\n-   [Timber](https://github.com/JakeWharton/timber) - a logger with a small, extensible API which provides utility on top of Android's normal Log class.\n-   [and more...](https://github.com/nuhkoca/revolut-task-libbra/blob/master/buildSrc/src/main/kotlin/dependencies/Dependencies.kt)\n\n### Test dependencies\n\n-   [Orchestrator](https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator) - allows you to run each of your app's tests within its own invocation of Instrumentation.\n-   [Espresso](https://developer.android.com/training/testing/espresso) - to write concise, beautiful, and reliable Android UI tests\n-   [JUnit](https://github.com/junit-team/junit4) - a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.\n-   [JUnit5](https://github.com/mannodermaus/android-junit5) - a Gradle plugin that allows for the execution of JUnit 5 tests in Android environments using Android Gradle Plugin 3.5.0 or later.\n-   [Mockk](https://github.com/mockk/mockk) - provides DSL to mock behavior. Built from zero to fit Kotlin language.\n-   [AndroidX](https://github.com/android/android-test) - the androidx test library provides an extensive framework for testing Android apps.\n-   [and more...](https://github.com/nuhkoca/revolut-task-libbra/blob/master/buildSrc/src/main/kotlin/dependencies/Dependencies.kt)\n\n### Plugins\n\n-   [Ktlint](https://github.com/JLLeitschuh/ktlint-gradle) - a pluging that creates convenient tasks in your Gradle project that run ktlint checks or do code auto format.\n-   [Detekt](https://github.com/arturbosch/detekt) - a static code analysis tool for the Kotlin programming language.\n-   [Spotless](https://github.com/diffplug/spotless) - a code formatter can do more than just find formatting errors.\n-   [Versions](https://github.com/ben-manes/gradle-versions-plugin) - make easy to determine which dependencies have updates.\n-   [JUnit5](https://github.com/mannodermaus/android-junit5) - a Gradle plugin that allows for the execution of JUnit5 tests in Android environments using Android Gradle Plugin 3.5.0 or later.\n-   [and more...](https://github.com/nuhkoca/revolut-task-libbra/blob/master/buildSrc/src/main/kotlin/plugins/BuildPlugins.kt)\n\n## Author\n\n\u003ca href=\"https://twitter.com/_nuhkoca\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://avatars0.githubusercontent.com/u/5719389?s=460\u0026u=38c806173de440d6e307215b3befd588a918ad91\u0026v=4\" width=\"70\" align=\"left\"\u003e\n\u003c/a\u003e\n\n**Nuh Koca**\n\n[![Linkedin](https://img.shields.io/badge/-linkedin-grey?logo=linkedin)](https://www.linkedin.com/in/nuhkoca/)\n[![Twitter](https://img.shields.io/badge/-twitter-grey?logo=twitter)](https://twitter.com/_nuhkoca)\n[![Medium](https://img.shields.io/badge/-medium-grey?logo=medium)](https://medium.com/@nuhkocaa)\n[![Web](https://img.shields.io/badge/-web-grey?logo=appveyor)](http://nuhkoca.com/)\n\n## License\n\n* The preview images were created using 'Previewed' at [Previewed](https://previewed.app/)\n* The currency and application icons were created at [Iconscout](https://iconscout.com/)\n\n```license\nCopyright 2020 Nuh Koca\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhkoca%2Flibbra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuhkoca%2Flibbra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhkoca%2Flibbra/lists"}