How team-hmh/hmh-android works
Project Type & Purpose
• This is a multi-module Android mobile application (“하면함 Android”) that helps users break smartphone addiction.
• It follows a clean, layered, MVVM-style architecture with Dagger-Hilt for DI, Kotlin Coroutines/Flow, Material3, and custom Gradle convention plugins.
High-Level Layers & Modules
• UI / Feature layer (“feature/*” modules)
• Presentation / ViewModel layer (“core/viewmodel” module)
• Domain layer (“domain/*” modules)
• Data layer (“data/*” modules)
• Core libraries (“core/common”, “core/designsystem”, “core/network”, “core/database”, “core/service”)
• App container (“app” module)
• External services: REST APIs, Firebase, Room DB, Android UsageStats & Foreground Service
Main Components & Interactions
a. Feature Modules (UI)
• e.g. feature/login, feature/main, feature/challenge, feature/lock, feature/mypage, feature/onboarding, feature/store
• Provide Activities/Fragments → bind to corresponding ViewModels
b. ViewModel Layer
• core/viewmodel: exposes state/effects to UI, invokes domain use-cases
c. Domain Layer
• Use-case classes and Repository interfaces (e.g. LoginRepository, ChallengeRepository)
• Contains pure business logic, independent of data source
d. Data Layer
• data/* modules: implement Repository interfaces
• Each has localDataSource (Room, UsageStats), remoteDataSource (Retrofit APIs)
• Network/DB models ↔ domain models
e. Core Libraries
• core/network: Retrofit, OkHttp, Auth interceptor, Hilt modules for network
• core/database: RoomDatabase, DAOs, Hilt modules for DB
• core/common & designsystem: shared UI components, helpers, themes
• core/service: ForegroundService for app lock/notifications
f. App Module
• “app”: AndroidManifest, Application subclass, Hilt entry point, glues all modules
g. External Systems
• Backend REST API (Auth, Challenge, Point, MyPage, UsageGoal, etc.)
• Firebase utils
• Android OS: UsageStatsManager, NotificationManager, Foreground Service
• Local Room database
Data Flow & Dependency Directions
• UI → ViewModel → Domain use-cases → Repository interface → Data layer → (Network API or Room DB) → back to UI
• All dependencies point inward: feature → core/viewmodel → domain → data → core libraries → external
Architectural Patterns & Design Principles
• Clean Architecture / Layered + MVVM
• Single-direction dependency flow
• Separation of concerns: UI vs. state vs. business logic vs. data sources
• DI with Dagger-Hilt: denote Hilt Component at center or top, pointing to modules across layers