Giter VIP home page Giter VIP logo

apollorickandmorty's Introduction

About ApolloRickAndMorty

Hello there , In this project I tried showcasing how to build an Android Application with clean architecture and MVVM using some of the jetpack libraries with Kotlin Coroutines & Dagger Hilt. This App is using the Rick and Morty GraphQl as a remote data source.

This app is based on the Guide to app architecture article, Kotlin 1.4, and coroutine. I also used some android architecture components like LiveData, ViewModel.

I wrote a medium article to talk about GraphQL and how to implement it in an android application, feel free to check it out.

Project Architecture

Communication between layers

  1. UI calls method from ViewModel.
  2. ViewModel executes Use case.
  3. Use case executes one or multiple Repositorie function.
  4. The Repository returns data from one or multiple Data Sources(Remote-Rick and morty GraphQL , Local-Room DB). the repository is the single source of truth
  5. Information flows back to the UI where we display the data fetched from data sources.

I made a diagram to show the flow of the data between the three layers(data, domain , presentation) data flow diagram

Project Structure

  • Data
    • This is my data layer and consists of the Repository implementation class as well as the remote and local data sources and mappers
  • Domain
    • This is the domain layer and consists of the domain models as well as the usecases.
  • UI
    • This is the presentation layer. I have set up packages by feature here. This consists of the view related code.
  • DI
    • This is where Dagger related code lives , I wanted to try out Hilt and see what it can deliver.
  • Utils
    • This is where most extension functions and constants.

Libraries Used

  • ViewModel - store and manage UI-related data in a lifecycle conscious way
  • LiveData - notify the view when data changes .
  • ViewBinding - easily write code that interacts with view
  • Material - Material Components.
  • Coroutine - performs background tasks
  • Flows - for asynchronous data streams
  • Coil - An image loading library for Android backed by Kotlin Coroutines
  • Gson - JSON Parser
  • Apollo- GraphQL client for the JVM, Android and Kotlin multiplatform
  • Dagger Hilt - dependency injector
  • Room - Save data in a local database
  • Espresso // UI test
  • Barsita -UI tests Built on top of Espresso
  • Junit // unit tests
  • Truth // Makes your test assertions and failure messages more readable

Screenshots

CharactersActivity DetailsActivity

apollorickandmorty's People

Contributors

hamdiboumaiza avatar

Stargazers

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