Giter Site home page Giter Site logo

janewaitara / calories Goto Github PK

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

A simple multimodule app that fetches Food composition details based on searches.

Kotlin 100.00%
data-store-preferences jetpack-compose kotlin-coroutines kotlin-flows multi-module

calories's Introduction

Calories

A simple multimodule app that fetches Food composition details from Calorie Ninja based on searches.

Features

As a user, I can

  • Search for a food to see it's composition
  • Click on the search results to see more details

Prerequisites

You'll need to provide API key to search the food composition from the API.

  • Generate an API key from Calorie Ninja
  • Create new file named -> local.properties in our project root folder
  • Add the API key as shown below
key = <YOUR_API_KEY>
  • Build the app
  • Enjoyyyyy ๐ŸŽ‰

Designs

Initial Idle state Idle state with recent searches Search Results
Idle Screen Idle state Search results
Food details Error State No Results Found
Food details Error state No results found

Packaging Structure

  • core
    • data
      • aggregates the data from the network and local database
    • domain
      • handles business logic
    • local
      • handles local caching
    • remote
      • Fetches data from remote sources
    • testing
      • Has utility classes used for testing
    • ui
      • Has the app theming
  • feature
    • calories
      • handles searching and displaying of the food composition
    • food details
      • Displays the more food composition details

Tech Stack

  • Tech Stack

    • Kotlin - Programming language for Android development.
    • Compose - modern toolkit for building native Android UI
    • Kotlin coroutines - Executing code asynchronously.
    • Flow - An asynchronous version of a Sequence, a type of collection whose values are lazily produced. Flow handles the stream of data asynchronously that executes sequentially.
    • HILT - a dependency injection library for Android that reduces the boilerplate of doing manual dependency injection in your project.
    • ViewModel - store and manage UI-related data in a lifecycle conscious way.
    • Ktor Client - a multiplatform asynchronous HTTP client, which allows you to make requests and handle responses.
    • Kotlin Serialization - Serialization/Desirialization of JSON response from network.
    • Jetpack Datastore - a data storage solution that allows you to store key-value pairs.
  • Gradle

    • Gradle Kotlin DSL - For reference purposes, here's an article explaining the migration.
    • Plugins
      • Ktlint - creates convenient tasks in your Gradle project that run ktlint checks or do code auto format.
  • CI/CD

    • Github Actions

Tests

The app includes both unit and instrumented tests.

Core

data

CalorieRepositoryTests
Repo Test

Remote

CaloriesSearchApiTest
Remote Test

Presentation

Calories ViewModel

CaloriesScreenViewModelTest
ViewModel Test

Calories Screen

CaloriesScreenTest
UI Test

calories's People

Contributors

janewaitara avatar

Watchers

 avatar

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.