Skip to content

An Android app consuming MovieDb API to display Movie lists built with Jetpack Compose,Clean Architecture Principle , MVVM pattern as well as Architecture Components.

Notifications You must be signed in to change notification settings

marsdenmadoka/MovieApp

Repository files navigation

#introduction

An App consuming MovieDb API to display Movie lists built with Jetpack Compose,Clean Architecture Principle , MVVM ,MVI pattern as well as Architecture Components.

This app is now migrating to kotlin Multi Platform

🛠️Migrating to Kotlin Multi Platform (KMP) 🛠

App

The app loads the the movies from the api and displays them in a list. When the Movie is clicked the app navigates to the Details Screen which shows more details.

Architecture

The app is built using the Modular MVVM architectural pattern in a Clean Architecture and makes use of Android Jetpack components. MVVM allows for the separation of concern. The app has composable screen that communicates to ViewModel which in turn communicates to the usecases which communicates with Repository to get data.

What is Clean 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.

Prerequisite.

To run the application you'll need add your api key in gradle.properties file. Generate your api key by creating an IMDB account and generating an api key.

Screenshots

These are the app's screenshots:

       |

       |

Application Demo

Layers.

1. Domain.

This is the core layer of the application. The domain layer is independent of any other layers thus ] domain models and 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:

  • Models: Defines the core structure of the data that will be used within the application.
  • Repositories: Interfaces used by the use cases. Implemented in the data layer.
  • Use cases/Interactors: 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.

2. Data.

The data layer is responsibile 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:

  • Models -Dto Models: Defines POJO of network responses.
  • Repositories: Responsible for exposing data to the domain layer.
  • Mappers: They perform data transformation between domain, dtomodels.
  • Network: This is responsible for performing network operations eg. defining API endpoints using Retrofit.

3. Presentation.

The presentation layer contains components involved in showing information to the user. The main part of this layer are the views and viewModels.

Tech Stack

  • Jetpack Compose - Jetpack Compose is Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs.
  • Viewmodel - Manage UI related data in a lifecycle conscious way
  • Compose - A modern declarative way to build android ui
  • Retrofit - Type-safe HTTP client and supports coroutines out of the box. Used for the network calls.
  • Gson - Used to convert JSON to Java/Kotlin classes for the Retrofit
  • okhttp-logging-interceptor
  • logs HTTP request and response data.
  • kotlinx.coroutines - Library Support for coroutines
  • Hilt - Used for Dependency injection
  • Coil - Allows for fetching and displaying of images in the composables

Clean Architecture

Clean Architecture Notes

consider reading the below note very careful. It summaries on what each layer of the clean architecture should do

About

An Android app consuming MovieDb API to display Movie lists built with Jetpack Compose,Clean Architecture Principle , MVVM pattern as well as Architecture Components.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published