/LastifyFM

A Clean architecture && MVI based project which shows songs, their genres, albums, artist and more details. Each of the attribute can be viewed into more details.

Primary LanguageKotlin

LastifyFM

This project follows a combination of 2 componnents. One is the clean architecture and the other is the MVI(Model-View-Intent) flow

What is MVI ?

MVI Stands for Model View Intent. The architecture is inspired by the unidirectional control flow. The role of each MVI component is as follows:

  • Model : Model in MVI represents a state. For example UI might have different states like Data Loading, Error, Update UI etc. Each State is stored as similar to the object in the model. This component interacts with beneath layers to access data.
  • View : View represents our UI layer. View is nothing but an interface that is implemented by our Activities/Fragments. This interface is nothing but a container that accepts model and renders it as UI.
  • Intent : Intent represents an intent or a desire to perform an action, either by the user or the app itself.

How MVI works

For every action, View receives an Intent. The Presenter(ViewModel) observes the Intent. Then pass it on to respective domain layer to process same to give back Model. The resultant Model is translated to a state which is received by the View.

Architecture - MVI + Clean Architecture

This project follows the clean architecture which implies that each components in the archirecture points in one direction. That means child classes don't have refernce to their parent classes. The app cna be divided into 3 major areas for handling of data. They are -

  • Presentation/App: Consists of Activities, Fragments and ViewModels. This layer interacts with UI.
  • Domain: Contains the business logic of the application. This is the individual and innermost circle of clean Architecture.
  • Data: Consists of Repositories. This layer would implement interface exposed by domain layer and dispenses data to the app.

image

Diagramatic representation of Dataflow

image

App screens

  • All tags/genres screen - The screen which show the user the list of genres which user can click to see its details. User can expand the list to see more tags \

WhatsApp Image 2023-01-29 at 6 43 01 PM (1) WhatsApp Image 2023-01-29 at 6 43 01 PM

  • Then we have a genre detail screen where user can see the genre detail such as artist, albums and tracks related to that genre

WhatsApp Image 2023-01-29 at 6 43 02 PM (2) WhatsApp Image 2023-01-29 at 6 43 02 PM (1) WhatsApp Image 2023-01-29 at 6 43 02 PM

  • Clicking on albums, artist or tracks leads to details of that screen.

Note - This navigation is done only for artist and not for album and tracks as those are very similar behavior and implementation

WhatsApp Image 2023-01-29 at 6 43 03 PM

That's all folks. Thanks for reading this far. Please star this if you find this useful