mulieriq / justeat

Mobile App that shows Restaurants [Just Eat Interview Solution], for the Android Engineer Role

Home Page:https://www.justeattakeaway.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Just Eat

👀 Writing Just Eat Interview Solution App using Android Architecture Components, in 100% Kotlin, using Android Jetpack Components.

Prerequisites

Before every commit, make sure you run the following commands:

./codeAnalysis

To test code coverage, run the following bash script:

./coverage

If you have Fastlane installed, you can run the develop lane:

fastlane branch conf:debug

To check for dependency updates, run the following command:

./gradlew dependencyUpdate

To inspect the app database, use Android Studio database inspector by running the app on a Device >=26 API Level

Refer to this issue, if you get any issues running the lint commands on the terminal 🚀

Background

Develop an application that visualizes a restaurant list:

  • Favourite restaurants are at the top of the list, your current favourite restaurants are stored locally on the phone.

  • Restaurant is either open (top), you can order ahead (middle) or a restaurant is currently closed (bottom).

  • Always one sort option is chosen and this can be best match, newest, rating average, distance, popularity, average product price, delivery costs or the minimum cost.

Tech-stack

  • Tech-stack

    • Kotlin - a cross-platform, statically typed, general-purpose programming language with type inference.
    • Coroutines - perform background operations.
    • Flow - handle the stream of data asynchronously that executes sequentially.
    • KOIN - a pragmatic lightweight dependency injection framework.
    • Jetpack
      • Room - a persistence library provides an abstraction layer over SQLite.
      • LiveData - is an observable data holder.
      • Lifecycle - perform action when lifecycle state changes.
      • ViewModel - store and manage UI-related data in a lifecycle conscious way.
    • Timber - a highly extensible android logger.
    • Leak Canary - a memory leak detection library for Android.
  • Architecture

    • Clean Architecture
    • MVVM - Model View View Model
  • Tests

    • Unit Tests (JUnit) - a simple framework to write repeatable tests.
    • MockK - mocking library for Kotlin
    • Kluent - Fluent Assertion-Library for Kotlin
    • Kakao - Nice and simple DSL for Espresso in Kotlin
  • 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.
      • Detekt - a static code analysis tool for the Kotlin programming language.
      • Spotless - format java, groovy, markdown and license headers using gradle.
      • Dokka - a documentation engine for Kotlin, performing the same function as javadoc for Java.
      • jacoco - a Code Coverage Library
  • CI/CD

Dependencies

All the dependencies (external libraries) are defined in the single place - Gradle buildSrc folder. This approach allows to easily manage dependencies and use the same dependency version across all modules.

UI and Unit Tests

The screenshot below shows the tests that are done on the repo:

UI Tests

The UI Tests are tested on an Emulator Running Android 10 (API 29) - Might be flaky on some API levels.

The UI tests are written using Kakao

Unit Tests on Data Layer

The Unit Tests here basically test the Repository Implementation

Unit Tests on Presentation Layer

The Unit Tests here test ViewModel

More tests can be added

About

Mobile App that shows Restaurants [Just Eat Interview Solution], for the Android Engineer Role

https://www.justeattakeaway.com/


Languages

Language:Kotlin 93.0%Language:Ruby 5.9%Language:Shell 1.1%