Project Description
Android application developed in Kotlin that implements Clean Architecture principles to manage a personal library. While simple in functionality, it demonstrates the implementation of modern Android development patterns and practices.
Project Structure
π LibraryApp
βββ π LibraryApplication.kt
βββ π MainActivity.kt
βββ π data
β βββ π local
β β βββ π dao
β β β βββ π BookDao.kt
β β βββ π database
β β β βββ π AppDatabase.kt
β β βββ π entity
β β βββ π BookEntity.kt
β βββ π mapper
β β βββ π BookMapper.kt
β βββ π remote
β β βββ π api
β β βββ π dto
β βββ π repository
β βββ π BookRepositoryImpl.kt
βββ π di
β βββ π DatabaseModule.kt
βββ π domain
β βββ π model
β β βββ π Book.kt
β β βββ π ReadStatus.kt
β βββ π repository
β β βββ π BookRepository.kt
β βββ π usecase
β βββ π AddBookUseCase.kt
β βββ π GetAllBooksUseCase.kt
β βββ π GetBookByIdUseCase.kt
β βββ π SearchBooksUseCase.kt
β βββ π UpdateBookStatusUseCase.kt
βββ π presentation
β βββ π common
β β βββ π components
β β βββ π extensions
β βββ π model
β β βββ π BookDetailUiState.kt
β β βββ π BookListUiState.kt
β β βββ π BookUI.kt
β βββ π navigation
β β βββ π NavigationGraph.kt
β βββ π screens
β βββ π bookdetail
β β βββ π BookDetailScreen.kt
β β βββ π BookDetailViewModel.kt
β βββ π bookform
β β βββ π BookFormScreen.kt
β β βββ π BookFormViewModel.kt
β βββ π booklist
β βββ π BookListScreen.kt
β βββ π BookListViewModel.kt
βββ π ui
β βββ π theme
β βββ π Color.kt
β βββ π Theme.kt
β βββ π Type.kt
βββ π util
Architecture and Design Patterns
Clean Architecture
The application is structured in layers following Clean Architecture principles:
-
Presentation Layer: Implements MVVM (Model-View-ViewModel) pattern
- ViewModels handle presentation logic and UI states
- Immutable states using
UiState
for each screen - Independent and reusable Composables in Jetpack Compose
-
Domain Layer: Contains business logic
- Use Cases for each specific operation
- Domain models independent of data layer
- Repository interfaces to maintain dependency inversion
-
Data Layer: Handles persistence and data sources
- Room Database for local storage
- Repository implementations
- Mappers to convert between data and domain models
Implemented Technologies and Tools
-
Jetpack Components
- Room: Local data persistence
- Navigation: Single-activity navigation
- ViewModel: UI state and logic management
- Compose: Modern declarative UI
-
Dependency Injection
- Hilt for dependency injection
- Modules organized by functionality
- Appropriate scopes for each dependency
-
Coroutines and Flow
- Asynchronous operations with Coroutines
- Flow for reactive data streams
- StateFlow for UI states
App Preview


Implemented Best Practices
SOLID Principles
- Single Responsibility: Each class has a single responsibility
- Open/Closed: Use of interfaces to allow extensions
- Dependency Inversion: Dependencies toward abstractions
- Interface Segregation: Specific interfaces for each need
Design Patterns
- Repository Pattern: Abstraction of data sources
- Mapper Pattern: Conversion between data models
- Factory Pattern: Dependency creation in Hilt modules
Testing
- Architecture prepared for testing
- Separation of concerns that facilitates unit testing
- Independent and testable Use Cases
Data Flow
UI -> ViewModel -> UseCase -> Repository -> DataSource
- UI observes ViewModel states
- ViewModel executes Use Cases
- Use Cases coordinate with Repository
- Repository handles data using DataSources
- Changes flow back as immutable states
Application Features
- Book listing
- Book details
- Add/Edit books
- Book search
- Reading status
- Local persistence
Despite being a simple application in functionality, it demonstrates a robust implementation of modern Android architecture, following development best practices and maintaining clean, testable, and scalable code.