How choyon-sarker/ki-kinbo works
1. Overall shape
- This is a single-module Android app (app) named Ki Kinbo!, organized around MVVM.
- The codebase is mostly client-side; there is no separate server/backend module. Data persistence and authentication are intended to run through Firebase.
2. Presentation layer
- The UI is split across a small set of Android screens:
- MainActivity
- SelectItemsView
- PlaceOrderView
- layouts also exist for SearchProduct, PaymentMethod, and ViewProduct
- UI rendering is backed by XML layouts and a RecyclerView adapter (SearchProductAdapter) for product lists.
3. ViewModel layer
- The app’s business logic is concentrated in ViewModels:
- ProductSearchViewModel handles product filtering/search.
- SelectItemsViewModel handles order processing / cart-to-order flow.
- PlaceOrderViewModel validates order input, stock, and user/address rules.
- PushProductData and PushUserData appear to be data ingestion/sync ViewModels.
- SearchProduct is likely a smaller search-related ViewModel/helper.
- This layer is the main boundary between UI and data sources.
4. Domain model
- Core entities live under model/:
- ProductDataModel
- OrderDataModel
- OrderItemDataModel
- UserDataModel
- ShippingAddressDataModel
- ProductStockInto
- PaymentMethod
- These types define the app’s business data and likely flow unchanged between ViewModels, repository/data-store, and Firebase.
5. Repository / data-source layer
- The repository boundary is explicit in model/repository/:
- ProductRepository
- DummyDataStore
- DummyProductInfoDataStore
- DummyUserInfoDataStore
- The “dummy” stores indicate the app currently uses in-memory or sample data sources for development/testing and documentation, with the repository acting as the abstraction point for swapping in real persistence.
6. Primary data flows
- Browse/search flow: user enters a search or category filter in the UI → ProductSearchViewModel → repository/data store → product list returned to the RecyclerView adapter.
- Order flow: selected items and user/shipping details go to SelectItemsViewModel / PlaceOrderViewModel → validation against stock and user/address rules → order creation or rejection.
- Data seeding/sync flow: PushProductData and PushUserData likely push reference data into the app’s storage layer or Firebase.
7. Firebase boundary
- The repo includes google-services.json, so Firebase is a first-class external dependency.
- The README describes Firebase Authentication and database usage; the generated docs also show MainActivity interacting with database references.
- Architecturally, Firebase is the external service boundary for auth and persistence, while the app code remains organized around MVVM and repositories.
8. Testing boundary
- Unit tests exist for the ViewModel layer:
- PlaceOrderViewModelTest
- ProductSearchViewModelTest
- There is also an Android instrumented test scaffold under androidTest.
- This indicates the logic-heavy parts of the app are intended to be tested above the UI layer, which is consistent with MVVM.
9. Build and delivery tooling
- The project uses Gradle Kotlin DSL and Android Studio conventions.
- A GitHub Actions workflow exists at .github/workflows/AndroidBuild.yml, so CI is part of the delivery pipeline.
- proguard-rules.pro and standard Android resource folders indicate a conventional Android release setup.
10. Documentation and design assets
- The documentation/html tree is generated API documentation, likely from Dokka.
- The Resources/ folder contains architecture and process PDFs (MVC, MVVM, CQRS, testing reports, sprint docs), which are project artifacts rather than runtime components.
- For an architecture diagram, these are supporting artifacts, not runtime subsystems.
11. Key architectural takeaway
- The repo is best diagrammed as:
- UI screens/adapters
- → ViewModels
- → repository / dummy data stores
- → Firebase
- The main separation is between presentation, business logic, and data access, with ViewModels as the central orchestration point.
Main entry points: ProductRepository.kt Product Repo · PlaceOrderViewModel.kt Place Order VM · DummyDataStore.kt Dummy Store · MainActivity.kt MainActivity
Components 20
UI
Activities, screens, and adapter-driven presentation
- MainActivity · App entry screen and database-facing host
app/src/main/java/com/devdroid/kikinbo/view/MainActivity.kt - Select Items · Item selection and cart flow screen
app/src/main/java/com/devdroid/kikinbo/view/SelectItemsView.kt - Place Order · Order submission and checkout screen
app/src/main/java/com/devdroid/kikinbo/view/PlaceOrderView.kt - Search List · RecyclerView adapter for product search results
app/src/main/java/com/devdroid/kikinbo/view/adapter/SearchProductAdapter.kt
ViewModels
State, validation, and use-case orchestration
- Product Search · Filters and searches products
app/src/main/java/com/devdroid/kikinbo/viewmodel/ProductSearchViewModel.kt - Select Items VM · Processes selected items into order intent
app/src/main/java/com/devdroid/kikinbo/viewmodel/SelectItemsViewModel.kt - Place Order VM · Validates order, stock, and user rules
app/src/main/java/com/devdroid/kikinbo/viewmodel/PlaceOrderViewModel.kt - Push Product · Pushes or seeds product data
app/src/main/java/com/devdroid/kikinbo/viewmodel/PushProductData.kt - Push User · Pushes or seeds user data
app/src/main/java/com/devdroid/kikinbo/viewmodel/PushUserData.kt - Search Product · Secondary search-oriented logic
app/src/main/java/com/devdroid/kikinbo/viewmodel/SearchProduct.kt
Data
Domain models and repository/data-store boundary
- Products · Product and stock entities
app/src/main/java/com/devdroid/kikinbo/model/ProductDataModel.kt - Orders · Order and order-item entities
app/src/main/java/com/devdroid/kikinbo/model/OrderDataModel.kt - Users · User and shipping address entities
app/src/main/java/com/devdroid/kikinbo/model/UserDataModel.kt - Payment Method · Payment method type
app/src/main/java/com/devdroid/kikinbo/PaymentMethod.kt - Product Repo · Repository boundary for product and order data
app/src/main/java/com/devdroid/kikinbo/model/repository/ProductRepository.kt - Dummy Store · In-memory sample data and order/user fixtures
app/src/main/java/com/devdroid/kikinbo/model/repository/DummyDataStore.kt - Product Data · Sample product source
app/src/main/java/com/devdroid/kikinbo/model/repository/DummyProductInfoDataStore.kt - User Data · Sample user source
app/src/main/java/com/devdroid/kikinbo/model/repository/DummyUserInfoDataStore.kt
Connections 21
- MainActivity → Product Search: search UI · Main screen drives product browsing and lookup
- MainActivity → Select Items: navigate · Entry screen leads into item selection
- Select Items → Select Items VM: cart flow · Selection screen delegates order preparation
- Select Items → Search List: lists products · Screen renders product results through the adapter
- Place Order → Place Order VM: checkout · Order screen delegates validation and submission
- Product Search → Product Repo: queries · Search logic reads products through repository
- Search Product → Product Repo: filters · Secondary search helper also consults repository data
- Select Items VM → Product Repo: orders · Order preparation uses repository data
- Place Order VM → Product Repo: validates · Checkout logic checks stock and user/order state
- Place Order VM → Users: uses · Validation depends on user and shipping data
- Place Order VM → Orders: creates · Successful checkout produces order entities
- Product Repo → Dummy Store: backs · Repository is backed by sample data store
- Dummy Store → Product Data: products · Sample store includes product fixtures
- Dummy Store → User Data: users · Sample store includes user fixtures
- Dummy Store → Orders: orders · Sample store also carries order-related fixtures
- Product Data → Products: provides · Product fixtures map to domain products
- User Data → Users: provides · User fixtures map to user and address models
- Push Product → Firebase: syncs · Product seed/sync flow targets Firebase
- Push User → Firebase: syncs · User seed/sync flow targets Firebase
- MainActivity → Firebase: auth/db · Main host interacts with Firebase services
- CI Build → MainActivity: builds · CI validates the Android app build