v1.0.3 - Rho Studio UI App #47
AlexisTercero55
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What's Changed
Full Changelog: v1.0.2...v1.0.3
Technical Report: Rho Studio UI
An Android Jetpack Compose app.
Enterprise-Grade Android Architecture with Jetpack Compose
This document provides a comprehensive technical overview of the Rho Studio UI application. It serves as the primary architectural reference for developers, outlining the system's design, layer responsibilities, and technical standards.
1. Executive Summary
Rho Studio UI is the base application template designed to establish and enforce the Rho Studio Android App Standards. It provides a robust foundation for building secure, authenticated mobile experiences within the Rho Studio ecosystem.
The application is a Jetpack Compose implementation following a Single-Activity Architecture, leveraging a reactive MVVM (Model-View-ViewModel) pattern, implementing a Multi-Tier Dagger Hierarchy and a fluid user experience driven by Unidirectional Data Flow (UDF). This architectural foundation ensures a focus on Fluid UX, Transactional Integrity, and Decoupled Business Logic.
Important
In order to add a new feature: See CONTRIBUTING.md.
Core Features:
2. Architectural Framework
The application follows a Single-Activity Architecture and is structured according to Clean Architecture principles. It utilizes a Feature-Layered Modularization strategy to ensure scalability and maintainability.
2.1 Layered Structure
The system follows the three layers Google's recommendations:
2.2 Multi-Module Topology
The project is split into granular Gradle modules to improve build parallelization and enforce boundaries.
Tip
:featuresdepend only on:coremodules (:core:domain,:core:ui), preventing circular dependencies. Feature-specific models remain within their respective feature modules.2.3 Multi-Tier Dependency Injection (Dagger 2 + KSP)
We utilize a high-performance Directed Acyclic Graph (DAG) generated at compile-time using KSP to ensure zero runtime overhead. The graph is organized into three tiers to mirror the application lifecycle:
DI Conceptual Framework
@Injectconstructor@Modulewith@Provides/@Binds@Component@Scope(e.g.,@Singleton,@UserScope)@Retention(AnnotationRetention.RUNTIME)@MapKeyProvider<T>@JvmSuppressWildcardsMulti-Tier Component Dependency Architecture
Core Tier (
CoreComponent):@Singleton.App Tier (
AppComponent):User Tier (
UserComponent):@UserScope.HomeModule(Post-Login ViewModels) andUIModule.2.4 ViewModel Multibinding Strategy
To decouple the UI from DI wiring, we implement a centralized registry using
@IntoMap:Key Principles:
AuthModule,UIModule{LoginViewModel, HeaderViewModel}HomeModule,UIModule{HomeViewModel, HeaderViewModel}3. Layer Detail & Responsibilities
3.1 UI Layer (Presentation)
Goal: Transform application state into a visual interface and handle user interactions.
StateFlow, exposing it to the UI in a lifecycle-aware manner.MainActivityusesLaunchedEffectkeyed to authentication state, transforming state changes into one-time navigation events.MainActivity.kt: The entry point and navigation orchestrator.LoginViewModel.kt&HomeViewModel.kt: Feature-specific state holders.BaseViewModel.kt: Provides shared logic for loading states, error handling, and navigation side-effects.HeaderViewModel.kt: BridgesSessionManagerstate to common UI components3.2 Domain Layer (Business Logic)
Goal: House the platform-agnostic business rules and "truth" of the application.
Pure Kotlin: This layer has zero dependencies on the Android Framework (no
Context, noParcelable).Entities: Data classes like
UserandCredentialsrepresent the core business models.Use Cases (Interactors): Each business action is encapsulated in a dedicated Use Case (e.g.,
LoginUseCase). This promotes the Single Responsibility Principle and makes logic reusable across ViewModels.BaseUseCase Pattern: All interactors inherit from
BaseUseCase<P, R>. This architectural anchor standardizes:Dispatchers.IO.Result<T>sealed class for Success/Error states.invokeoperator.Key Components:
BaseUseCase<P, R>: Standardizes execution context (Coroutines) and error handling.SessionManagerInterface: Defines the contract for session operations without revealing implementation details.LoginUseCase: Encapsulates the authentication transaction.LogoutUseCase: Orchestrates atomic session teardown.3.3 Data Layer (Infrastructure)
Goal: Manage data acquisition, persistence, and external service coordination.
SessionManagerserves as the Single Source of Truth (SSOT) for the user's authentication state, exposingStateFlow<AuthState>for the UI to observe.4. Technical Implementation Standards
Rho Studio UI is engineered for sensitive information (fintech) environments
4.1 Session Isolation
4.2 Modularization Strategy
The project is split into granular Gradle modules to improve build times and enforce architectural boundaries:
:app: The main coordinator and DI root.:features:*: Feature-specific UI and ViewModels (e.g.,:features:auth,:features:home).:core:ui: Shared design system components and theming.:core:domain: The platform-agnostic business layer.:core:data: Implementation details for data and external services.4.3 Design System
Located in
:core:ui, the design system defines the application's visual language:RhoRed,RhoStrongGray).5. Verification & Quality Assurance
5.1 Automated Tests
DaggerGraphTest)SessionManagerTest)LoginUseCaseTest,LogoutUseCaseTest)google-services.jsonintegration5.2 Manual QA Test Plan
Scenario 1: Fresh Install / First Launch
Scenario 2: Successful Login & Data Loading
Scenario 3: Secure Logout & Session Isolation
5.3 Regression Checklist for QA
UninitializedPropertyAccessExceptionoccurs during rapid Login/Logout cycles.PageHeaderreactively updates when a new user logs in.@UserScopeobjects are destroyed on logout (Android Profiler).6. Roadmap & Evolution: Strategic Phases
The application is transitioning from a modular prototype to a production-hardened system. The evolution is structured into three strategic phases:
Phase I: Dependency Orchestration & Decoupling - [COMPLETED v1.0.3]
@Componentand@Moduleboundaries for:coreand:features.@Injectfor UseCase and ViewModel construction to ensure compile-time dependency safety.@IntoMapandDaggerViewModelFactory.CoreComponent,AppComponent, andUserComponent.@UserScopegraph on logout to prevent data leakage.Phase II: Transactional Integrity & persistence
Advanced Token Management:
Offline-First with Room:
8. References & Standards
Rho.Studio® - Engineering Department - Contact alexis.tercero@rho.studio
This discussion was created from the release v1.0.3 - Rho Studio UI App.
All reactions