Frontend Movie Search Task: Patrick Alvarez #678
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This frontend technical task required creating a simple movie search application that had 2 views:
The movie data should be retried from TheMovieDb using their API.
Requirements: Included using React and TypeScript, and implementing at least one component test.
You can see a live version here: https://mews-movies-kappa.vercel.app/
Implementation
Technologies Used:
Required Features:
1. Search
Implemented Search input bar that handles the search using a debounced callback function that waits to execute after the the user stops typing.
2. Paginated List
The paginated lists is implemented by implementing a infinteQuery to return a paginated list. Rather than implementing a paginated list with a numbered page system or some kind of load more button, I decided that displaying the list of movies in an infiniteList that automatically fetched the next page on scroll down was a better UI solution.
3. Movie Detail
I created a seperate page using next js' file-based routing so that the route would be /[movieId] where the movieId is that of the movie in the api. When a user heads to that page, the movieId is extracted from the url and is then used to fetch the movie details from the api.
4. Tests
Considering this was a small application and not for production use, I was asked to at least to implement some tests to show that I could use the. I created unit tests for the MovieCard and SearchBar components. Obviously, this app is sorely missing many many more tests...