ahmedalaishat / themoviedb-cleanarchitecture

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Movie DB

Cover

The Movie DB app is an implementation of Clean Architecture. It is a native Android app built using Jetpack Compose with modern Android development using Hilt, Coroutines, Flow, Jetpack, and Material Design.

📲 Download APK

Download the APK from this Link.

🛠 Tech stack & Open-source libraries

  • Minimum SDK level 24
  • Kotlin based, Coroutines + Flow for asynchronous.
  • Jetpack:
    • Compose: Android’s modern toolkit for building native UI.
    • ViewModel: UI related data holder and lifecycle aware.
    • App Startup: Provides a straightforward, performant way to initialize components at application startup.
    • Hilt Navigation: For navigating screens and injecting dependencies.
    • Hilt: for dependency injection.
  • Ktor: Kotlin-based framework for building efficient HTTP clients in Kotlin applications.
  • SQLDelight: Generates Kotlin APIs from SQL statements for seamless database integration.
  • Coil: Image loading library for loading images from network.
  • Material-Components: Material design components for building ripple animation, and CardView.
  • Timber: A logger with a small, extensible API.

Architecture

CleanArchitecture-Android

The project is based on the Clean Architecture and the MVVM pattern. It uses the Google's ViewModel as a UI state holder to take advantage of its benefits like persistence, view lifecycle scooping, and SavedStateHandle.

With this loosely coupled architecture, you can increase the reusability of components and scalability of your app.

UI Layer

The UI layer consists of Jetpack Compose UI elements to configure screens that interact with users and the Presentation layer by sending actions to it and observing it's data changes.

Presentation Layer

The Presentation layer contains ViewModels that present the app states and restores data when configuration changes. The ViewModels interact with the Domain layer by Use Cases.

Domain Layer

  • Use Cases: Act as an abstraction layer between the Domain layer and the Presentation layer. Use Cases encapsulate the logic required to perform tasks like retrieving movies list or submit movie ratings.
  • Repositories: Interfaces that define the contract for accessing and managing data from external data sources(local DB, and remote server). The Domain layer defines the repository interfaces, while the actual implementation is provided in the Data layer. This separation allows the Domain layer to remain agnostic to the data source.
  • Domain Models: Plain Kotlin classes that represent the core data structures and business objects of the app. These objects encapsulate the data and behavior that are central to the app's domain.

Data Layer

The Data layer contains the Repositories implementation, it queries data from the local database and requests remote data from the network. It follows the single source of truth principle.

About


Languages

Language:Kotlin 100.0%