Skip to content

mcosta21/hbo-max-react-native-clone

Repository files navigation

HBO Max Clone

This is a clone app by HBO Max using React Native Expo

Screenshots

Run yourself

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

Getting data

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

Technologies

React Native    Expo    Styled Components    Axios    TMDB



Developed by Marcio Costa.