ワンクリックで
architecture-guidelines
// Architectural patterns and coding standards followed in the project.
// Architectural patterns and coding standards followed in the project.
Useful Gradle commands for linting, testing, and deployment.
Verification steps to ensure code changes are correct and maintainable.
General code conventions for the project.
Kotlin coding conventions for the project.
General code conventions for the project.
TOML coding conventions for the project.
| name | architecture_guidelines |
| description | Architectural patterns and coding standards followed in the project. |
This document outlines the architectural patterns and coding standards followed in the project. It serves as a reference for developers and coding agents to ensure consistency and maintainability.
The codebase is structured to facilitate potential future migration to Kotlin Multiplatform (KMP).
platform: Contains Android-specific implementations that rely on the Android SDK (e.g.,
activity, application, system services, intended actual declarations).common: Contains platform-agnostic code (intended
commonMain), following Clean Architecture principles. This is where the majority of the application logic and UI resides.common)The common package is further divided into the standard Clean Architecture layers.
Dependency Rule: UI → Presentation → Domain ← Data
domain)model: Domain models (suffix: DomainModel).use_case: Business logic units (suffix: UseCase).repository: Repository interfaces defining data operations.data)domain.repository: Implementation of domain repository interfaces.source: Data sources (e.g., database, network).model: Data entities (suffix: DataModel).mapper: Mappers to convert between DataModel and DomainModel to ensure decoupling.presentation)domain.view_model: ViewModels (suffix: ViewModel).model: UI state models (suffix: UiModel).mapper: Mappers to convert between DomainModel and UiModel.navigation: Navigation logic and definitions.ui)presentation.feature: Composable screens and feature-specific components.theme: Design system and theming.di)*DataModel*DomainModel*UiModelUseCase (e.g., GetBarcodesUseCase).ViewModel (e.g., HomeScreenViewModel).UI (e.g., HomeScreenUI).SourceToDestinationMapper (e.g., BarcodeUiToDomainMapper,
BarcodeDataToDomainMapper).Features are organized hierarchically within presentation and
ui packages to keep related files together.
Presentation Layer (common/presentation/feature/<feature>/<screen>/)
view_model/: Contains the ViewModel.state/:
*UIState: Data class representing the screen state.*UIStateEvents: Interface/class for event callbacks handled by the ViewModel.event/: *UIEvent (Sealed interface) for events triggered from the UI.UI Layer (common/ui/feature/<feature>/<screen>/)
screen/: Contains the main screen Composable (e.g., HomeScreenUI.kt).components/: Sub-components specific to the screen.bottom_sheet/, dialog/: specific UI elements.ViewModel exposes a uiState (usually a StateFlow) and uiStateEvents.uiState to render the interface.handleUIEvent lambda) which are processed by the ViewModel.