Skip to content

pwnjeswani/LibraryMgtSys

Repository files navigation

LibraryMgtSys

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.

Demo for mobile app with dummy data ->

https://drive.google.com/file/d/1vNoGu8N-258wvgZ07wkjAlW-CXdckzbW/view?usp=sharing

APK file to download ->

https://drive.google.com/file/d/1jxslBnjLsBxSr7Zx_MlUYGd-Cv5uYtE4/view?usp=sharing

Features

  • 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.

Tech Stack

  • Language: Kotlin
  • UI: Jetpack Compose (Material 3)
  • Architecture: MVVM (+ StateFlow)
  • Dependency Injection: Koin
  • Networking: Retrofit
  • Serialization: Kotlinx Serialization

Notable UX Details

  • 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 HomeScreen is hidden for Admin on Return Book and Create Group screens, and on Groups tab.

Project Structure

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)

Architecture

  • 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.

Setup & Run

  1. Open the project in Android Studio (Giraffe or newer recommended).
  2. Ensure you have:
    • Android Gradle Plugin compatible with your Android Studio
    • JDK 17 (recommended for latest AGP)
  3. Sync Gradle.
  4. Build and run on an emulator or device (Android 8.0+ recommended).

Configuration

  • 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.

Key Files

  • 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 issueBookState and returnBookState.
    • Includes clearReturnBookState() to reset state after handling success/error.

About

Library Management System – Android App Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages