GitHunt
JO

joshayoung/LazyPizza

Native Android Application for Pizza Orders (Jetpack Compose, Kotlin, Flows, Coroutines, Room)

LazyPizza

Android Application for Pizza Orders

Screenshots

LazyPizza LazyPizza LazyPizza LazyPizza LazyPizza LazyPizza LazyPizza LazyPizza

Walkthroughs

Improvement Notes

  • This app assumes 'happy-path', so I have not added much error handling.
  • The app allows guest checkout, but this will not scale in the current form because I am just using a string for this user.
  • The toppings are not listed on the history page.
  • Orders are just a serialized list of IDs. If one of these IDs were to change then the order would link to a non-existing ID.

Notes

  • io.coil-kt.coil3:coil-network-okhttp is needed to get AsyncImage working with coil.
  • If your preview does not seem to be depicting the correct color for your MaterialTheme in the preview window, then make sure you are wrapping your preview in your theme block (i.e. LazyPizzaTheme { ... }).
  • If a join returns all null results all of the values in the object used for deserialization have to be nullable or it wlll crash the app!
  • If you use a key for something like LazyVerticalGrid, make sure your keys are all unique for the preview.
    • Otherwise the preview will not work.
  • If you have a lazy component inside another lazy commpoent, make sure the inner one has either a height or heightIn so the outer component can render. Otherwise it does not know enought to render the correct height.
  • Compose does not support nested Lazy layouts unless the inner ones have defined heights.
    • To circumvent this, you can use a Column as the inner layout and loop through your items using a forEach loop.
      • This is not very performant, but it is ok if you only have a few items in your list.
  • If you want the repeating elements in a Lazy layout to take up the full height of the largest element in the component being usined, you can use .height(IntrinsicSize.Max) on the outer element.

Running This Application

  • This application requires authentication from AppWrite on the app launch in order to project assets (images/database) access.
    • This is not user facing.
  • In order to authenticate in the app using SMS, you will need to setup a test firebase phone number as outlined below.

AppWrite

  • To run this application after clone, you will need to create a local.properties file with the following values from AppWrite:
    • API_ENDPOINT=""
    • API_PROJECT_ID=""
    • AUTH_EMAIL=""
    • AUTH_HEADER=""
    • AUTH_PASSWORD=""
    • AUTH_USERNAME=""
    • BUCKET_ID=""
    • DATABASE_ID=""
    • TOPPINGS_COLLECTION_ID=""
    • MENU_ITEMS_COLLECTION_ID=""
    • ORDERS_COLLECTION_ID=""

Firebase

  • You will need to setup a firebase project and add your google-services.json file to the applications app folder.
  • In addition, you will need to enable Authentication and Phone/SMS verification and add a test phone number and 2factor code in order to login.

Miscellaneous

  • This file (local.properties) will also need to include this value (it can be any string).
    • GUEST_USER=""

Ktlint

  • ./gradlew ktlintCheck - generate reports
  • ./gradlew ktlintFormat - format code

Add Firebase Storage

Generate SHA-256 Key

  • ./gradlew signingReport

Convert Video Format

Ktlint Plugin

Re-Attach Debugger

  • View > Tool Windows > Debug

Resources

Provided Resources