Skip to content

sitatec/Go4Lunch

Repository files navigation

Build Status codecov Maintainability

Go4Lunch

A demo video is available at the end of the page.

Go4Lunch is an application that brings you and your colleagues together for lunch. Go4Luch allows you to see all the restaurants near you on a map or a list. On the map, if at least one of your workmates go to a restaurant, the color of the marker of that restaurant will be green, and if you click on the marker you will see in the window info the number of the workmates who go there if you click on the window info you will be redirected in a new screen that shows the restaurant details and all of your workmates who go to that restaurant. To be able to interact with you workmates, you must select a workplace either when you lunch the app for the first time (the app will show a pop up) or in the settings. You can schedule a notification that will remind you every day for lunch time, you can search a restaurant by its name or address... to see all the features of the app, watch the demo video.

Go4Lunch

⚠️ This image Powered by Google in the app doesn't mean that the app is a google product, but to show data from google place api in your app, you must show the Powered by google image wherever the data are displayed.

Architecture

Go4Lunch architecture

To prevent the repositories (in the domain) depending on the data sources, I have created interfaces that represent the data sources. The repositories depend on them because there are inside the domain. Then I use the Adapter design pattern to adapt the data sources.

Now, assuming that I no longer want to use firebase, because I have created my own server and I want to use it to store the user's data, all I have to do is to delete the firebase adapter and all its dependencies, create a client for my server and implement one or more interfaces (depending on the data the server provides), without touching either the domain layer or the UI layer -> maintainability++ && testability++.

I have also created and deployed two functions (written in TypeScrip) on Firebase functions, one to initialize the user data on cloud firestore when his account is created, another to delete all the user's data when his account is deleted (the functions will be triggered by firebase auth).

Dependencies

Prod

  • Navigation component
  • View binding
  • Hilt
  • View Model
  • Live Data
  • Retrofit
  • Gson
  • Firebase auth
  • Firebase firestore

Tests

  • Espresso
  • UI Automator (for some specifics cases that espresso doesn't support, i.g. clicking on google maps markers)
  • Junit4
  • Mockito

Services

  • Google Place APIs (the real APIs i.e. accessible through HTTPS, not the android SDKs)
    • Nearby Search
    • Place Autocomplete
    • Place Details

Tools

  • Travis CI
  • Jacoco
  • Codecov
  • Codeclimate

Build

To be able to build the project you need google maps and google place API key(s), and store them in your local.properties file like this:

GOOGLE_PLACE_API_KEY=YOUR-API-KEY
GOOGLE_MAP_API_KEY=YOUR-API-KEY

If you don't want to store your keys in the local.properties, you will have to edit the build.gradle inside the app module.

Demo

Go4Lunch