App Development Documentation
Project Setup
This project is an Android app written in Kotlin, built with Gradle.
Tech Stack (overview)
- Kotlin (Android)
- Gradle build system
- Jetpack components (ViewModels)
- Room (local persistence)
- Retrofit (remote API calls)
Codebase Structure (high level)
JabaApplication.kt: Application entry point (app-wide initialization).MainActivity.kt: Main Android activity hosting the UI.data/local/: Room database layerBookDatabase.kt: Room database definitiondao/: Data access objects (e.g.,BookDao.kt,ShelfDao.kt)entity/: Room entities and relations (e.g.,BookEntity.kt,ShelfEntity.kt,ReadingEntryEntity.kt,BookShelfCrossRef.kt,BookWithHistory.kt)Converters.kt: Room type converters
remote/: Networking layerOpenLibraryApi.kt: Retrofit API interfaceRetrofitClient.kt: Retrofit client configurationDto.kt: Network DTOs
repository/: Repository abstraction (e.g.,BookRepository.kt) that coordinates local/remote data sourcesdatastore/: DataStore persistence for simple settings/state (e.g.,CheckInDataStore.kt)
ui/AppViewModel.kt,ViewModelFactory.kt: Shared application state and ViewModel wiringscreens/: Screen-specific UI + ViewModels (e.g.,LibraryScreen.kt,BookDetailsScreen.kt,AddBookScreen.kt, etc.)components/: Reusable UI components (e.g.,GlobalSearchBar.kt)theme/: UI theme definitions (Color.kt,Theme.kt,Type.kt)
utils/: Helpers such asBarcodeUtils.kt,ConnectivityObserver.kt
Build \& Run (local)
- Open the project root in Android Studio.
- Ensure the Android SDK is configured for the IDE and a device/emulator is available.
- Configure GitHub username and password (process described at the top of the index page of our documentation).
- Sync Gradle (imports the Android/Gradle configuration).
- Run the
appconfiguration (launchesMainActivity).
Data \& Persistence
- Books, shelves, and reading history are stored locally via Room (
data/local/**). - Remote lookups are performed via Retrofit (
data/remote/**) against the OpenLibrary API. - Data access is routed through
data/repository/BookRepository.ktto keep UI and storage decoupled.
Entity Relationship Diagram
erDiagram
BOOKS ||--o{ READING_ENTRIES : "has"
BOOKS ||--o{ BOOK_SHELF_CROSS_REF : "belongs_to"
SHELVES ||--o{ BOOK_SHELF_CROSS_REF : "contains"
BOOKS {
string isbn PK
string title
string author
string coverUrl
int pages
string attachedFileName
string attachedFileType
}
READING_ENTRIES {
long id PK
string bookIsbn FK
string status
int rating
string review
long startDate
long finishDate
}
SHELVES {
long id PK
string name
}
BOOK_SHELF_CROSS_REF {
string isbn FK
long shelfId FK
}