/github-searcher

Android app capable of searching GitHub repositories by keywords as well as any qualifiers using the v4 GraphQL API.

Primary LanguageJava

CircleCI

Github Searcher

Summary

Android app capable of searching GitHub repositories by keywords as well as any qualifiers using the v4 GraphQL API.

Architecture

The application uses MVP Architecture together with dependency injection to provide the objects needed for each view/presenter dynamically. Also it applies the repository pattern to provide access to a cache of objects which are kept in sync with a local data storage and a remote data storage. The local data storage provides persistence when the app subsequently opens without internet.

The main repository list also has infinite scrolling capabilities requesting the github api more repositories based on the id of the last repository fetched.

Libraries/Dependencies

  • Dagger2 and Dagger-Android for dependency injection to achieve a decoupled more testable logic
  • Room for storing data locally creating redundancy on network failure
  • Retrofit2 for retrieving remote data
  • Retrofit2 converter-gson
  • okHttp Logging Interceptor for intercepting and logging all request and response made using retrofit for converting json to java classes automatically
  • Picasso for loading images efficiently into the views and some transformations
  • Android Debug DB for live browsing DB content and debugging issues related to local data storage
  • Mockito for mocking classes for unit testing

Pre-requisites / How to run

Before being able to compile and use the app you must provide your own Github api token in on ./gradle.properties githubSearcher_gitHubApiToken variable. To obtain a Github api token follow the instructions on: Authenticating with GraphQL

Limitations/Known issues

  • Because of time constraints the user list inside the repository details has currently only the users requested on the GetRepositoriesApiRequest, it will not load more items on the fly.
  • After extensive testing and integrations attempts I decided not to use the apollo-android library which seemed to be the best option to query GraphQL backends as I was not able to achieve the validation of my scheme and queries even after testing then on GitHub explorer. However using retrofit to map the objects has a direct and easy to understand approach, and the queries/response were also translated to a POJO class GetRepositoriesApiRequest/RepositoriesApiResponse