explaingit

bufferapp/android-clean-architecture-boilerplate

Analysis updated 2026-07-03

3,686KotlinAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A Kotlin Android starter project from Buffer that shows Clean Architecture in action, four separate layers (UI, Presentation, Domain, Data) that never depend directly on each other.

Mindmap

mindmap
  root((clean-arch-boilerplate))
    Architecture layers
      UI module
      Presentation module
      Domain module
      Data module
    Tech stack
      Kotlin
      RxJava
      Dagger
      Retrofit OkHttp
    Testing
      Mockito unit tests
      Espresso UI tests
      Robolectric
    Use cases
      Android app template
      Learn Clean Architecture
      Testable codebase
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Use this project as a starting point for a new Android app already structured with Clean Architecture layers.

USE CASE 2

Study how the four modules (UI, Presentation, Domain, Data) communicate without directly depending on each other.

USE CASE 3

See how to write fully isolated unit tests for the Presentation and Domain layers without needing an Android device.

USE CASE 4

Learn how RxJava and Dagger work together in a real Android project by reading the sample implementation.

What is it built with?

KotlinRxJavaDaggerRetrofitOkHttpGlideGson

How does it compare?

bufferapp/android-clean-architecture-boilerplateelement-hq/element-androidgradle/kotlin-dsl-samples
Stars3,6863,6853,687
LanguageKotlinKotlinKotlin
Setup difficultymoderatehardeasy
Complexity3/54/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Android SDK with API level 26 and JDK 1.8, open in Android Studio and sync Gradle to get started.

Apache 2.0, use freely for any purpose including commercial, just keep the copyright notice.

In plain English

This is a starter project for Android apps created by the team at Buffer, the social media scheduling company. It is written entirely in Kotlin and demonstrates a way of structuring an Android app called Clean Architecture, where the code is split into distinct layers that each have a specific job and do not depend directly on each other. The project is divided into four modules. The User Interface module handles what the user sees on screen and receives data passed down from the layer above it. The Presentation module sits above the UI and controls what the UI should display, but has no knowledge of Android itself, making it testable in isolation. The Domain module holds the application's business rules, meaning the actual actions the app performs, expressed as use cases. The Data module handles fetching information, whether from a remote API or a local cache, and feeds it upward through the stack. Each layer has its own version of the data models, and mappers translate between them as data moves up or down. The sample app built on this structure displays a list of Buffer team members fetched from a remote source. It is intentionally simple so the architecture patterns are easy to follow without the distraction of complex application logic. The libraries used include RxJava for handling asynchronous data streams, Dagger for dependency injection (a way of automatically supplying objects where they are needed), Retrofit and OkHttp for network requests, Glide for loading images, and Gson for parsing JSON. Testing uses Mockito for unit tests, Espresso for UI tests, and Robolectric for running Android tests on a regular machine without a device. The README notes that Clean Architecture adds more structure than a small sample strictly needs, and acknowledges it will not be the right fit for every project. It was created to show the approach in a clear, minimal form and to serve as a starting point for future projects. The project requires Android SDK with API level 26 and JDK 1.8.

Copy-paste prompts

Prompt 1
I want to add a new feature to an app built on bufferapp/android-clean-architecture-boilerplate. Walk me through creating a new use case in the Domain module and wiring it through Presentation to the UI.
Prompt 2
Show me how the Data module in this boilerplate switches between a remote API source and a local cache, and how I add a Room database as the local source.
Prompt 3
I'm new to Dagger. Using this boilerplate as the example, explain how dependency injection is set up and how a Repository gets injected into a use case.
Prompt 4
Help me write a unit test for a use case in the Domain module of this Clean Architecture Android project using Mockito, without needing an emulator.
Prompt 5
Convert the RxJava streams in this boilerplate to Kotlin Coroutines and Flow, what files need to change and what are the key migration steps?

Frequently asked questions

What is android-clean-architecture-boilerplate?

A Kotlin Android starter project from Buffer that shows Clean Architecture in action, four separate layers (UI, Presentation, Domain, Data) that never depend directly on each other.

What language is android-clean-architecture-boilerplate written in?

Mainly Kotlin. The stack also includes Kotlin, RxJava, Dagger.

What license does android-clean-architecture-boilerplate use?

Apache 2.0, use freely for any purpose including commercial, just keep the copyright notice.

How hard is android-clean-architecture-boilerplate to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is android-clean-architecture-boilerplate for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub bufferapp on gitmyhub

Verify against the repo before relying on details.