Skip to content

PatilParas05/ReadStack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

readstack banner

πŸ“š ReadStack

⚠️ This project is built purely for learning purposes. It is a hands-on Android application developed to practice and explore modern Android development concepts, architecture patterns, and Jetpack libraries.


πŸ“– About the Project

ReadStack is an Android app that allows users to search for books using the Google Books API, save their favorite books to a personal library, view detailed book information, and share favorite quotes as images. The project serves as a practical playground for learning and implementing modern Android development best practices.


πŸš€ Features

  • πŸ” Book Search β€” Search books by title, author, or keyword using the Google Books API
  • πŸ“„ Paginated Search Results β€” Load more results dynamically with pagination support
  • πŸ“š Personal Library β€” Add and manage your own reading list stored locally
  • πŸ—‘οΈ Swipe to Delete β€” Remove books from your library with a swipe gesture
  • πŸ“˜ Book Detail Screen β€” View full details including cover, author, page count, and description
  • 🌐 Open Book Preview β€” Launch book previews in a custom Chrome tab (in-app browser)
  • πŸ’¬ Quote Sharing β€” Write a favorite quote on a book card and share it as an image
  • πŸ“‘ Offline Support β€” Cached search results and library available without internet
  • πŸ”Œ Network Monitoring β€” Real-time connectivity detection with offline banner UI
  • πŸ”„ Background Sync β€” Periodic library sync via WorkManager (every 6 days, on Wi-Fi + charging)
  • πŸ”” Snackbar Tips β€” Contextual hints shown to the user (e.g., swipe-to-delete tip on first book)

πŸ—οΈ Architecture & Project Structure

The project follows Clean Architecture with a clear separation of concerns:

com.paraspatil.readstack
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ local/           # Room database: BookDao, BookEntity, SearchResultEntity
β”‚   β”œβ”€β”€ remote/          # Retrofit API: GoogleBookApi, DTOs, Mappers
β”‚   β”œβ”€β”€ repository/      # BookRepositoryImpl
β”‚   └── util/            # NetworkMonitor
β”‚
β”œβ”€β”€ domain/
β”‚   β”œβ”€β”€ model/           # Book domain model
β”‚   β”œβ”€β”€ repository/      # BookRepository interface
β”‚   └── util/            # NetworkResult sealed class
β”‚
β”œβ”€β”€ ui/
β”‚   β”œβ”€β”€ library/         # LibraryScreen, LibraryViewModel, BookCard, QuoteShareCard
β”‚   β”œβ”€β”€ details/         # BookDetailScreen, BookDetailViewModel
β”‚   └── theme/           # Material3 theme, colors, typography
β”‚
β”œβ”€β”€ navigation/          # AppNavigation, AppScreens (type-safe routes)
β”œβ”€β”€ di/                  # Hilt modules: AppModule, RepositoryModule, WorkManagerModule, DatabaseModule, NetworkModule
β”œβ”€β”€ workers/             # SyncWorker (WorkManager)
└── ReadStackApp.kt      # Hilt Application class

πŸ› οΈ Tech Stack & Libraries Used

Category Technology
Language Kotlin
UI Framework Jetpack Compose + Material 3
Architecture Clean Architecture + MVVM
Dependency Injection Hilt (Dagger)
Local Database Room (v2.6.1)
Networking Retrofit 2 + Kotlinx Serialization
Image Loading Coil (v2.4.0)
Background Work WorkManager (v2.9.0)
Navigation Jetpack Navigation Compose (v2.8.5) with type-safe routes
Async/Concurrency Kotlin Coroutines + Flow
In-App Browser AndroidX Browser (Custom Tabs)
JSON Parsing Gson + Kotlinx Serialization JSON
Icons Material Icons Extended
Build System Gradle Kotlin DSL + Version Catalog

🧠 What I Learned / Concepts Practiced

This project was built to explore and practice the following concepts:

  • βœ… Jetpack Compose β€” Building declarative UI with state hoisting, LaunchedEffect, collectAsState, and animated composables
  • βœ… MVVM + Clean Architecture β€” Separating UI, domain, and data layers with clear contracts via interfaces
  • βœ… Hilt Dependency Injection β€” Constructor injection, @HiltViewModel, @HiltWorker, and Hilt modules
  • βœ… Room Database β€” Defining entities, DAO with Flow, @Upsert, offline-first data access
  • βœ… Retrofit + Kotlin Serialization β€” Type-safe API calls with serialization converter
  • βœ… Kotlin Coroutines & Flow β€” StateFlow, callbackFlow, combine, map, stateIn, coroutine scopes
  • βœ… Offline-First Architecture β€” Caching search results in Room, serving local data when offline
  • βœ… WorkManager β€” Periodic background sync with constraints (network + charging)
  • βœ… Type-Safe Navigation β€” Using @Serializable sealed interface routes with Navigation Compose
  • βœ… NetworkMonitor β€” Real-time connectivity tracking using ConnectivityManager.NetworkCallback
  • βœ… Canvas & Graphics β€” Capturing a composable as a bitmap using GraphicsLayer to share as image
  • βœ… SwipeToDismiss β€” Implementing swipe-to-delete with SwipeToDismissBox
  • βœ… Custom Chrome Tabs β€” Opening URLs inside the app using AndroidX Browser
  • βœ… Pagination β€” Manual pagination with startIndex and maxResults for API calls

βš™οΈ Requirements

  • Android Studio Hedgehog or newer
  • Min SDK: 26 (Android 8.0)
  • Target SDK: 36
  • Kotlin: Latest stable
  • Internet permission required (for Google Books API)
  • A Google Books API Key (free) β€” Get one here

🚦 Getting Started

  1. Clone the repository
    git clone https://github.com/PatilParas05/ReadStack.git
  2. Open in Android Studio
  3. Sync Gradle dependencies
  4. Add your Google Books API Key
    • Go to app/src/main/java/com/paraspatil/readstack/data/remote/GoogleBookApi.kt
    • Find the API_KEY constant in the companion object
    • Replace the empty string with your key:
    const val API_KEY = "YOUR_API_KEY_HERE"

    πŸ”‘ Get a free API key from Google Cloud Console β†’ Enable Books API β†’ Create credentials

  5. Run on an emulator or physical device (Android 8.0+)

πŸ“ Key Files

File Description
ReadStackApp.kt Hilt Application class + WorkManager setup
MainActivity.kt Entry point, sets up Compose and navigation
AppNavigation.kt Navigation graph with type-safe routes
LibraryScreen.kt Main UI: library + search tabs, quote sharing
LibraryViewModel.kt State management, search, pagination, sync
BookRepositoryImpl.kt Data layer: API + Room + NetworkMonitor
BookDao.kt Room DAO: library and search result queries
SyncWorker.kt Background WorkManager sync worker
NetworkMonitor.kt Real-time network connectivity observer
GoogleBookApi.kt Retrofit API interface β€” add your API key here

🀝 Contributing

Contributions are welcome! Since this is a learning project, feel free to open issues or pull requests to suggest improvements, fix bugs, or add new features.


⚠️ Disclaimer

This project is created solely for educational and learning purposes. It is not intended for production use. The app uses the free Google Books API and does not store or transmit any personal user data.


πŸ‘¨β€πŸ’» Author

Paras Patil β€” @PatilParas05


Happy Reading & Happy Learning! πŸ“š

About

πŸ“š An Android app to search, save & manage your reading list β€” built with Kotlin, Jetpack Compose, Room, Retrofit, Hilt & WorkManager. Created for learning modern Android development.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages