How doubtless46/doubtless-app works
Main Components
• User Interface (UI) & Presentation Layer:
• Activities & Fragments (e.g., MainActivity, LoginActivity, OnBoardingActivity, SplashActivity)
• Layout and theming resources (e.g., retro layouts, buttons, drawable resources)
• ViewModel & Use Cases (Domain/Presentation Logic):
• Individual ViewModels for each screen (e.g., DashboardViewModel, HomeViewModel, CreateDoubtViewModel)
• Use case classes organized under each screen’s directory that encapsulate business logic (e.g., PostDoubtUseCase, FetchHomeFeedUseCase, VotingUseCase)
• Navigation & Routing:
• Custom routing/navigation components (e.g., Router, FragNavigator, BackPressDispatcher)
• Manual bottom navigation management with multiple back stacks
• Dependency Management:
• Dependency Injection container (e.g., AppCompositionRoot in the di package) that glues components together
• Network & Data Communication:
• Network module (DoubtlessServer and related utilities) for API interactions
• Possibly local storage/sharing (e.g., DoubtDataSharedPrefUseCase) for persisting session or user data
• Analytics & Logging:
• AnalyticsTracker under the analytics package for user engagement tracking
• Utility & Theming:
• Utility functions and extensions (e.g., Utils, animations) and theming classes to support the retro UI
Relationships and Interactions
• The UI layer is at the top with Activities and Fragments communicating with their respective ViewModels.
• ViewModels call specific Use Cases that encapsulate business logic. These use cases handle tasks like posting doubts, fetching feeds, or managing user data.
• The Use Cases often interact with external components such as:
• The DoubtlessServer for network calls.
• Shared preferences or local databases for persistence.
• The DI container (AppCompositionRoot) is used to inject dependencies like the ViewModels, Use Cases, network services, and analytics components.
• The Navigation components are linked to the UI components to handle screen transitions and backstack management.
• AnalyticsTracker monitors user interactions across screens.
Architectural Patterns
• The project follows an MVVM-like structure with a clear separation between Views, ViewModels, and Use Cases.
• Dependency Injection is clearly used to centralize and manage dependencies within the app.
• There is an emphasis on modularization, with screens and their associated logic (use cases and view holders) segmented into their own packages.
• Custom UI navigation logic is implemented to support multiple back stacks while using a manual bottom navigation approach, showcasing a bespoke design pattern.
Technologies and Libraries of Note
• Android SDK as the base platform.
• Gradle used for project build and dependency management.
• Standard Android libraries for activities, fragments, and UI components.
• Custom-defined utilities and theming classes for the retro UI.