Need help with buddysearch?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

212 Stars 44 Forks Apache License 2.0 163 Commits 9 Opened issues


Android Clean Architecture example using MVP, Rx: RxJava, RxAndroid, Dagger 2, Data Binding, Retrolambda, Firebase Database, Firebase Auth, Firebase Messaging (FCM), Realm

Services available


Need anything else?

Contributors list

# 151,323
159 commits

Buddy Search Build Status

This app demonstrates how to use Uncle Bob's Clean Architecture in practice, with MVP on presentation layer. App is based on this famous repository (thanks author for it). But for me, there were a lot of things that I wanted somehow to modify or improve, somewhere to simplify or to generify the code with creating Base-classes, somewhere to separate or move the code to other places etc. That's why I created this app and I will continue developing it and show, thus, how to apply this architecture approach on real projects.

Change Log


Demo 1.1.0

The app, for now, allows to Sign in with Google using FirebaseAuth and to chat with other users across the FirebaseDatabase service. It is also possible to edit and delete your message. App provides offline data cache with Realm. Also user can edit his profile on appropriate screen. If user is not on a Dialog Screen or application is in background, the user will receive Push Notification message, which appear in Android Status Bar. By clicking on message notification, Dialog Screen will be opened for messaging.

Sign In

Push Notification Edit Profile
Sign in demo movie Push Notification demo movie Edit profile demo movie

Send/Edit/Delete Message

Sign Out
Send/edit/delete message demo movie Sign out demo movie

Used libraries

  • Dagger2 - used to make the app more structural and its modules - more independent (weak connected).
  • RxJava/RxAndroid - used for multithreading.
  • FirebaseAuth - used for user authentication.
  • FirebaseDatabase - used as a remote data repository.
  • FirebaseMessaging - used for Push Notifications implementation.
  • Realm - used for local data caching.
  • Play Services Auth - used for signing in with Google.
  • Android Data Binding Library.
  • LeakCanary - used to avoid possible memory leaks.
  • Lombok - useful annotations.
  • Parceler - used to make work with
    more easier.
  • Saripaar - used for user input validation.
  • Dart / Henson - annotation processor that make navigation between screens easier (with extras injection).
  • AppCompat, Design Library.

Libraries for testing * JUnit * Mockito

Project Setup

  • Add Firebase to Android Project, for data module. (As a result you should have google-services.json file in data module)
  • Go to the Firebase Console and navigate to your project:
    • Select the Auth panel and then click the Sign In Method tab.
    • Click Google and turn on the Enable switch, then click Save.
  • Compile the presentation module and run on your device or emulator. (should have Play Services enabled)

Description of Classes and Layers

  • Data layer - responsible for working with all data that app requires.
    • Entity - data class for data layer.
    • BaseMapper - can convert one object to another and vice versa.
    • EntityStore - provides data (used by Repository)
    • Cache - an extension to EntityStore (also can provide all related data), but with own methods for data caching.
  • Domain layer - the whole business logic of your project is described here. When you decide to implement a new feature in app, start from this layer. Describe new dto, usecases and repositories for it.
    • Dto - data class on domain layer.
    • UseCase - appropriate business logic use case is described here.
    • Repository - describes what data should pe provided from data layer.
  • Presentation layer - platform-specific implementation of the app.
    • Model - data class for presentation layer (MVP Model).
    • View - MVP View
    • Presenter - MVP Presenter
  • Library module - base classes for data and presentation layers can be found here.

Dagger 2 - dependency injection (implemented on

  • Scope
    • @AppScope
      - global scope (one instance of specific object per application)
    • @ViewScope
      - one instance of specific object per MVP-View. As an MVP-View next android classes can be used:
  • Component
    • AppComponent
      - global component (use
    • ViewComponent
      - uses
  • Module
    • AppModule
      - provides global application objects like
      etc (included in
    • RepositoryModule
      - provides
      objects (included in
    • CacheModule
      - provides
      objects (included in
    • EntityStoreModule
      - provides
      objects (included in
    • ViewModule
      - provides
      -related objects (included in


  • Add presentation_mvvm module - Write alternative presentation layer to demonstrate MVVM architectural pattern.
  • Write data layer tests.
  • Write presentation layer tests.
  • Add NavigationDrawer and a few fragments with some new logic: Dialogs List, Users Map (using Google Map) etc.
  • Write Kotlin version of this project to demonstrate power and benefits of this programming language on real project example.


Copyright 2016 Ihor Vitruk

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

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.