jsericksk / Simple-Chat

Simple chat project created with Jetpack Compose and Firebase, using clean architecture + MVVM.
MIT License
19 stars 3 forks source link
clean-architecture datastore-android firebase-authentication firebase-cloud-storage firebase-firestore-database jetpack-compose multimodule-android-app mvvm-android

Simple Chat with Jetpack Compose and Firebase

About the project

When this project was initially created, the main objective was to improve my knowledge of Firebase and Jetpack Compose, in addition to creating a chat app with several different Firebase tools. However, in the recreation, the goal was a little more distinct from the initial idea.

The project was recreated in order to improve my knowledge in modularization and clean architecture, with a project divided into layers separated by different modules.

Project architecture

Structure in Firebase Firestore

App features

Clone

After cloning the repository, follow the steps of Firebase project setup and add your google-services.json file to the project.

Explanation of project modules and layers

- app

Android module. It represents the layer popularly known as "presentation", which contains all the code and logic related to the user interface, which is made using Jetpack Compose.

- domain

Common Kotlin module, no dependencies with Android. Represents the app's business rules. Contains all the use cases responsible for CRUD and data validation, in addition to the repository interfaces.

- data

Android module. Represents the app's data layer, used to get/save both remote and local data. Contains the domain layer repository implementations.

- common

Common Kotlin module, no dependencies with Android. Contains some useful classes that will be used in all other layers, like preference constants and exceptions.

Push notifications

The old version of this project has the function of push notifications when receiving new messages, but this functionality is not present in the current project.

Unit tests

The project has some unit tests of the validation use cases, which can be accessed in the domain module.

Technologies and libraries used