A food recipes App Built with Jetpack Compose

Overview

Yummy

A food recipes App Built with Jetpack Compose . The app uses room for local caching to facilitate offline support and follows the MVVM Clean Architectural pattern

Screenshots

Light Mode

Dark Mode

Demo

Architecture

1.UI layer

The role of the UI layer (or presentation layer) is to display the application data on the screen. Whenever the data changes, either due to user interaction (such as pressing a button) or external input (such as a network response), the UI should update to reflect the changes. The UI layer is made up of two things:

  • UI elements that render the data on the screen. You build these elements using Views or Jetpack Compose functions.
  • State holders (such as ViewModel classes) that hold data, expose it to the UI, and handle logic.

2.Data layer

The data layer of an app contains the business logic. The business logic is what gives value to your app—it's made of rules that determine how your app creates, stores, and changes data. The data layer is made of repositories that each can contain zero to many data sources. You should create a repository class for each different type of data you handle in your app.

3.Domain Layer

The domain layer is an optional layer that sits between the UI and data layers. The domain layer is responsible for encapsulating complex business logic, or simple business logic that is reused by multiple ViewModels. This layer is optional because not all apps will have these requirements. You should use it only when needed—for example, to handle complexity or favor reusability

Tech Stack

  • Kotlin - Kotlin is a cross-platform, statically typed, general-purpose programming language with type inference. Kotlin is designed to interoperate fully with Java, and the JVM version of Kotlin's standard library depends on the Java Class Library, but type inference allows its syntax to be more concise
  • Jetpack Components:
    • Jetpack Compose - Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android
    • View Model- store and manage UI-related data in a lifecycle conscious way.
    • Lifecycle - Perform actions in response to a change in the lifecycle status of another component, such as activities and fragments.
    • LiveData - A lifecycle-aware data holder with the observer pattern
    • Android KTX - Android KTX is a set of Kotlin extensions that are included with Android Jetpack and other Android libraries. KTX extensions provide concise, idiomatic Kotlin to Jetpack, Android platform, and other APIs.
    • AndroidX - Major improvement to the original Android Support Library, which is no longer maintained.
  • Retrofit- is a type-safe REST client for Android, Java and Kotlin, built as a powerful framework for consuming APIs
  • Dagger-Hilt- a dependency injection library for Android that reduces the boilerplate of doing manual dependency injection in your project

  • Room - a persistence library provides an abstraction layer over SQLite for cache

  • Coroutines - a concurrency design pattern that you can use on Android to simplify code that executes asynchronously

  • Flow- In coroutines, a flow is a type that can emit multiple values sequentially, as opposed to suspend functions that return only a single value.

  • Ramcosta Navigation Library - A KSP library that processes annotations and generates code that uses Official Jetpack Compose Navigation under the hood. It hides the complex, non-type-safe and boilerplate code you would have to write otherwise.

  • CI/CD - Continuous integration systems let you automatically build and test your app every time you check in updates to your source control system.

  • Coil - Image Loader library.

  • Accompanist-SwipeRefresh - A library which provides a layout which provides the swipe-to-refresh UX pattern, similar to Android's SwipeRefreshLayout.

Data Source

This application fetches its data from the The Meal Db. Find the Documentation by following this link.

Author

Felix Kariuki

Buy Me A Coffee

Do Reach Out :

License and Copyright

MIT LICENSE

MIT License

Copyright (c) 2022 Felix m Kariuki

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Comments
  • Fix the Category Button Click Error

    Fix the Category Button Click Error

    Noted the Category Item Button was not working when clicked on the upper part as shown on this illustration.

    image

    Fixed this by removing the click listener on the image.

    opened by Tonnie-Dev 0
  • Implement Category Click Code

    Implement Category Click Code

    I have added a dao query to filter out cached data and return meals by the selected category.

    Have also added a use case for this task which lead to many arguments on the ViewModel. For this, I did a little clean-up and moved the use cases to a single container.

    My concern is the discrepancy when it comes to clicking a CategoryItem - clicking on the upper end of the CategoryItem doesn't trigger the click but Clicking on the lower part triggers the click.

    opened by Tonnie-Dev 0
  • Improve MealsViewModel code

    Improve MealsViewModel code

    Removed unused/ commented code from the MealsViewModel.

    Deleted the explicit invoke() call which is not needed as you can call the invoke function by just appending () to the use case.

    //before
       getCategoriesUseCase.invoke().collect { result -> ... }
    
    //after
       getCategoriesUseCase().collect { result -> ... }
    
    opened by Tonnie-Dev 0
  • TestingCategoriesDao

    TestingCategoriesDao

    Small PR to Test Categories Dao.

    Changes Made -

    • Created new packages for the daos and Mealsdatabase.
    • Created a separate Dao with its functions separate from the initial meals dao which had functions overall functions.
    • Provided categoriesDao in the CacheModule.
    • Wrote CategoriesDao Tests.
    opened by kanake10 0
  • Suspending Functions and Flow

    Suspending Functions and Flow

    I read in this article that Functions returning Flow/Channel should not be suspending

    Went ahead and rectified the issue on the use cases and the repository definition/Implementations

    opened by Tonnie-Dev 0
