How sahuadarsh0/gogrocery works
Project Type and Purpose
• It’s a native Android mobile client for an e-commerce platform (inspired by Amazon, BigBasket, etc.).
• The app handles user registration/login, product browsing, cart management, order placement, OTP flows, and profile management.
File Structure (Highlights)
• Top-level: build scripts (build.gradle, gradle/, gradlew), CI config (.github/workflows/android.yml), app binary (app.apk).
• app/: Android Studio module
– src/main/java/app/infiniverse/grocery: Activities & core logic (UI controllers + business logic).
– src/main/res: Layouts, drawables, animations, menus (presentation assets).
– MyApp.java: Application class for global initialization.
– Utility classes: Converter, ConnectivityReceiver.
– Data models: Product.java, GridItem.java, etc.
– Adapters: Cart_Item_Adapter, Customer_Order_Adapter, etc.
– Gradle config including ProGuard rules and dependencies.
• src/test and src/androidTest: Unit and instrumentation tests.
• CI: GitHub Actions workflow for Android build & test.
README Insights
• It’s still WIP, deprecated v1.0 branch.
• No backend code included—assumes RESTful API services exist elsewhere.
• Screenshots illustrate key user flows: splash → home → category → product detail → cart → order → profile.
Main Components & Their Interactions
A. Mobile Client (Android App)
• Presentation Layer: Activities & Fragments rendering XML layouts.
• Data Layer: Model classes (Product, Order, Cart), local conversion utilities.
• Network Layer: HTTP client (Retrofit/Volley/etc.), ConnectivityReceiver monitors connectivity.
• Business Logic: Cart management (MyCart), OTP & authentication flows, order submissions.
• Application Context: MyApp for dependency setup (e.g., API client, logging).
B. Backend Services (External, not in repo)
• Authentication API (login/register/forget-password/OTP).
• Product Catalog API (list by category, search).
• Cart & Order API (add/remove items, place order, fetch order history).
• Profile Service (get/update user details).
• Payment Gateway (third-party service invoked on checkout).
C. CI/CD Pipeline
• GitHub Actions (android.yml) to build APK, run tests, possibly deploy artifacts.
Architectural Patterns & Design Principles
• Follows a classic Android MVC/MVP style:
• Controllers: Activities/Fragments
• Models: Plain Java objects
• Views: XML layouts, Adapters
• Separation of concerns: UI, data models, network utils separated into packages.
• Resiliency: Connectivity checks before network calls.
• Testability: Unit and instrumentation tests included.