Skip to content

MohammadAshrf/GameHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

61 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ GameHub โ€“ RAWG Games Browser App

Android Kotlin Compose Clean Architecture

A modern Android application to browse video games by genre using the RAWG API.

Built with modern Android stack and clean architecture principles.. The project is developed using Kotlin, Jetpack Compose, and follows Clean Architecture with the MVI (Model-View-Intent) pattern, demonstrating best practices in modularity, caching, and state management.


๐Ÿ“ฑ Screenshots

Home Screen Real-time Search Local Search
image image image

Game Details Trailer by ExoPlayer Game Details
image image image

Home Screen with Shimmer Wrong Search Screen Network Error Screen
image image image

โœจ Features

Based on the assignment brief requirements:

  • ๐ŸŽฎ Browse Games by Genre: Displays a paginated list of games that can be filtered by selecting different genres (Action, RPG, Strategy, etc.).
  • ๐Ÿ” Local Search: Instantly filter the already-loaded games in-memory without making additional API calls.
  • ๐Ÿ“„ Game Details: View comprehensive info for a selected game, including name, image, release date, rating, and description.
  • โšก Offline-First (Caching):
    • Automatically caches data locally using Room Database.
    • List Screen: Uses RemoteMediator to cache paginated results. When offline, users can still view previously loaded games.
    • Details Screen: Instantly loads basic game info from the local cache, then fetches the full description from the API in the background and updates the UI seamlessly.
  • ๐ŸŽจ Material Design 3: Modern, responsive UI implemented completely with Jetpack Compose.
  • ๐Ÿšฆ Robust State Handling: Clear visual states for Loading (Shimmer), Error (with Retry action), and Empty results.

๐Ÿ› ๏ธ Tech Stack & Libraries

This project uses the latest modern Android development tools:

Category Library/Tool
Language Kotlin
UI Framework Jetpack Compose (Material 3)
Architecture Clean Architecture + MVI
DI Koin
Network Ktor
Local Database Room Database
Async Coroutines & Flow
Pagination Paging 3 (Remote Mediator)
Image Loading Coil
Testing JUnit4, Mockk, Turbine, Compose UI Test
Build System Gradle (Version Catalogs - TOML)
Version Control Git Flow Workflow

โš™๏ธ Setup & Installation:

To run this project locally, follow these steps:

1. Prerequisites:

  • Android Studio Ladybug (or newer).
  • JDK 17 or higher.

2. Clone the Repository:

git clone [https://github.com/YOUR_USERNAME/GameHub.git](https://github.com/YOUR_USERNAME/GameHub.git)
cd GameHub

3. API Key Configuration ๐Ÿ”‘:

This project requires a RAWG API Key.

Register at RAWG.io.

Request an API Key.

Open the local.properties file in the root directory of the project (create it if it doesn't exist).

Add your key as follows:

API_KEY="your_api_key_here"

4. Build and Run:

Sync Project with Gradle Files.

Select the app configuration.

Run on an Emulator or Physical Device.


๐Ÿ” Local Search Strategy

  • Filters already fetched games in memory.
  • No additional API calls are made.
  • Works instantly.
  • Does not break pagination state.

This follows the assignment requirement to avoid extra API calls during search.


๐Ÿ“ฆ Offline Strategy

The app follows an Offline-First approach:

  • Games are cached in Room database.
  • On first load โ†’ fetch from API and save locally.
  • If network fails โ†’ show cached data.
  • RemoteMediator keeps local and remote data in sync.

๐Ÿงช Testing:

The project includes comprehensive testing strategies:

Unit Tests: Covers Repositories using Mockk and Turbine.

To run tests via terminal:

./gradlew testDebugUnitTest  # Run Unit Tests

๐Ÿค Git Flow

This project utilizes the Git Flow branching model:

main: Production-ready code.

develop: Integration branch for features.

feature/*: Individual features (e.g., feature/caching, feature/search).

release/*: Preparation for a new production release.


Made with โค๏ธ by Mohammad Ashrf To Bosta Team download