Releases: Rho-Studio/UI-Utils-Rho-Studio
Release list
v1.0.3 - Rho Studio UI App
What's Changed
- PLAN | Data Layer and Dagger DI by @AlexisTercero55 in #42
- Dev Iteration - Ready for QA review by @alexistercero-rho-dev in #43
- Pre release v103 by @AlexisTercero55 in #45
- Release v1.0.3 by @alexistercero-rho-dev in #46
Full Changelog: v1.0.2...v1.0.3
Technical Report: Rho Studio UI
An Android Jetpack Compose app.
Document Version: 3.1 Last Updated: August 25, 2026
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:
- Authentication Orchestration: Implements a production flow using Firebase Auth with a reactive session lifecycle. It ensures transactional security by synchronizing remote authentication states with automated, state-driven navigation transitions.
- Architectural Boundaries: A high-performance Multi-Tier Dagger Hierarchy that enforces strict data isolation between core, app, and user scopes. Sensitive user information is isolated within a dedicated "User Tier" that is physically purged from memory upon logout to prevent data leakage.
- Reactive Data Layer and State Integrity: Leverages Jetpack DataStore for atomic persistence and a Sealed State Machine for global orchestration. This creates a thread-safe, non-blocking "stream of truth" that guarantees the UI remains a perfect reflection of the underlying data.
- Stateless Presentation Layer: A fully decoupled UI built with Jetpack Compose following Unidirectional Data Flow (UDF) principles. This enables the presentation layer to scale dynamically across diverse device form factors while ensuring high testability and visual consistency.
- Domain-Driven Design (DDD): Every business operation is encapsulated in a dedicated UseCase (Interactor) within a framework-independent domain layer. By strictly isolating the business rules from the Android framework, ensure testability, logic reusability, and architectural resilience against framework changes.
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
:features depend only on :core modules (: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
| Concept | Implementation | Purpose |
|---|---|---|
| The Request | @Inject constructor |
Objects request dependencies via constructor injection, ensuring loose coupling and testability |
| The Recipe | @Module with @Provides / @Binds |
Dagger Modules define how to provide complex objects, interfaces, or library classes |
| The Manager | @Component |
Bridge between providers (Modules) and consumers (Activities/ViewModels). Validates graph at compile-time |
| The Lifecycle | @Scope (e.g., @Singleton, @UserScope) |
Ensures objects live exactly as long as their context (App lifecycle vs. User session) |
| Annotation Retention | @Retention(AnnotationRetention.RUNTIME) |
Ensures annotation metadata is available to Dagger compiler and at runtime |
| Multibinding Keys | @MapKey |
Identifies which class type to use as a Key in Dagger's internal Maps |
| Lazy Provisioning | Provider<T> |
Defers actual creation of dependencies until requested, saving memory and startup time |
| Kotlin Interop | @JvmSuppressWildcards |
Handles Kotlin's generic covariance in Dagger's Java-based compiler |
Multi-Tier Component Dependency Architecture
Core Tier (CoreComponent):
- Scope:
@Singleton. - Responsibility: Infrastructure foundation (Firebase, DataStore, Threading).
- Hierarchy: The foundation; does not depend on other components.
App Tier (AppComponent):
- Scope: @AppScope.
- Responsibility: Public lifecycle (Authentication feature, Shared UI).
- Hierarchy: Depends on CoreComponent. Orchestrates AuthModule (Pre-Login ViewModels) and UIModule (Shared ViewModels).
User Tier (UserComponent):
- Scope:
@UserScope. - Responsibility: Authenticated session (Home feature, Profile).
- Hierarchy: Depends on CoreComponent. Orchestrates
HomeModule(Post-Login ViewModels) andUIModule. - Isolation: Created dynamically upon login and binary-purged from memory upon logout to ensure session security.
2.4 ViewModel Multibinding Strategy
To decouple the UI from DI wiring, we implement a centralized registry using @IntoMap:
Key Principles:
- Registry: Feature modules contribute ViewModels via a custom @ViewModelKey.
- Factory: A single DaggerViewModelFactory resolves instances on-demand, adhering to the Open/Closed Principle.
- Isolation: Each component builds unique internal Maps, ensuring strict data and logic isolation based on user state.
| Component | Modules Included | Resulting Internal Map |
|---|---|---|
| AppComponent | AuthModule, UIModule |
{LoginViewModel, HeaderViewModel} |
| UserComponent | 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.
- Jetpack Compose: All UI is declarative, using stateless composables for maximum testability.
- MVVM Pattern: ViewModels manage UI state using
StateFlow, exposing it to the UI in a lifecycle-aware manner. - UDF (Unidirectional Data Flow): User actions trigger events in the ViewModel, which updates the state, triggering a UI recomposition.
- Side-Effect Orchestration:
MainActivityusesLaunchedEffectkeyed to authentication state, transforming state changes into one-time navigation events. - Key Components:
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 components
3.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:- Thread Safety: Automatic execution on
Dispatchers.IO. - Result Wrapping: Consistent use of the
Result<T>sealed class for Success/Error states. - Functional Invocation: Use cases are invoked as functions using the
invokeoperator.
- Thread Safety: Automatic execution on
-
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.
...
v1.0.2 - Rho Studio UI App
What's Changed
- Domain Layer & Use Case Implementation by @AlexisTercero55 in #31
- Pre-release v1.0.2 by @alexistercero-rho-dev in #33
- Pre release v102 Done by @AlexisTercero55 in #34
- Release v1.0.2 - Rho Studio UI by @AlexisTercero55 in #35
Full Changelog: v1.0.1...v1.0.2
Technical Report: Rho Studio UI
An Android Jetpack Compose app.
Document Version: 2.0 Last Updated: August 10, 2026
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 pure Jetpack Compose implementation following a Single-Activity Architecture, leveraging a reactive MVVM (Model-View-ViewModel) pattern to ensure a clean separation of concerns, testability, 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.
Core Features:
- Secure Authentication: Robust login flow with real-time validation and session lifecycle management, following corporate security protocols.
- Adaptive Home Experience: A responsive home interface that dynamically adjusts to different service modules and device form factors.
- Brand Consistency: A centralized design system leveraging Material 3 to reflect the Rho Studio corporate identity across all derived applications.
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 is divided into three primary logical layers, enforcing a strict unidirectional dependency flow: UI → Domain ← Data.
graph TD
subgraph "UI Layer (Presentation)"
UI[Jetpack Compose Screens]
VM[ViewModels]
Nav[Navigation / NavHost]
end
subgraph "Domain Layer (Business Logic)"
UC[Use Cases / Interactors]
Entities[Domain Entities]
Int[Repository Interfaces]
end
subgraph "Data Layer (Infrastructure)"
Repo[Repository Implementations]
SM[Session Manager]
Local[Local / Network Data Sources]
end
UI --> VM
VM --> UC
UC --> Entities
UC --> Int
Repo -.-> Int
Repo --> SM
Repo --> Local2.2 Multi-Module Topology
We have moved away from a monolithic :app structure to a Feature-Layered Modularization strategy. This optimizes build parallelization and enforces strict dependency inversion.
flowchart TD
APP[":app<br/>MainActivity, NavHost"]
AUTH[":features:auth<br/>LoginScreen, LoginViewModel"]
HOME[":features:home<br/>HomeScreen, HomeViewModel"]
UI_CORE[":core:ui<br/>Theme, Common Composables"]
DOMAIN[":core:domain<br/>Use Cases, Models, Contracts"]
DATA[":core:data<br/>Repositories, SessionManager"]
APP --> AUTH
APP --> HOME
AUTH --> UI_CORE
AUTH --> DOMAIN
HOME --> UI_CORE
HOME --> DOMAIN
UI_CORE --> DOMAIN
DOMAIN -.->|"implemented by"| DATA
style APP fill:#e94560,stroke:#c62828,color:#ffffff
style AUTH fill:#1a1a2e,stroke:#e94560,color:#ffffff
style HOME fill:#1a1a2e,stroke:#e94560,color:#ffffff
style UI_CORE fill:#16213e,stroke:#0f3460,color:#ffffff
style DOMAIN fill:#0f3460,stroke:#16213e,color:#ffffff
style DATA fill:#1a1a2e,stroke:#e94560,color:#ffffffKey Principle:
:featuresdepend only on:coremodules (:core:domain,:core:ui), preventing circular dependencies. Feature-specific models remain within their respective feature modules, adhering to the Interface Segregation Principle.
3. Layer Detail & Responsibilities
3.1 UI Layer (Presentation)
Goal: Transform application state into a visual interface and handle user interactions.
- Jetpack Compose: All UI is declarative, using stateless composables for maximum testability.
- MVVM Pattern: ViewModels manage UI state using
StateFlow, exposing it to the UI in a lifecycle-aware manner. - UDF (Unidirectional Data Flow): User actions trigger events in the ViewModel, which updates the state, triggering a UI recomposition.
- Side-Effect Orchestration:
MainActivityusesLaunchedEffectkeyed to authentication state, transforming state changes into one-time navigation events. - Key Components:
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 components
flowchart TB
subgraph Navigation["Navigation Orchestration"]
MA["MainActivity.kt<br/>- NavHost<br/>- Session-based routing"]
end
subgraph Shared["Shared UI Components"]
PV["BaseViewModel.kt<br/>- Loading states<br/>- Error handling"]
HV["HeaderViewModel.kt<br/>- Session state bridging"]
PH["PageHeader.kt"]
PF["PageFooter.kt"]
end
subgraph Auth["Authentication Feature"]
LS["LoginScreen.kt"]
LVM["LoginViewModel.kt<br/>- Form state<br/>- Debounced validation"]
end
subgraph Home["Home Feature"]
HS["HomeScreen.kt"]
HVM["HomeViewModel.kt<br/>- Home state<br/>- Session termination"]
end
MA --> LS
MA --> HS
LS --> LVM
HS --> HVM
LVM --> PV
HVM --> PV
HV --> PV
style Navigation fill:#e94560,stroke:#c62828,color:#ffffff
style Shared fill:#16213e,stroke:#0f3460,color:#ffffff
style Auth fill:#1a1a2e,stroke:#e94560,color:#ffffff
style Home fill:#1a1a2e,stroke:#e94560,color:#ffffff3.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). - 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. - Entities: Data classes like
UserandCredentialsrepresent the core business models. - 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.
- Repository Pattern: Acts as a mediator between different data sources (Network, Database) and the Domain Layer.
- Session Management:
SessionManagerserves as the Single Source of Truth (SSOT) for the user's authentication state, exposingStateFlow<AuthState>for the UI to observe. - Current Implementation: Uses
SharedPreferenceswithGsonserialization for persistence and mock authentication for development. - Key Components:
SessionManager.kt: Singleton coordinator for authentication state and user profile.SessionRepository.kt: Coordinates data retrieval strategies.SessionRepositoryImpl.kt: Manages persistent storage using SharedPreferences. Migrated to Room Database in the future.AuthRepositoryImpl.kt: Mock implementation (temporary) simulating network delay and user creation. Replaced by Firebase Auth in the future.
flowchart TB
subgraph SSOT["Single Source of Truth"]
SM["SessionManager.kt<br/>- AuthState Flow<br/>- updateSession()<br/>- clearSession()"]
end
subgraph Repos["Repository Implementations"]
ARI["AuthRepositoryImpl<br/>- Mock login()"]
SRI["SessionRepositoryImpl<br/>- SharedPreferences"]
end
subgraph Sources["Data Sources (Planned)"]
Remote["Remote API<br/>- Firebase Auth"]
Local["Local Storage<br/>- Room Database"]
end
SM --> SRI
ARI --> Remote
SRI --> Local
style SSOT fill:#e94560,stroke:#c62828,color:#ffffff
style Repos fill:#1a1...Rho Studio UI App - v1.0.1
Rho Studio UI App
An Android Jetpack Compose app.
What's Changed
- 15 UI migration compose by @AlexisTercero55 in #23
- DOC | #19 Technical Report: Rho Studio UI - CI/CD for release by @AlexisTercero55 in #24
- Pre-Release | Android Studio UI App - Jetpack compose migration done by @AlexisTercero55 in #25
- Release v1.0.1 - RhoStudio UI by @AlexisTercero55 in #26
Full Changelog: v1.0.0...v1.0.1
Technical Report: Rho Studio UI Architecture
Modern Android Development with Jetpack Compose & MVVM
This report outlines the architecture design of the Rho Studio UI application.
1. Executive Summary
The application is a pure Jetpack Compose implementation following a Single-Activity Architecture. It leverages a reactive MVVM (Model-View-ViewModel) pattern to ensure a clean separation of concerns, testability, and a fluid user experience driven by Unidirectional Data Flow (UDF).
2. Integrated Architectural Perspective
The project utilizes a Feature-Layered Architecture. Each feature is encapsulated within its own package, maintaining a clean internal separation between UI (Compose) and Logic (ViewModels), while sharing a common Core/Data foundation.
2.1 UI & Feature Layers (View)
The UI is composed of stateless screens and modular components that observe state from their respective ViewModels.
MainActivity.kt: The application's core orchestrator. Manages the high-levelNavHost, coordinates the globalLoadingOverlay, and synchronizes navigation viaSessionManager.- Authentication Feature (
features/auth/):LoginScreen.kt: The main entry point for user authentication.LoginEmailField.kt/LoginPasswordField.kt: Specialized inputs with built-in validation and security logic.
- Home & Dashboard Feature (
features/home/):HomeScreen.kt: The primary post-auth landing page.ServiceList.kt/ServiceItem.kt: Adaptive components for dynamic content delivery.
- Common UI Feature (
features/common/):PageHeader.kt/PageFooter.kt: Shared layouts that provide global context and actions (e.g., Logout).
2.2 Business Logic & State Layer (ViewModel)
ViewModels act as the bridge between features and the data layer, handling user intent and reactive state.
BaseViewModel.kt: The architectural anchor providing unified loading states, toast messaging, and standardized error handling.LoginViewModel.kt: Manages complex form state and debounced validation logic.HomeViewModel.kt: Orchestrates dashboard content lifecycle and session termination.HeaderViewModel.kt: Bridges theSessionManagerstate to common UI components like thePageHeader.
2.3 Core Data & Infrastructure Layer
Provides the essential services and "Single Source of Truth" for the entire application.
SessionManager.kt: A singleton coordinator for the application's global authentication state and user profile.SessionRepository.kt: Manages persistent storage and retrieval of session tokens and user data.Credentials.kt/User.kt/ServiceModule.kt: Strongly typed data models that enforce business rules and schema consistency.
3. Core Technical Implementations
3.1 State-Driven Reactive Navigation
Navigation is decoupled from direct user input. MainActivity.kt observes the isAuthenticated state from SessionManager.kt. When this state changes, a LaunchedEffect executes the transition, ensuring the UI is always a reflection of the underlying session state.
3.2 Performance Optimized Validation
To ensure a smooth typing experience, LoginViewModel.kt utilizes Coroutine Debouncing. Input validation is deferred until the user pauses for 300ms, minimizing unnecessary UI updates and logic execution.
3.3 Centralized Design System
Managed in ui/theme/, the app uses a custom Material 3 implementation. This ensures brand consistency (RhoRed, RhoStrongGray) is automatically applied to all features through a unified Theme.kt and Color.kt definition.
4. File Registry & Responsibilities
| File | Feature | Primary Engineering Responsibility |
|---|---|---|
MainActivity.kt |
App Root | Global orchestration, NavHost, and session-based routing. |
BaseViewModel.kt |
Core | Shared architectural logic for Loading/Error states. |
SessionManager.kt |
Core | Centralized authentication and session lifecycle management. |
LoginViewModel.kt |
Auth | Form state management and debounced validation. |
HomeScreen.kt |
Home | Root layout for the post-authentication dashboard. |
ServiceList.kt |
Home | Efficient grid implementation for platform modules. |
Credentials.kt |
Core | Logic-heavy model for credential validation rules. |
Theme.kt |
Design | Global Material 3 theme configuration and brand mapping. |
5. Path to Enterprise-Grade Architecture
To transition this foundation into a highly scalable, enterprise-grade application, the following architectural advancements are planned to manage complex business flows and transactional integrity.
5.1 Domain Layer & Use Case Implementation
As business logic complexity grows, direct ViewModel-to-Repository interaction is being transitioned to a dedicated Domain Layer.
- Use Cases (Interactors): Classes like
LoginUseCase.kt(core/domain/usecase/LoginUseCase.kt) encapsulate specific business rules, making the logic reusable across different ViewModels and testable in isolation. - Business Transaction Flow: A single user action (e.g., "Login") may involve multiple steps: credential validation -> token acquisition -> user profile synchronization. These are managed as atomic transactions within the Domain Layer.
- Best Practice: Android Guide to the Domain Layer
5.2 Advanced Data Flow & Synchronization
Enterprise apps require robust data handling beyond simple memory state.
- Repository Pattern: Refined
SessionRepository.ktand future repositories will implement a Single Source of Truth (SSOT) strategy, coordinating between local storage (Room) and remote APIs (Retrofit). - Reactive Stream Transactions: Utilizing Kotlin Flow for end-to-end reactive streams. Transactions are modeled as immutable states flowing from the Data Layer to the UI.
- Best Practice: Data Layer with Repositories
5.3 Scalability & Reliability Standards
- Dependency Injection (Hilt): Moving from manual singleton management to Dagger Hilt for better decoupling and automated lifecycle management.
- Modularization: Splitting the current feature packages into independent Gradle modules (
:feature:auth,:feature:home,:core:data) to improve build times and enforce strict visibility boundaries. - Best Practice: Guide to App Modularization
6. References & Standards
- MAD (Modern Android Development): Adhering to official Android Architecture Guidelines.
- Jetpack Compose Best Practices: Following UDF (Unidirectional Data Flow) principles for state management.
- Clean Architecture: Implementing principles from Robert C. Martin to maintain a high degree of testability and independence from external libraries. Clean Architecture Reference
Rho.Studio® - Engineering Department - Contact alexis.tercero@rho.studio
Rho Studio UI App - v1.0.0
Rho Studio UI App
An Android View System app.
What's Changed
- 3 UI utils rho studio project by @alexistercero-rho-dev in #5
- 4 home mvvm by @AlexisTercero55 in #8
- Login Fix - MVVM Architecture improvements - before adding more UI by @AlexisTercero55 in #12
- 13 home UI mvvm by @AlexisTercero55 in #14
- Release v1.0.0 - RhoStudio UI by @AlexisTercero55 in #17
New Contributors
- @alexistercero-rho-dev made their first contribution in #5
- @AlexisTercero55 made their first contribution in #8
Full Changelog: https://github.com/alexistercero-rho-dev/UI-Utils-Rho-Studio/commits/v1.0.0
Architecture
- MVVM Architecture for managing the app and code.
- Single-activity Android architecture.
- Android View System for UI.
- Session manager.
Current navigation graph