Skip to content

Repository files navigation

🍕 LazyPizza - Modern Pizza Ordering Android App

Kotlin Version Compose Architecture Dependency Injection Database

🌐 Read this in other languages:


LazyPizza is a modern, high-performance pizza ordering application for Android built to showcase production-ready mobile development best practices. Adopting Clean Architecture, MVI/MVVM design patterns, Jetpack Compose (Material 3), and an Offline-First sync strategy, LazyPizza provides a beautiful, fluid, and robust user experience.

Important

This application leverages Firebase Services heavily as its serverless backend, integrating authentication, cloud database, asset storage, and cloud messaging systems into a cohesive real-time mobile experience.


📸 Screenshots

🔑 Login 💬 Phone Sign-In 🍕 Menu
Login Screen Google Sign-In Menu Category Screen
🛒 Order Menu 🔎 Product Details 🛍 Shopping Cart
Ordering Menu Product Detail & Customization Cart View
📅 Date Picker 🕒 Time Picker 🎉 Order Placed
Date Picker Bottom Sheet Time Picker Bottom Sheet Order Success Screen
📜 Order History 🔔 Push Notification
Order History Screen FCM Push Notification

🔥 Heavy Firebase Integration

This project is built serverless, utilizing a suite of Firebase services to manage identity, data, media assets, and push messaging:

  • 🔒 Firebase Authentication (Credential Manager API)
    • Frictionless Google Sign-In with modern CredentialManager.
    • SMS OTP login for phone numbers, utilizing Google's libphonenumber library for client-side formatting and international standards.
    • Support for guest checkout via Anonymous Authentication.
  • 🗄️ Firebase Firestore (Cloud NoSQL)
    • Serves as the primary cloud database hosting categories, pizza menus, toppings, and order histories.
    • Enables Offline-First Synchronization by caching all incoming Firestore documents in Room DB, automatically resolving merge conflicts when the device goes back online.
  • 📁 Firebase Cloud Storage
    • Stores and dynamically streams high-resolution product and topping cover images, which are efficiently cached locally via Coil 3.
  • 🔔 Firebase Cloud Messaging (FCM)
    • Receives real-time push notifications regarding order status updates.
    • Integrates with Android's system notification channels, providing custom deep-link entry points directly into the app (lazypizza://history).

✨ Features

  • 🔐 Unified Login
    • Seamless identity management with Google Sign-In, Firebase SMS Verification, and guest access.
  • 📦 Offline-First Synchronization
    • Robust local persistence ensuring the menu, toppings, and past orders are accessible and interactable even when offline.
  • 🍕 Rich Product Customization & Ordering
    • Dynamic sizing and extra topping configurations with immediate UI state and pricing calculations.
  • 📅 Custom Delivery/Pickup Scheduling
    • Highly polished, custom drumroll wheel pickers for Date and Time selections.
  • 🔔 Deep Linking Route Dispatcher
    • Allows direct routing to products (lazypizza://product/{pizzaId}) or history (lazypizza://history) from push notification clicks or web URLs.

🛠 Tech Stack

  • UI/Presentation:
    • Jetpack Compose: Declarative UI layout framework.
    • Material 3 (1.5.0-alpha21): Modern styling tokens and dynamic theme behaviors.
    • Coil 3 (3.4.0): Asynchronous image loader utilizing OkHttp network caching.
    • Navigation Compose (2.9.8): Strictly Type-Safe navigation utilizing Kotlin Serialization.
  • Dependency Injection & State Control:
    • Koin (4.0.2): Pragmatic, lightweight dependency injection framework.
    • Kotlinx Coroutines & Flow: Reactive streams for state propagation and structured concurrency.
  • Data & Network Core:
    • Room Database (2.7.0): SQLite abstraction layer with KSP compiler code generation.
    • Preferences DataStore (1.1.2): Secure, asynchronous local preference caching.
    • Firebase SDK: Auth (SMS/Google), Firestore (NoSQL Db), Cloud Storage, Cloud Messaging (FCM).

🏗 Architecture & Codebase Design

The project strictly follows Clean Architecture principles and divides concerns into three main layers:

graph TD
    UI[Presentation Layer: Compose, ViewModels, States] --> Domain[Domain Layer: Entities, Use Cases, Interfaces]
    Data[Data Layer: Repositories, DAOs, Firestore DataSources] --> Domain
Loading
  • Domain Layer: Pure Kotlin layer containing business rules, entities (Product, Order), and repository interfaces. Completely independent of Android frameworks.
  • Data Layer: Responsible for retrieving and storing data. Implements the repository interfaces by orchestrating the Room local database and the Firebase Remote DataSource.
  • Presentation Layer: Composed of Jetpack Compose components. Uses the MVI/MVVM pattern where ViewModels process Actions and expose UiStates through unidirectional flows.

🚀 Getting Started

Prerequisites

  • Android Studio Ladybug (2024.2.1) or newer.
  • JDK 17.
  • A Firebase project.

Configuration Steps

  1. Firebase Integration:

    • Create a project in the Firebase Console.
    • Add an Android app with package name com.lihan.lazypizza.
    • Download the google-services.json file and place it in the app/ directory.
    • Enable Phone Authentication and Google Sign-In in the Firebase Auth settings.
  2. Google Cloud Console Setup:

    • In the Google Cloud Console corresponding to your Firebase project, copy the Web client ID (under APIs & Services -> Credentials -> OAuth 2.0 Client IDs).
    • Add this value into your project resources: app/src/main/res/values/strings.xml (or map to default_web_client_id).
  3. Local SHA-1 Registration:

    • Generate your local debug key SHA-1:
      ./gradlew signingReport
    • Add the outputted SHA-1 and SHA-256 fingerprints to your Firebase/Google Developer Console app settings.
  4. Run the Project:

    • Sync Gradle and run the :app configuration on your emulator or physical device.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An Android Pizza Delivery App built with Kotlin and Jetpack Compose. Demonstrates production-ready architecture, smooth state management, and custom UI components for product discovery and checkout flows.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages