Skip to content

Modern android app built with Clean Architecture, MVVM and Modularization. Powered by Retrofit, OKHttp, Room database, Coroutines, Flow and Dagger-Hilt.

License

Notifications You must be signed in to change notification settings

MoatazBadawy/Phood

Repository files navigation

Phood - Discover Recipes

API Kotlin Clean Architecture MVVM

🍕 Phood: Is a modern Android app with Hilt, Coroutines, Flow, RestApi, Jetpack (Room, ViewModel), and Material Design based on Clean architecture and MVVM architecture. And also apply Modularization.


App Story

The application contains many branches, each branch contains a specific feature. For every branch, I made a Pull Request to explain the new feature that was added. I have not currently merged any branch with the develop branch and left all the PRs open as is, to facilitate review of the code through the reviewer.

About

This version of the application has a lot of features, plz go to the Releases to know what's new.

260891701-77cd21e7-d315-46fb-9508-ed3c569df4db.mp4

Project Architecture

This project follows the Clean Architecture structure and MVVM. The domain layer contains UseCases that encapsulate a single, specific task that is part of the application's business logic. The data layer implements the repository interface defined in the domain layer, providing a single source of truth for data. The UI layer uses all the components and classes related to the Android framework to get the data from the ViewModel layer and display it on the UI.

Structure (App Modules)

This project uses modularizing by feature. Every feature has it is one (data - domain - UI)

  + App <- The main module, handles hilt providers 
  + recipes/
      + data <- implements the repository interface defined in the domain layer
        - local 
        - remote
        - repositories
      + domain <- contains UseCases that encapsulate the business logic.
        - entities 
        - repository
        - usecases
      + UI <- uses MVVM with ViewModels exposing StateFlow that the UI consumes.
          - view
          - viewmodel
  + identity <- Have the same things as recipes module

Data and Dependenciy Flow:

This illustration from the clean architecture book shows the dependencies between the layers in an example app and the way data flows between them. (our app uses the same thing).

Tech stack & Open-source libraries

  • Minimum SDK level 21
  • Kotlin based, Coroutines + Flow for asynchronous.
  • Jetpack
    • Lifecycle: Observe Android lifecycles and handle UI states upon the lifecycle changes.
    • ViewModel: Manages UI-related data holder and lifecycle awareness. Allows data to survive configuration changes such as screen rotations.
    • StateFlow: For reactive style programming (from VM to UI).
    • DataBinding: Binds UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
    • Room: Constructs Database by providing an abstraction layer over SQLite to allow fluent database access.
    • Hilt: for dependency injection.
    • Navigation - Used to navigate between fragments
    • Material-Components - Material design components like ripple animation, cardView.
  • Architecture
    • Clean Architecture (Data - Domain - UI)
    • MVVM Architecture (View - DataBinding - ViewModel - Model)
    • Repository Pattern
  • Retrofit2 & OkHttp3: Construct the REST APIs and paging network data.
  • Media3: New home for media libraries that enables Android apps to display rich audio and visual experiences.
  • Coil: An image loading library for Android backed by Kotlin Coroutines.
  • Junit5: Serves as a foundation for launching testing frameworks on the JVM.
  • Kotlin-DSL - Used to handle gradle dependencies and config versions
  • ksp: Kotlin Symbol Processing API.

TODO

  • Recipes Screen
  • Recipe Details Screen
  • Recipes Favourites Screen
  • Search for Recipes Screen
  • Offline Caching
  • Migrate to KMM

License

Designed and developed by 2023 Moataz Mohamed

Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Modern android app built with Clean Architecture, MVVM and Modularization. Powered by Retrofit, OKHttp, Room database, Coroutines, Flow and Dagger-Hilt.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages