How mo7amd89/nowinandroid works
Project’s High-Level Structure
• The primary product is a modern Android app with multiple build flavors (demo versus prod) for either static data or live content.
• It is modularized into many separate components. There are “feature” modules (bookmarks, for you, interests, search, settings, topic) that handle specific user-facing screens and functionalities.
• There are “core” modules that encapsulate shared functionality across the app. These include analytics, common utilities, data, database, datastore, design system, domain (business logic), model, network, notifications, testing utilities, and UI.
• In addition, there are supporting modules like benchmarks, build-logic for custom Gradle plugins, lint rules, and sync.
Main Components and Their Responsibilities
• App Module: This is the actual runnable Android application. It integrates the feature modules and configures the product flavors (demo/prod) as well as build variants (debug, release, benchmark).
• Feature Modules: Each “feature” (bookmarks, for you, interests, etc.) encapsulates its own screens (built with Compose), ViewModels, and navigation logic. They are designed to be independently testable and replaceable.
• Presentation/UI Layer: Built with Jetpack Compose following Material 3 guidelines. UI components are defined in both the app module and the shared “core/designsystem” module.
• Domain Layer: Contains business logic and use cases (for example, fetching followable topics or recent searches) defined in the core/domain module.
• Data Layer & Repository: The core/data module (with repositories, network and local database integrations) is responsible for fetching data either from local storage (via core/database) or via network calls (in core/network) and mapping the results to domain models (in core/model).
• Infrastructure & Services: Modules like core/network, core/notifications, and core/datastore-proto provide network data sources, push notification support, and data persistence using DataStore.
• Dependency Injection: Hilt is used across the project to bind interfaces to implementations. This is critical because it makes it possible to substitute concrete implementations with test doubles (as seen in the testing modules).
• Testing and Benchmarking: Dedicated modules (like benchmarks, core/testing, ui-test-hilt-manifest) exist for unit tests, instrumentation tests, screenshot tests, and performance benchmarking. They hook into the DI and repository design to enable robust validation without heavy mocking.
Interactions and Data Flow
• The presentation layer (Compose screens within feature modules) communicates with ViewModels.
• ViewModels use use cases defined in the Domain layer to process user actions.
• Use cases interact with repositories from the Data layer which decide whether to fetch fresh data from the Network module (core/network) or cached data from the Database (core/database) or DataStore (core/datastore).
• Shared components such as the design system and analytics are injected into relevant parts of the app via Hilt.
• There is a parallel build/process environment shown by different build flavors (demo for static data and prod for live network data) and variants (debug, release, benchmark).
Architectural Patterns & Tools
• Use of Dependency Injection (Hilt) to decouple modules.
• Use the Model-View-ViewModel (MVVM) pattern as the primary design pattern for the UI layer.
• Repository Pattern in the Data layer where concrete implementations abstract network or database logic.
• Interactions between feature modules and core libraries where common business logic, UI components, and networking facilities are reused.
• The build infrastructure (Gradle, GitHub Actions workflows) can be represented as peripheral “DevOps” components that automate testing, building, and benchmarking.