Coder Social home page Coder Social logo

mahmood199 / lastifyfm Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 401 KB

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.

Kotlin 100.00%

lastifyfm's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.