/jetpack-compose-clean-architecture

Modularized Jetpack Compose App with Use Case Pattern | App Marketplace Sample 🎉

Primary LanguageKotlinMIT LicenseMIT

Supercool App with Jetpack Compose and Use Case Design Pattern 🚀

An Android app built with Jetpack Compose and Kotlin, using the awesome Use Case design pattern 🤘. It consumes DummyJSON - a Fake REST API of JSON to create a unique and exciting marketplace experience.

With FakeProductsAPI, you can enjoy different types of REST Endpoints filled with JSON data, allowing you to focus on developing the frontend with your favorite framework and library, and leaving the backend concerns behind. Get ready for some serious fun! 😎

Cool Tech Stack!

  • Kotlin - The futuristic programming language that can run on JVM! It's the officially supported programming language for Android Studio and the community is moving rapidly from Java to Kotlin.
  • Android KTX - Concise and idiomatic Kotlin library to Jetpack and Android platform APIs. It's like magic!
  • AndroidX - The supercharged version of Android Support Library that's way better!
  • Lifecycle - With great power comes great responsibility. It's designed to perform actions based on lifecycle changes of components like activities and fragments.
  • Viewmodel -The ViewModel class is like a superhero that stores and manages UI-related data in a lifecycle conscious way!
  • LiveData - A lifecycle-aware data holder with the observer pattern. It's like a superpower!
  • Kotlin Coroutines - A concurrency design pattern that simplifies async code execution on Android. It's like a secret weapon!
  • Retrofit - The superhero REST Client for Java and Android by Square inc under Apache 2.0 license. It's a simple network library used for network transactions and capturing JSON response from web services.
  • GSON - The superhero JSON Parser that understands Kotlin non-nullable and default parameters. It's like a genius!
  • Flow - The superhero type in Coroutines that can emit multiple values sequentially. It's like a superpower for async code execution!
  • Hilt - A dependency injection library for Android that reduces the boilerplate of manual dependency injection. It's like a magic wand!
  • Navigation Components - The superhero that helps you implement navigation from simple button clicks to more complex patterns. It's like a GPS for your app!
  • Logging Interceptor - The superhero interceptor that logs HTTP request and response data. It's like a CCTV for network transactions!
  • GitHub Actions - GitHub Actions are like loyal minions that automate all your software workflows. Build, test, and deploy your code right from GitHub! It's like having your own army of robots!
  • Mockito Kotlin 👨‍🔬 - Feeling tired of writing boring and tedious unit tests? Fear not, for Mockito Kotlin is here to save the day! This powerful library allows you to mock objects and functions in a breeze, so you can focus on writing awesome code that blows everyone's minds.
  • OkHttp3 🌐 - Looking for a reliable and efficient HTTP client for your app? Look no further than OkHttp3! This battle-tested library is used by some of the largest apps out there, and for good reason: it's fast, reliable, and easy to use.
  • Coil 🌀 - Tired of dealing with slow and clunky image loading libraries? Say goodbye to your troubles and hello to Coil! This sleek and powerful library makes loading images a breeze, with an intuitive API and impressive performance.
  • Room 🏠 - Need a database solution that just works? Room has got you covered! This powerful library makes it easy to store and retrieve data from a SQLite database, with an intuitive API and robust feature set. Whether you're building a simple to-do list app or a complex CRM system, Room has everything you need.
  • Accompanist Pager 📜 - Looking to add some slick page navigation to your app? Accompanist Pager is the library for you! With a range of customizable options and an intuitive API, this library makes it easy to create stunning page layouts that will keep your users engaged and coming back for more.
  • Material Compose 💄 - Want to make your app look and feel like a million bucks? Material Compose is the answer! This library provides a range of customizable components and widgets that will make your app look sleek and polished, with an intuitive API that makes it easy to get started. Whether you're building a small app or a massive enterprise system, Material Compose has everything you need to take your UI to the next level.

Demo!

Check out this cool GIF of the app in action! 🎬

Compose Usecase Pattern

TODO

  • Setup modularization.
  • Set up a local database with Room.
  • Set up remote data with retrofit.
  • Implement the repository pattern.
  • Implement the use-case pattern.
  • Set up dependency injection with Hilt.
  • Migrate to Compose Material 3.
  • Update the home UI to an adaptive layout (bottom navigation, navigation rail, navigation drawer).
  • Implement unit testing.
  • Implement UI/Instrumented Testing.

Future

  • Plan migration from Room to SQLDelight.
  • Plan migration from Retrofit to Ktor.

Setup Requirements

  • An Android device or emulator 📱
  • Android Studio 💻

Getting Started

Ready to try it out yourself? Here's what to do:

  1. Clone this project 🐑
  2. Import the project into Android Studio 🚀
  3. Connect your Android device via USB or start your emulator 🌐
  4. Once the project has finished setting up, click the "run" button 🏃‍♂️

Support

  • Did you find this project useful? Show some love by clicking the ⭐️ button in the upper right corner! ❤️
  • Notice anything else missing? File an issue 🚨
  • Want to contribute? Whether it's fixing typos in docs or reviewing code, we welcome all contributions! 🤝