Skip to content

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

Notifications You must be signed in to change notification settings

Mina-Mikhail/Network-Error-Handling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.