Skip to content

kaychyka17/Mini-TMDB-Browser

Repository files navigation

Mini-TMDB-Browser

A small Android app for browsing trending movies, searching, and managing favorites using the TMDB API.

API Setup

The app authenticates with TMDB using a v4 Access Token (Bearer token).

  1. Create a free account at themoviedb.org.
  2. Go to Settings → API and copy your API Read Access Token.
  3. Add it to local.properties in the project root (this file is git-ignored):
TMDB_ACCESS_TOKEN=eyJhbGciOiJIUzI1NiJ9...your_token_here
  1. Build and run. The token is read at build time via BuildConfig.TMDB_ACCESS_TOKEN.

Architecture

The project follows Clean Architecture with three layers:

UI → Domain → Data
  • Domain — Pure Kotlin. Use cases, domain models, and repository interfaces. No Android dependencies.
  • Data — Repository implementations, Ktor remote data source (TmdbApi), Room local cache, DTOs, and mappers. Depends on Domain only.
  • UI — Jetpack Compose screens, ViewModels, and UI state. Depends on Domain only.

Key libraries: Ktor (networking), Room (caching), Koin (DI), Coil (image loading), Navigation Compose.

Repositories follow an offline-first strategy: page 1 falls back to the Room cache on network error; subsequent pages are network-only.

Known Limitations & Tradeoffs

  • No Shared Element Transitions — The details screen prefers a backdrop image (different URL/resolution) over the list poster thumbnail, so a shared element transition between the list and details would only work when backdrop data is missing. This inconsistency was deemed worse than no transition, so standard slide animations are used instead.
  • Destructive Room migrationsfallbackToDestructiveMigration is used. Schema changes will clear the local cache. Acceptable for a cache-only database, but not suitable if Room ever stores user data beyond favorites.
  • English-only — All strings are externalized to strings.xml and ready for localization, but only an English values/ resource is provided.
  • No pagination cache — Only page 1 of trending results is cached locally. Scrolling to later pages requires a network connection.
  • Error messages from the domain layer are not localizedNetworkError carries English default messages. The UI layer could map error types to stringResource calls for full localization but currently passes the domain message through.

Deep Link — Implementation Note

The task mentioned adding an "Open in TMDB" deep link from details. I wasn't entirely sure what "deep link" meant in this context — whether it referred to opening the TMDB website from the app, or opening the app from a TMDB website link. Since I understand both concepts, I implemented it both ways:

  1. App → Website: An "Open in TMDB" button on the movie details screen launches the browser to https://www.themoviedb.org/movie/{id}. Uses Intent.createChooser() to avoid the link looping back into the app.
  2. Website → App: An intent filter in the manifest intercepts https://www.themoviedb.org/movie/* URLs and opens the corresponding movie details screen in the app. The movie ID is parsed from the URL slug (e.g. /movie/1159559-scream-71159559).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages