A modern, feature-rich Android application for browsing, searching, and purchasing books, built with Jetpack Compose. This app demonstrates best practices in UI/UX, state management, and modular architecture.
🎯 OVERVIEW
Welcome to Mahdi Shelf! 🌟
A sample library/bookstore app where you can:
- 📖 Browse a curated collection of books by category
- 🔍 Search, filter, and sort books
- 📝 View detailed information about each book
- 🛒 Add books to a shopping cart
- 👤 Register and onboard as a new user
- 💳 Complete a simulated checkout/payment process
Built with Jetpack Compose for a modern, declarative UI, and clean architecture principles.
🚀 FEATURES
- 🎬 Splash & Welcome Screens: Animated onboarding for first-time users
- 📝 User Registration: Simple registration form
- 🏠 Home/Library Screen:
- 🖼️ Book list with image slider, category filter, and sorting
- 🔎 Real-time search and filtering
- 📚 Book Details: Author, category, price, rating, and description
- 🛒 Cart: Add/remove books, update quantities, view total price
- 💳 Checkout/Payment: Simulated credit card payment with validation
- ⚡ State Management: ViewModel & Kotlin Flows
- 🎨 Material 3 Design: Modern, responsive UI with dark/light theme
🖼️ SCREENSHOTS
Add screenshots of the main screens here (Splash, Welcome, Library, Book Details, Cart, Payment)
🏛️ ARCHITECTURE
- 🧩 Jetpack Compose: Declarative UI
- 🏗️ MVVM: ViewModel for state and business logic
- 🔄 Kotlin Flows: Reactive state updates
- 🧭 Navigation: Compose Navigation for screen transitions
- 🧱 Modular Components: Reusable UI (BookCard, CategoryButtons, etc.)
📦 DATA MODELS
// Book.kt
data class Book(
val id: String,
val name: String,
val imageUrl: String,
val price: Int,
val category: Category,
val description: String,
val author: String = "",
val rating: Float = 0f,
val reviews: Int = 0
)
data class CartItem(
val book: Book,
val quantity: Int = 1
)
// Category.kt
enum class Category {
ALL, SCIENCE, FICTION, HORROR, HISTORY, ROMANCE, DRAMA, FANTASY, SCIENCE_FICTION
}🔧 SETUP & INSTALLATION
- Clone the repository:
git clone <repo-url> cd LiberaryApplication
- Open in Android Studio (Giraffe or newer recommended)
- Sync Gradle to download dependencies
- Run on emulator or device (minSdk 24, targetSdk 35)
- From Android Studio:
- Click
Runor useShift+F10
- Click
- From command line:
./gradlew :app:assembleDebug ./gradlew :app:installDebug
📚 DEPENDENCIES
- Jetpack Compose 🧩
- Material 3 🎨
- Navigation Compose 🧭
- Coil 🖼️ (image loading)
- Accompanist 🛠️ (system UI)
- Kotlin Coroutines & Flows 🔄
- JUnit, Espresso 🧪 (testing)
🗂️ FOLDER STRUCTURE
LiberaryApplication/
├── app/
│ ├── src/main/java/com/iliaxp/liberaryapplication/
│ │ ├── model/ # Data models (Book, Category, CartItem)
│ │ ├── ui/
│ │ │ ├── components/ # Reusable UI components
│ │ │ └── screens/ # App screens (Library, BookDetails, Cart, etc.)
│ │ ├── viewmodel/ # ViewModel and Factory
│ │ └── MainActivity.kt# App entry point
│ ├── res/ # Resources (drawables, layouts, values)
│ └── AndroidManifest.xml
├── build.gradle.kts # Project-level Gradle config
├── settings.gradle.kts # Project/module settings
└── ...
🤝 CONTRIBUTING
Contributions are welcome! Please open issues or pull requests for bug fixes, features, or improvements.
- 🍴 Fork the repo
- 🌱 Create a feature branch (
git checkout -b feature/your-feature) - 💾 Commit your changes
- 🚀 Push and open a PR
📝 LICENSE
This project is licensed under the MIT License. See LICENSE for details.