How ljzapps/questify-android works
Main Components
• User Interface (UI) Layer:
• This layer is primarily contained in the “ui” directory and its subdirectories (such as ui/features/dashboard, ui/features/login_and_register, ui/features/quests, etc.).
• It implements the presentation using modern Android technologies like Jetpack Compose and XML resources (referenced in app/src/main/res).
• Screens, dialogs, navigational elements (navigation/routes), and common UI components.
• Application and Presentation Layer:
• The “core/application” package contains the main application class (App.kt), configuration (AppConfig.kt), and constants.
• Presentation logic is implemented in separate ViewModel classes (for example, in ui/features/main, ui/features/dashboard, etc.), following the MVVM pattern.
• This layer integrates UI events with business logic.
• Domain Layer:
• Found in the “domain” package, this layer encapsulates business logic, data models (such as QuestEntity, RoutineEntity, TrophyEntity, etc.), and core functionalities like database operations.
• The Domain includes migrations, DAOs (data access objects), repositories (quest, login, trophies, etc.), and data stores (AppSettings, FeatureSettings).
• Domain objects and contracts that drive the business processes.
• Data Layer:
• Located in the “data” directory, this layer handles interactions with external sources.
• It contains API clients, services (e.g., LoginService, RegisterService), error handling (interceptors, error emitters), and network utilities.
• The API layer is responsible for forming HTTP requests, handling responses, and mapping JSON (through adapters and annotations).
• Infrastructure and Integration:
• Several dependency injection modules are defined under “core/di”. They provide the glue among components (injecting dependencies such as networking, database, emitter, shared preferences, etc.).
• External integrations are supported by components like FirebaseExperiments and potentially the AI components (see “core/ai”) where the scoring and farming detectors provide smart task evaluation.
• Security and configuration elements are included (e.g., app.properties, network security config, proguard rules).
Relationships and Interactions
• ViewModels interact with the domain repositories and use-cases, abstracting data fetching and business rules.
• Domain repositories, spread across “domain/repositories” and “domain/daos”, bridge the UI and the underlying data sources (local database and remote API).
• Dependency injection (from the DI modules) connects all these components together. Represent the DI container (or modules) as a separate component orchestrating dependencies.
Architectural Patterns and Design Principles
• MVVM: Emphasize the separation of UI (View), business logic (ViewModel), and data (Model).
• Repository Pattern: Domain repositories abstract data sources, promoting separation between data handling and business logic.
• Layered Architecture: Clear distinction among presentation, domain, and data layers.
• Dependency Injection: The use of DI modules shows an emphasis on loose coupling and testability.
• Modularization: The file structure reflects a modular design with dedicated packages for UI features, data, domain logic, and Compose components.
Relevant Technologies, Frameworks, and Libraries
• Kotlin language and Android SDK.
• Jetpack Compose for UI development.
• Android architecture components (ViewModel, LiveData/State management).
• Gradle (with Kotlin DSL) for build management.
• Firebase for experiments and possibly analytics.
• Possibly retrofit/okhttp (or similar libraries) for network and API calls.
• Android Room (or a similar database layer) for local storage, with database migrations.
Summarized Structure
• Top Section: User Interface Layer (various screens, dialogs, and navigation components).
• Middle Section: Application/Presentation Layer (ViewModels, AppConfig, and DI modules).
• Lower Section: Domain Layer (business models, repositories, DAOs, migrations) alongside the Data Layer (API services, error handling, network utilities).
• Side Section: Infrastructure & External Integrations (Firebase, AI modules, security configurations).