Skip to content

Latest commit

 

History

History
158 lines (123 loc) · 7.16 KB

README.md

File metadata and controls

158 lines (123 loc) · 7.16 KB

Api Error Handling in Clean Architecture

A sample app that demonstrates usage of Retrofit Adapters to handle api response and exceptions within a clean architecture app.

👉 Clean Architecture:

👉 Domain & Data Layer:

👉 Presentation Layer:

👉 Architecture:

  • Following Clean Architecture.
  • MVI Architecture.
  • Repository Pattern.
  • Mapper.
  • Use Cases.
  • Applying SOLID principles, each class has a single job with separation of concerns by making classes independent of each other and communicating with interfaces.
  • Using Kotlin-KTS & Gradle Version Catalog to handle project dependencies.

👉 Tech Stack & Libraries:

  • ViewModel : UI related data holder, lifecycle aware.
  • Flow & StateFlow : Build data objects that notify views when the underlying database changes.
  • KotlinCoroutines : For managing background threads with simplified code and reducing needs for callbacks.
  • NavigationComponent : For navigation graph for navigating and replacing screens/fragments.
  • MaterialDesign : Use material design components in XML Design.
  • ViewBinding : Allows to more easily write code that interacts with views and replaces findViewById.
  • Dagger-Hilt : For dependency injection. Object creation and scoping is handled by Hilt.
  • Retrofit2 & OkHttp3 : To make REST requests to the web service integrated.
  • Gson : For parsing and serializing objects.
  • JUnit : For unit testing.
  • KotlinFixture : For creating dummy objects for unit testing.

👉 Modules:

  • app : The main app module, contains splash screen and handle navigation across the app.
  • core:network : Handles network calls with it's errors.
  • core:ui : Contains classes related to UI like BaseActivity and BaseFragment and other useful ui extensions.
  • core:utils : Contains utility classes and some exceptions related to business usage.
  • feature-home : Contains data, domain, presentation for home feature.

👉 Code Style:

  • Following official kotlin code style

👉 Local Development:

  • Here are some useful Gradle commands for executing this example:
    • ./gradlew clean - Deletes build directory.

👉 Contributing to Project:

  • Just fork this repository and contribute back using pull requests.
  • Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .

👉 Find this project useful ? ❤️

  • Support it by clicking the ⭐ button on the upper right of this page. ✌️

👉 Stargazers: ⭐

Stargazers repo roster for @sadanandpai/javascript-code-challenges

👉 Forkers: ⚒️

Forkers repo roster for @sadanandpai/javascript-code-challenges

👉 Donation:

If this project help you reduce time to develop, you can give me a cup of coffee :)

Buy Me A Coffee



⚠️ License:

   Copyright (C) 2024 MINA MIKHAIL PRIVATE LIMITED

   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.