🌐 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.
| 🔑 Login | 💬 Phone Sign-In | 🍕 Menu |
|---|---|---|
![]() |
![]() |
![]() |
| 🛒 Order Menu | 🔎 Product Details | 🛍 Shopping Cart |
|---|---|---|
![]() |
![]() |
![]() |
| 📅 Date Picker | 🕒 Time Picker | 🎉 Order Placed |
|---|---|---|
![]() |
![]() |
![]() |
| 📜 Order History | 🔔 Push Notification |
|---|---|
![]() |
![]() |
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
libphonenumberlibrary for client-side formatting and international standards. - Support for guest checkout via Anonymous Authentication.
- Frictionless Google Sign-In with modern
- 🗄️ 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).
- 🔐 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.
- Allows direct routing to products (
- 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.
- Koin (
- 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).
- Room Database (
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
- 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
ViewModelsprocessActionsand exposeUiStatesthrough unidirectional flows.
- Android Studio Ladybug (2024.2.1) or newer.
- JDK 17.
- A Firebase project.
-
Firebase Integration:
- Create a project in the Firebase Console.
- Add an Android app with package name
com.lihan.lazypizza. - Download the
google-services.jsonfile and place it in theapp/directory. - Enable Phone Authentication and Google Sign-In in the Firebase Auth settings.
-
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 todefault_web_client_id).
-
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.
- Generate your local debug key SHA-1:
-
Run the Project:
- Sync Gradle and run the
:appconfiguration on your emulator or physical device.
- Sync Gradle and run the
This project is licensed under the MIT License - see the LICENSE file for details.










