Skip to content

jraska/github-client

Repository files navigation

github-client

Experimental architecture app with example usage intended to be a showcase, test and skeleton app.

Module graph

Topics demonstrated

  • If you are interested in any of these topics, feel free to reach out by creating an issue or contact me on Twitter - I'm happy to chat, exchange opinions or development stories.

Modularisation

  • Modularised app with flat structure: :app -> :feature* -> *-api with a graph height of 2.
  • Example usage of module graph assertion - see here.
  • Modularisation statistics reporting to Mixpanel - see this PR.
  • Core features (Analytics, Configuration, Crash reporting, Networking, Logging, Deep Linking) are behing simple pure Kotlin interfaces to achieve convenient core interfaces.
  • Features are composed together within AppComponent in plugin based manner. Each feature contributes by Dagger module. To add a feature only module and Gradle dependency lines are needed.
  • Plugin based composition of features and modules contributing to collection of "plugins" - see: OnAppCreate, or LinkLauncher

Testing

  • UI Instrumentation testing using Espresso and mocking network layer with okhttp3.MockWebServer to achieve isolation. See UsersActivityFlowTest or DeepLinkLaunchTest
  • Tests are run on Firebase Test Lab. See PR
  • UI tests on Firebase Test Lab results reporting to Mixpanel - see this PR.
  • Instrumented tests can live in modules for fast local iteration - see this PR or this issue track.
  • Uses LiveData-Testing to test ViewModel. Article
  • ViewModels are tested with real dependencies, faking only network code and therefore simulating the real usage, increasing the confidence in tests - Example, Related article on philosophy. They are fast as they run on JVM.
  • Repository tests are implemented similar like ViewModels tests - using real dependnecies and faking network requests only - Example
  • Push integration is tested end to end through UI test - see this PR.

Release & CI

Architecture

  • Android Architectue Components LiveData and ViewModel are used to connect Activities with app logic
  • Deep Link navigation used across the app - Article
  • All core services have its lightweight fake implementation. See Fakes
  • Dependency replacement in test is done by Dagger components in TestUITestApp
  • Coroutines is used for threading everywhere, allowing proper idling of UI tests. Also AppDispatchers dependency makes all threading testable.
  • Push is implemented by using Firebase Cloud Messaging. See PushActionCommand. Thanks to deep link navigation app can be controlled remotely by executing deep links - LaunchDeepLinkCommand : PushActionCommand
  • TopActivityProvider to avoid having Context dependencie everywhere and to be able to have cleaner pure Kotlin interfaces
  • Enforced ownership of remote configuration and analytics events - Details on PR. More on why these need to be explicitly owned on this article.

Metrics

In case you want to copy and use any of metrics with your analytics platform, the only adjustment could be your own AnalyticsReporter implementation.

  • Build time tracking with reporting to Mixpanel - see this PR.
  • Modularisation statistics reporting to Mixpanel - see this PR.
  • Dependencies reporting to see which modules depend on too much - see this PR
  • Lint issues tracking to see the health of modules - see this PR
  • UI tests on Firebase Test Lab results reporting to Mixpanel - see this PR.
  • Sonarqube Cloud integrated.
  • Key 4 DevOps metrics implemented through build time reporting and GitHub Webhooks
  • Lead Time of commit to production - see this PR. Screenshot 2021-04-10 at 17 47 05

About

Experimental architecture app with example usage intended to be a showcase, test and skeleton app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages