gcandrade10 / posts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Posts

This is a demo app using JSON Placeholder

We are using the following endpoints:

  • /posts
  • /posts/{id}/comment
  • /users/{userId}

We are using retrofit with coroutines, koin for dependency injection, room for persistence, navigation and viewBinding

Persistence

We are persisting only the posts, we are saving the isFavorite and isNew boolean flags too.

We have created a repository that retrieves the information from local if it exists and from remote if it doesn't.

We are using Flow for having realtime updates eachtime that something changes in the database.

Architecture

We are using the MVVM pattern, the UI has a single Activity, and each screen is fragment. Each fragment has a viewmodel and the communication between the viewmodel and the fragment is through the livedata.

Demo

posts

TODOs

  • Unit tests
  • Extensions for Either class
  • Use Either when remote calls fails instead of returning empty data.
  • Improve error handling

About


Languages

Language:Kotlin 100.0%