An Android e-commerce app built with Kotlin and Jetpack Compose. MetaCart showcases a modern Android stack with Firebase Authentication, Room persistence, Hilt dependency injection, and a clean navigation architecture.
- Home screen (
HomeScreen) - Category listing (
CategoryScreen) - Product listing by category (
ProductScreen) - Product details view (
ProductDetailsScreenwithproductIdargument) - Cart screen (
CartScreen) - Authentication
- Login (
LoginScreen) - Sign up (
SignupScreen) - Sign out (via
ProfileScreenandAuthViewModel)
- Login (
- Profile screen (
ProfileScreen) - Type-safe navigation routes via a sealed
Screensclass - Image loading with Coil
- Local persistence with Room
- Dependency Injection with Hilt
- Firebase services integration (Auth, Firestore)
- Coroutines for async operations
- Material 3 UI theme (
Theme.MetaCart)
- Language: Kotlin (100%)
- UI: Jetpack Compose, Material 3, Material Icons Extended
- Navigation: Navigation Compose
- DI: Hilt (
@AndroidEntryPoint,androidx.hilt:hilt-navigation-compose) - Data:
- Firebase Auth (
com.google.firebase:firebase-auth) - Firebase Firestore (
com.google.firebase:firebase-firestore) - Room (
room-runtime,room-compilervia KSP)
- Firebase Auth (
- Async: Kotlin Coroutines
- Images: Coil (Compose + OkHttp network)
- Build: Gradle Kotlin DSL, Google Services plugin
- Min SDK: 24
- Target SDK: 36
Start destination: Home
Screens.Home→ Home screenScreens.Cart→ Cart screenScreens.Profile→ Profile screen (supports Sign Out)Screens.CategoryList→ Category listingScreens.ProductList/{categoryId}→ Product listing for a category (expectscategoryId)Screens.ProductDetails/{productId}→ Product details (expectsproductId)Screens.Login→ Login screenScreens.SignUp→ Sign up screen
Navigation is managed via NavHost and rememberNavController, observing AuthViewModel.isLoggedIn for conditional flows to Profile/Login.
app/src/main/java/com/example/metacart/MainActivity.kt— App entry withNavHost, Hilt, and navigation graphdi/— Dependency-injection setup (Application classMyApp)model/— Data modelsrepositories/— Data repositories (Firebase/Room usage)room/— Room database-related classesscreens/— Compose UI screens (Home, Categories, Products, Details, Cart, Profile, Login, Signup)ui/— Theme and UI utilitiesviewmodels/— ViewModels includingAuthViewModel
app/src/main/AndroidManifest.xml— Declares permissions, theme,MyApp, and exportedMainActivity
android.permission.INTERNETandroid.permission.ACCESS_NETWORK_STATE
- Namespace:
com.example.metacart - Application ID:
com.example.metacart - Compose: enabled via
buildFeatures.compose = true - Google Services:
- Plugin:
com.google.gms.google-services - Config:
app/google-services.json
- Plugin:
- Open the project in Android Studio (latest stable).
- Ensure
google-services.jsonexists inapp/(already present). - Sync Gradle and build the project.
- Run the app on an emulator or device (API 24+).