htk007 / Kotlin-MVVM-Base-Architecture

This project is intent to provide a template with basic MVVM architecture framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MVVM Architecture with Kotlin

platform platform Kotlin compileSdkVersion buildToolsVersion minSdkVersion

I recommend this structure for basic projects that are not extensive.

Introduction

This project is intent to provide a template with basic MVVM architecture framework.

Advantages:

  • Simple and easy to read
  • The project has hilt integration
  • The project has Navigation Component integration

Project Structure

  • base: Base class for View and ViewModel instances.
  • data: It contains all the data accessing and manipulating components.
  • di: The directory will contain the classes responsible for dependency injection.
  • domain: The directory contains all rules.
  • ui: View classes along with their corresponding ViewModel in presentation.
  • util: Utility classes.

MVVM Design Pattern

The main players in the MVVM pattern are:

  • View: informs the ViewModel about the user’s actions

  • ViewModel: exposes streams of data relevant to the View

  • Model: abstracts the data source. The ViewModel works with the DataModel to get and save the data

The MVVM pattern supports two-way data binding between the View and ViewModel and there is a many-to-one relationship between View and ViewModel.

TO DO

  • Integration of Retrofit.
  • Integration of Repository Pattern.
  • Integration of UseCase.
  • Example of a HTTP call.
  • Add some unit tests.

Libraries

Contributing to Project

  • All contributions are welcome! Please fork this repository and contribute back using pull requests.

Don't forget to star ⭐ the repo it motivates me to share more open source

About

This project is intent to provide a template with basic MVVM architecture framework.


Languages

Language:Kotlin 100.0%