How namo-log/android works
Project Type & Purpose
• The project is an Android mobile application built with Kotlin.
• Its purpose is centered on “나의 모임 기록, 나모” (recording social or group meetings) and uses a clean, modular structure that leverages modern Android technologies.
• Key technologies include Jetpack components (Navigation, LiveData, ViewModel), Hilt for dependency injection, Room for local data persistence, Retrofit/OkHttp for networking, and Glide for image loading.
• The architecture follows Clean Architecture principles, separating code into Presentation, Domain, and Data layers.
Analyzing the File Structure
• The top-level directory, “app”, contains all the Android-specific source code.
• “data”: Contains network/API-related services, DTOs, remote data sources, repository implementations, and utility/mapping functions to convert between DTOs and domain models.
• “domain”: Contains the core business logic – your models, repository interfaces, and usecases for various features such as authentication, diary management, scheduling, friend management, and community functions.
• “presentation”: Consists of UI components including Activities, Fragments, ViewModels, dialogs, and configuration modules. It also includes dependency injection modules that wire everything together.
• There are dedicated directories for testing (androidTest, test), resource files (layouts, drawables, assets), and build configuration files (build.gradle, settings.gradle).
Key Components
a. Main Components:
• UI/Presentation Layer – Activities, Fragments (e.g., MainActivity, SplashActivity, various feature fragments and dialogs), and ViewModels.
• Domain Layer – Use cases (e.g., GetActivitiesUseCase, EditProfileUseCase) and domain models (ActivityModel, AuthModel, etc.). This layer encapsulates your business logic.
• Data Layer – Repository implementations, remote data sources (like RemoteAuthDataSource, RemoteDiaryDataSource, etc.), API services (Retrofit interfaces such as AuthApiService, DiaryApiService), DTOs, mappers, and utility classes for error handling or conversion.
• External Services – Networking (Retrofit & OkHttp), local persistence (Room), and third-party libraries (Glide, Coroutines for asynchronous processing).
• Dependency Injection – Hilt modules (in the “presentation/di” package) that bind the data sources, repositories, and use cases to the UI layer.
b. Relationships & Interactions:
• The UI layer (ViewModels, Activities, and Fragments) interacts with the Domain layer by invoking UseCases.
• UseCases, in turn, call the Repository interfaces defined in the Domain layer.
• The Repository implementations in the Data layer delegate work to one or more DataSources (remote API calls, local database via Room, and assets, such as JSON onboarding files).
• Mappers convert data between DTOs (data layer) and Models (domain layer).
• Dependency injection (using Hilt) configures dependencies across these layers.
c. Architectural Patterns & Design Principles:
• Clean Architecture: Clearly separate presentation, domain, and data.
• MVVM: Use of ViewModel and LiveData (or other observable patterns) to manage UI state.
• Repository Pattern: Abstract data fetching mechanisms.
• Dependency Injection: Using Hilt to manage wiring and modularity.
• Asynchronous Operations: Managed via Kotlin Coroutines.