How emranzz/shopnest works
1. Project type and runtime
- ShopNest is a single-module Android application written in Kotlin.
- The app UI is built with Jetpack Compose and Material 3, and it targets Android devices only.
- Firebase is the backend integration point, with google-services.json checked into the app/ module.
2. Entry point and app bootstrap
- MainActivity.kt is the app entry point and likely hosts the Compose content.
- The manifest and resource setup are standard Android app bootstrapping pieces; there is no separate server or desktop runtime.
3. Presentation layer structure
- The UI is split into three clear buckets under com.example.shopnest:
- components/: reusable building blocks such as top bars, product cards, cart items, banners, category chips, and order rows.
- screen/: full-page Compose screens for major routes like home, auth, login, signup, product details, categories, checkout, and orders.
- pages/: additional page-level views such as cart, favorites, and profile.
- This indicates a Compose-first presentation architecture where screens are assembled from reusable components.
4. Navigation boundary
- Navigation is centralized in navigation/AppNavigation.kt, with route definitions in navigation/Screen.kt.
- The app likely uses Navigation Compose to switch between auth, catalog, cart, checkout, and profile flows.
- This is the main boundary controlling how users move between feature areas.
5. ViewModel and state management
- viewmodel/AuthViewModel.kt is the only explicit ViewModel in the tree, suggesting authentication state is currently the primary managed business state.
- The README describes MVVM and reactive state with flows/state, but the repo tree shows that this is still lightweight and mostly centered on auth.
- UI state is therefore likely owned by screens/ViewModels, while composables remain mostly declarative.
6. Domain/data models
- The model/ package contains simple data holders for UserModel, ProductModel, CategoryModel, and OrderModel.
- These classes form the app’s shared data contract between Firebase, state holders, and UI rendering.
- There is no separate repository or use-case layer visible in the tree, so data access appears to be direct or still evolving.
7. Feature areas reflected in screens
- The repository is organized around commerce flows:
- authentication
- home/catalog browsing
- category browsing
- product details
- cart and checkout
- orders
- profile/favorites
- Some of these are likely scaffolded ahead of full backend implementation, based on the README’s “work in progress” status.
8. Shared UI and design system
- ui/theme/Color.kt, Theme.kt, and Type.kt define the app’s visual system.
- This is the main styling boundary for Material 3 consistency across screens.
- Shared drawables such as rounded corners and launcher assets live in res/drawable and res/mipmap.
9. Utilities and helper boundary
- utils/Utils.kt suggests a small set of cross-cutting helpers rather than a large infrastructure layer.
- In a diagram, this should be shown as support code consumed by screens, components, or viewmodels rather than as a core subsystem.
10. Backend integration points
- Firebase Authentication is the clearest backend dependency and likely powers login/sign-up and session persistence.
- Cloud Firestore is mentioned in the README as the product/user/cart data store, although no explicit repository abstraction is present in the tree.
- This creates an external boundary between the Compose/MVVM app and Firebase services.
11. Testing and quality gates
- The repo includes both JVM unit tests under app/src/test and Android instrumented tests under app/src/androidTest.
- This indicates the project is set up for both local logic verification and device/emulator UI testing, even if coverage is minimal today.
12. Architectural summary for diagramming
- The best diagram is: Android app shell at the center, Compose UI on top, Navigation Compose routing between feature screens, a small ViewModel layer for auth/state, shared models beneath, and Firebase services outside the app boundary.
- The main missing piece compared with the README’s idealized MVVM is a formal repository/data-access layer; the current codebase is closer to a UI-first Compose app with Firebase-backed auth and planned commerce features.
Main entry points: AppNavigation.kt Navigation · TopBar.kt Components · AuthViewModel.kt AuthViewModel · MainActivity.kt MainActivity
Components 18
Android app
Android application shell and platform wiring.
- MainActivity · Android entry point that hosts the Compose app.
app/src/main/java/com/example/shopnest/MainActivity.kt - Manifest · Declares app components and startup configuration.
app/src/main/AndroidManifest.xml
Presentation
Compose UI, navigation, and app screens.
- App theme · Material 3 color, typography, and theme setup.
app/src/main/java/com/example/shopnest/ui/theme/Theme.kt - Navigation · Central route switching between app flows.
app/src/main/java/com/example/shopnest/navigation/AppNavigation.kt - Routes · Named destinations used by the navigation layer.
app/src/main/java/com/example/shopnest/navigation/Screen.kt - Home · Primary catalog landing screen.
app/src/main/java/com/example/shopnest/screen/HomeScreen.kt - Auth screens · Authentication flow screens for login, sign-up, and auth gate.
app/src/main/java/com/example/shopnest/screen/AuthScreen.kt - Catalog screens · Category browsing and product detail views.
app/src/main/java/com/example/shopnest/screen/ProductCategoriesScreen.kt - Checkout · Purchase and order flow screens.
app/src/main/java/com/example/shopnest/screen/CheckoutScreen.kt - Pages · Higher-level account and collection pages.
app/src/main/java/com/example/shopnest/pages/ProfilePage.kt - Components · Reusable Compose widgets shared across screens.
app/src/main/java/com/example/shopnest/components/TopBar.kt
State & data
Models, viewmodels, and shared helpers.
- AuthViewModel · Reactive auth state and user-session handling.
app/src/main/java/com/example/shopnest/viewmodel/AuthViewModel.kt - Models · Shared app data contracts for users, products, categories, and orders.
app/src/main/java/com/example/shopnest/model/ProductModel.kt - Utils · Cross-cutting helper functions used by UI and state code.
app/src/main/java/com/example/shopnest/utils/Utils.kt
Backend
Firebase services used by the app.
- Firebase Auth · External authentication provider for sign-in and sign-up.
app/google-services.json - Firestore · Cloud datastore for products, users, carts, and orders.
app/google-services.json
Quality
Test coverage and verification hooks.
- Unit tests · Local JVM tests for logic verification.
app/src/test/java/com/example/shopnest/ExampleUnitTest.kt - Instrumented tests · Device or emulator test entry point.
app/src/androidTest/java/com/example/shopnest/ExampleInstrumentedTest.kt
Connections 22
- Manifest → MainActivity: launches · Declares the activity that starts the app.
- MainActivity → App theme: applies · Sets the app-wide Compose theme.
- MainActivity → Navigation: hosts · Runs the navigation graph inside the activity.
- Navigation → Routes: uses · Resolves destinations from route definitions.
- Navigation → Home: opens · Routes users into the home flow.
- Navigation → Auth screens: opens · Routes users into authentication screens.
- Navigation → Catalog screens: opens · Routes users into browsing and detail screens.
- Navigation → Checkout: opens · Routes users into checkout and order flows.
- Navigation → Pages: opens · Routes users into profile and saved-content pages.
- Home → Components: composes · Builds the landing page from shared UI pieces.
- Catalog screens → Components: composes · Uses reusable cards, chips, and banners.
- Checkout → Components: composes · Reuses cart and order presentation widgets.
- Pages → Components: composes · Shares top bars and row components.
- Auth screens → AuthViewModel: observes · Binds authentication UI to reactive state.
- AuthViewModel → Models: maps · Converts backend state into app data models.
- AuthViewModel → Firebase Auth: authenticates · Creates and validates user sessions.
- AuthViewModel → Firestore: reads/writes · Persists or loads user-related records.
- Components → Models: renders · Displays product, category, cart, and order data.
- Utils → Components: supports · Provides shared helper logic to UI code.
- Utils → AuthViewModel: supports · Provides cross-cutting helper logic to state code.
- Unit tests → Models: verifies · Checks core data-related behavior.
- Instrumented tests → MainActivity: verifies · Exercises the app entry point on device.