Owner
Felix Kariuki
Native Android developer
Felix Kariuki
Food Recipes - Android application built with Jetpack compose, MVVM and clean architecture approach.

Food Recipes Android application that consuming (https://spoonacular.com/food-api) "Recipes api". It has been built with clean architecture principles

Mahmoud Elshahat 26 Jan 29, 2023
Simple app to search for food recipes

Resepy Simple app to search for food recipes. Notes This app uses : Jetpack Compose Unidirectional Data Flow Pattern Dagger Hilt Paging 3 Flow Corouti

Ahmad Jailani 4 Jul 17, 2022
Foody - Food Recipes App Developed in Kotlin

Foody - Food Recipes App Developed in Kotlin This is a project I studied on Udemy link course: click here Component ROOM Database Dependency Injection

Rahmat Sugiarto 2 Jun 29, 2022
Food Recipe App is an app for collecting most of food recipe in one app

Food Recipe App is an app for collecting most of food recipe in one app

Heba Elsaid 10 Dec 25, 2022
This application is purpose to help user find food or drink recipes.

MyRecipes Let's Start Our Labs! This application is purpose to help user find food or drink recipes. Download App Features Explore Recipes Search Reci

Fikky Ardianto 2 Aug 31, 2022
An android app that use food API to display different categories of food

TheMealApp An android app that use food API to display different categories of food The food api is https://www.themealdb.com/api.php. What I used in

null 8 Jun 17, 2022
Shreyas Patil 2.1k Dec 30, 2022
A recipe app where user can search new recipes from an API

Recipe -app This is a recipe app where user can search new recipes from an API, save them, create their own recipes and edit saved recipes. The app is

Silvia Niinimäki 2 Dec 6, 2021
MyDishes - Add your dishes with recipes and photos

MyDishes In this application you can add your dishes with recipes and photos. Co

Tushar Jha 2 Oct 5, 2022
Mojito is a cocktail manual, which contains recipes, images, and so on.

Mojito Mojito* is a cocktail manual, which contains recipes, images, and so on. *Mojito: an alcoholic drink made with rum, lime juice, sugar, and mint

Chih-Wei Lin 76 Dec 12, 2022
Meal recipes application for Android devices

RecipeApp Bu projemde TheMealDB API servisini kullanarak bir yemek tarifleri uygulaması geliştirdim. Bu uygulama ile yemek tariflerini; katagorize edi

Mehmet Ali Öyür 9 Dec 24, 2022
An Application to view recipes of different dishes. I just made it for training and sharpen my skills.

FoodRecipesApplication An Application to view recipes of different dishes. I just made it for training and sharpen my skills. I tried to write a clean

Mahmoud Abdelazim 5 Oct 25, 2022
Food Lovers App With Kotlin

Projeto: Site de Filmes Status: Em andamento Segundo projeto em andamento em Android com Kotlin! dessa vez estou desenvolvendo um aplicativo para aman

Gustavo Padilha 5 Oct 12, 2022
An android app that shows you nearby food places

FoodNow An android app that shows you nearby food places Features include Search

Danny P 0 Dec 24, 2021
Food For All is an app developed for Google Solutions 2022

Food For All is an app developed for Google Solutions 2022. Our objectives are reduce the food waste and consequently contribute to reduce hunger. The app connects the merchant, who works in supply centers and has to throw away unsold food everyday, and NGOs that fight hunger and help to feed hungry people before the food becomes unfit for human consumption.

Harnish Savsani 3 Apr 16, 2022
A project for the implementation of the car animation feature in most ride-sharing/ food delivery apps

CarAnimation This is a test project to practice the implementation of the car animation feature in most ride-sharing/ food delivery apps. Slowly build

Samurai 45 Dec 23, 2022
Order Food Application Build With Kotlin MVVM (Model - View - ViewModel)

Kotlin Order Food Application Build With Kotlin MVVM (Model - View - ViewModel) Clean Architecture, MSSQL API, Beautiful Design UI, Smooth Animations Using Tools And Components Supported By Google And By Most Of The Android Development Community

Murat ÖZTÜRK 17 Dec 7, 2022
E- commerce app👕 built with Jetpack Compose and Compose Destinations. The design was inspired by Sajjad Mohammadi Nia

E-Commerce Clothing App ?? This a Jetpack Compose app that replicates of an E-commerce app design I was inspired by on Dribble. It's an E-Commerce app

Breens Robert 19 Nov 23, 2022
A quiz app built with trivia api. This app was built with mvvm architecture, dagger-hilt, retrofit, room database, and navigation components.

A quiz app built with trivia api. This app was built with mvvm architecture, dagger-hilt, retrofit, room database, and navigation components.

Stephen Odumirin 3 Dec 19, 2022