Skip to content

An offline-first Android app built with Kotlin and Jetpack Compose

License

Notifications You must be signed in to change notification settings

DonghanX/nowinmtg

Repository files navigation

Now in MTG

screenshots_nowinmtg

Now in MTG is an offline-first Android app built with Kotlin and Jetpack Compose.

Arthitecture

The Now in MTG app is structured in the recommended Modern APP Architecture, following Google's official architecture guidance.

Modularization

The Now in MTG app adapts the modularization strategies to better organize the project, allowing it to scale as new features are added. For more information, Check out the Google's android app modularization guidance.

To maintain dependencies in a scalable way, this app utilizes Gradle version catalogs (Google's version catalogs migration guidance) to manage the versions of dependencies and plugins, and organizes the multi-modules builds into reusable Gradle conventions plugins (Share build logic between subprojects - Gradle).

Module dependency graph

graph TD
  app --> search[:feature:search]
  app --> others[:feature: ...]

  subgraph feature modules
    others
    search
  end
  
  search --> :core:data
  search --> :core:design
  search --> othersCore[:core: ...]
  
  subgraph core modules
    othersCore
    :core:data
    :core:design
    :core:data --> :core:network
    :core:data --> :core:database
    :core:data --> :core:model
  end
Loading
Name Responsibilities
app Provides a entry point container that integrates the modules required for Now in MTG in the application level.
:feature:... Represents a modularized part of the app's functionality that corresponds to a screen associated with the UI components and the ViewModels. For example:
 :feature:randomcards - displays card gallery for random cards.
 :feature:sets - shows a list of MTG sets grouped by their released date
:core:domain Contains usecases and encapsulates logic that is reused by multiple feature modules.
:core:data Contains repositories that encapsulate the process of data fetching from both local and remote data sources.
:core:database Local data source using Room database for storage.
:core:database Remote data source using Ktor Client for making network requests and handling responses.
:core:model Model classes used throughout the app.
:core:design Base UI composables and resources used throughout the app.
:core:ui Specific UI composables used by feature modules. It is dependent on the :core:module to render the UI based on the target data type.

Tech stacks & Libraries

  • Kotlin
  • Coroutines Flow
  • Jetpack Libraries:
    • Jetpack Compose: Android’s recommended modern toolkit for building native UI
    • Navigation Compose: Navigate between composables while taking advantage of the Navigation component's infrastructure and features
    • Lifecycle Compose
    • Hilt: a dependency injection library that reduces the boilerplate of doing manual DI
    • Room Database
  • Ktor Client: An asynchronous Http Client built from the ground up using Kotlin and Coroutines by JetBrains
  • Kotlin Serialization
  • Coil: An image loading library for Android backed by Kotlin Coroutines
  • Spotless

Open APIs

  • Magic: The Gathering API for constructing restful APIs for Random Cards and Card Details features
  • Scryfall for constructing restful APIs for Sets-related features

Thanks

Inspired by Now in Android

About

An offline-first Android app built with Kotlin and Jetpack Compose

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages