Marketa Willis Mews Frontend Test #694
Open
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.
Movie Search Application
Overview
This project is a simple movie search application built for the Mews frontend developer task. The application allows users to search for movies and view detailed information about them. It features automatic search as you type, pagination for search results, and detailed movie information views.
Features
Technologies Used
Core Technologies
React
TypeScript
Vite: Optimized production builds and better developer experience with hot module replacement.
Routing & Data Management
TanStack Router: type-safe routing with search param support. Ideal for maintaining the application state in the URL. Search queries and pagination state are preserved during navigation and page refreshes.
TanStack Query: Handles data fetching, caching, and state management for API requests.
ky: A lightweight HTTP client based on the Fetch API that provides a simpler interface with better defaults, or refetching.
Data Validation
Styling & UI
Tailwind CSS: Utility-first CSS framework that speeds up development by providing predefined classes.
shadcn/ui: Solid foundation of accessible, elegant, pre-built components that can be customized within the codebase.
Key Implementation Details
Debounced Search: Search requests are debounced to avoid excessive API calls as the user types, improving performance and user experience.
URL State Management: Search queries and pagination state are stored in the URL, this allows:
Component Structure: Folder structure follows Bulletproof React. The main logic is in the MovieSearch component, which manages the search state and handles search input, pagination, and results display.
Demo
The app is deployed on Netlify, you can visit it on https://mews-test.netlify.app/
Getting Started
npm install
npm run dev
.env
file withVITE_BEARER_TOKEN
to rootBuild & Deployment
To build the application for production:
npm run build
This will create an optimized build in the
dist
directory that can be deployed to any static hosting service.