This is a clone app by HBO Max using React Native Expo
You'll need to install some Android emulator (Ex: Android Studio), or using Expo Go app
# Clone the repository
$ git clone https://github.com/mcosta21/hbo-max-react-native-clone
# Access the folder
$ cd hbo-max-react-native-clone
# Install the dependencies
$ yarn
# Launch the application
$ yarn start || yarn android || yarn ios
This app is getting the movies and series by The Movie Database (TMDB) API, so it needs a API Key to works.
However, I intercep all error requests when this key is not defined, and mock the data.
// services/themoviedb/index.ts
theMovieDbApi.interceptors.response.use((response) => {
return response;
}, (error) => {
const routeUrl = error.request.responseURL as string;
if(routeUrl.includes('https://api.themoviedb.org/3/movie/') ||
routeUrl.includes('https://api.themoviedb.org/3/tv/')) {
const id = routeUrl.match(patternId);
return { data: id === null ? dataFake.results[0] : dataFake.results.find(x => x.id === Number(String(id[0]).replace('?', ''))) }
}
return { data: dataFake };
});
Define the API Key on THEMOVIEDB_CLIENT_ID in .env file
Developed by Marcio Costa.