SkillAgentSearch skills...

RortyCompose.V2

πŸš€ Sample Android Clean Architecture on JetRorty App focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack with Compose.

Install / Use

/learn @developersancho/RortyCompose.V2

README

CodeStyle Compose Kotlin Android API Gradle License Apache 2.0

<p align="center"> <img height="250" src="https://user-images.githubusercontent.com/80427734/147891822-5cd34c80-8dca-4d34-8278-2aa3bf36913f.png"/> </p> <h1 align="center"> Rorty Compose Android </h1>

Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.

The goal of the project is to demonstrate best practices, provide a set of guidelines, and present modern Android application architecture that is modular, scalable, maintainable and testable. This application may look simple, but it has all of these small details that will set the rock-solid foundation of the larger app suitable for bigger teams and long application lifecycle management.

An android app built using Kotlin that consumes Rick and Morty API to display characters,episodes,Location from the TV Series. It has been built following Clean Architecture Principle, Repository Pattern, MVVM Architecture in the presentation layer as well as Jetpack components.

<img src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" width="200">

Environment Setup

You require the minimum Android Studio Bumblebee (2021.1.1) to be able to build the app.

Architecture

A well planned architecture is extremely important for an app to scale and all architectures have one common goal- to manage complexity of your app. This isn't something to be worried about in smaller apps however it may prove very useful when working on apps with longer development lifecycle and a bigger team.

Clean architecture was proposed by Robert C. Martin in 2012 in the Clean Code Blog and it follow the SOLID principle.

<p align="center"><img src="art/clean_arch.jpeg" alt="Clean Architecture"></p>

The circles represent different layers of your app. Note that:

  • The center circle is the most abstract, and the outer circle is the most concrete. This is called the Abstraction Principle. The Abstraction Principle specifies that inner circles should contain business logic, and outer circles should contain implementation details.

  • Another principle of Clean Architecture is the Dependency Inversion. This rule specifies that each circle can depend only on the nearest inward circle ie. low-level modules do not depend on high-level modules but the other way around.

<p align="center"><img src="art/architecture.png" alt="Clean Architecture Diagram"></p>

Why Clean Architecture?

  • Loose coupling between the code - The code can easily be modified without affecting any or a large part of the app's codebase thus easier to scale the application later on.
  • Easier to test code.
  • Separation of Concern - Different modules have specific responsibilities making it easier for modification and maintenance.

S.O.L.I.D Principles

  • Single Responsibility: Each software component should have only one reason to change – one responsibility.

  • Open-Closed: You should be able to extend the behavior of a component, without breaking its usage, or modifying its extensions.

  • Liskov Substitution: If you have a class of one type, and any subclasses of that class, you should be able to represent the base class usage with the subclass, without breaking the app.

  • Interface Segregation: It’s better to have many smaller interfaces than a large one, to prevent the class from implementing the methods that it doesn’t need.

  • Dependency Inversion: Components should depend on abstractions rather than concrete implementations. Also higher level modules shouldn’t depend on lower level modules.

Layers

Project Structure

<p align="center"><img src="art/project.png" alt="Project Structure" width="500"></p>

BuildSrc

The buildSrc layer is responsible for dependency management. It control and manage all dependencies in one place with Kotlin.

App

The app layer is responsible for common and general properties.

  • component: This is responsible for general view.

  • widget: This is responsible for common view components that using app.

  • theme: Defines themes, colors, fonts and resource files.

Provider

The provider layer is responsible for navigation, resource and theme provider.

Libraries

The libraries layer is responsible for base structure.

  • framework: Contains different utilities that can be used by the different modules and base structures.

  • jetframework: Contains different utilities that can be used by the different modules and base structures only for Jet Compose.

  • testing: Contains the definitions of the test utilities.

Data

The data layer is responsible for selecting the proper data source for the domain layer. It contains the implementations of the repositories declared in the domain layer.

Components of data layer include:

  • model

    -dto: Defines dto of ui model, also perform data transformation between domain, response and entity models.

    -local: Defines the schema of SQLite database.

    -remote: Defines POJO of network responses.

  • local: This is responsible for performing caching operations using Room.

  • remote: This is responsible for performing network operations eg. defining API endpoints using Retrofit.

  • repository: Responsible for exposing data to the domain layer.

Domain

This is the core layer of the application. The domain layer is independent of any other layers thus ] domain business logic can be independent from other layers.This means that changes in other layers will have no effect on domain layer eg. screen UI (presentation layer) or changing database (data layer) will not result in any code change withing domain layer.

Components of domain layer include:

  • usecase: They enclose a single action, like getting data from a database or posting to a service. They use the repositories to resolve the action they are supposed to do. They usually override the operator invoke , so they can be called as a function.

Presentation

The features layer contains components involved in showing information to the user. The main part of this layer are the views(activity, compose) and ViewModels.

Demo Screenshots

| Mode | Splash | OnBoarding - Intro | |-------|---------------------------------------------------|-------------------------------------------------------| | Light | <img src="art/screenshots/splash.png" width="250">|<img src="art/screenshots/intro.png" width="250"> | | Dark | <img src="art/screenshots/splash.png" width="250">|<img src="art/screenshots/intro-dark.png" width="250"> |

| Mode | Characters | Character Favorites | Character Detail | |-------|--------------------------------------------------------------|-----------------------------------------------------------------|------------------------------------------------------------------| | Light | <img src="art/screenshots/characters.png" width="250"> | <img src="art/screenshots/characters-favs.png" width="250"> | <img src="art/screenshots/character-detail.png" width="250"> | | Dark | <img src="art/screenshots/characters-dark.png" width="250"> | <img src="art/screenshots/characters-favs-dark.png" width="250">| <img src="art/screenshots/character-detail-dark.png" width="250">|

| Mode | Episodes | Episode Favorites | Episode Detail | |-------|------------------------------------------------------------|---------------------------------------------------------------|----------------------------------------------------------------| | Light | <img src="art/screenshots/episodes.png" width="250"> | <img src="art/screenshots/episodes-favs.png" width="250"> | <img src="art/screenshots/episode-detail.png" width="250"> | | Dark | <img src="art/screenshots/episodes-dar

View on GitHub
GitHub Stars153
CategoryDevelopment
Updated2mo ago
Forks25

Languages

Kotlin

Security Score

85/100

Audited on Jan 11, 2026

No findings