An Android library management system built with Kotlin and Jetpack Compose. It supports two primary user roles (Admin and Student) and provides features to issue, return, browse, and manage books and groups. The app follows MVVM architecture with a clean separation between UI, ViewModel, Repository, and Network layers.
https://drive.google.com/file/d/1vNoGu8N-258wvgZ07wkjAlW-CXdckzbW/view?usp=sharing
https://drive.google.com/file/d/1jxslBnjLsBxSr7Zx_MlUYGd-Cv5uYtE4/view?usp=sharing
- Admin
- Issue Book: Select borrower (User/Group), pick a book, choose a date (limited from 1 month ago to today), and issue.
- Return Book: Two-step flow with a bottom sheet showing a complete summary and fines before confirming the return. Supports marking a book as missing and specifying damage level. Post-confirm, inputs reset.
- Groups: List and create groups.
- Logout FAB: Visible on most tabs except Return Book and Create Group to keep the UI focused.
- Student
- Browse: Explore available books.
- Borrowings: View current and past borrowings.
- Language: Kotlin
- UI: Jetpack Compose (Material 3)
- Architecture: MVVM (+ StateFlow)
- Dependency Injection: Koin
- Networking: Retrofit
- Serialization: Kotlinx Serialization
- Date Picker Constraints
- All borrow/return dates are limited to the past month up to today.
- Return Book Flow
- Step 1: Validate and fetch fine summary.
- Step 2: A fully expanded Material 3 bottom sheet summarizes borrower, book, return date, damage, missing flag, and fine breakdown. The sheet has a scrollable body and fixed action buttons (Confirm Return/Close) for consistent visibility.
- After confirm, the sheet closes, the UI resets, and ViewModel state is cleared to avoid stale re-emissions.
- FAB Visibility
- The logout FAB in
HomeScreenis hidden for Admin onReturn BookandCreate Groupscreens, and onGroupstab.
- The logout FAB in
app/
src/main/java/com/example/librarymgtsys/
data/ # DTOs, request/response models
network/ # Retrofit services & interceptors
transaction/
repository/ # Repository layer
ui/
navigation/ # Bottom nav items
screens/
HomeScreen.kt # Root scaffold with bottom nav & FAB
tabs/
admin/
IssueBookScreen.kt
ReturnBookScreen.kt
GroupListScreen.kt
CreateGroupScreen.kt
student/
BrowseScreen.kt
BorrowingsScreen.kt
util/ # SharedPrefs, enums (BorrowType, UserRole)
viewmodel/ # ViewModels (MainViewModel, TransactionViewModel)
- UI (Compose) renders state and dispatches user actions.
- ViewModel (StateFlow) exposes state and orchestrates use cases.
- Repository mediates between ViewModel and network.
- Network via Retrofit; DTOs serialized with Kotlinx Serialization.
- Open the project in Android Studio (Giraffe or newer recommended).
- Ensure you have:
- Android Gradle Plugin compatible with your Android Studio
- JDK 17 (recommended for latest AGP)
- Sync Gradle.
- Build and run on an emulator or device (Android 8.0+ recommended).
- Network endpoints are defined in Retrofit service interfaces (e.g.,
TransactionApiService). - If you use a backend requiring an API key or base URL change, add/build config fields or environment-based flavors as needed.
ui/screens/tabs/admin/IssueBookScreen.kt- Borrower selection (User/Group), book selection, and date picker with constraints.
ui/screens/tabs/admin/ReturnBookScreen.kt- Two-step return flow with a bottom sheet summary and confirmation.
- Supports marking a book as missing and setting damage level.
viewmodel/TransactionViewModel.kt- Exposes
issueBookStateandreturnBookState. - Includes
clearReturnBookState()to reset state after handling success/error.
- Exposes