TV show search and watchlist
Search TV shows with the free TVMaze API, see details and cast, and keep a personal watchlist.
Beginnerâą 6â10 hoursđĒ 7 stepsReactViteTVMaze API
What you'll learn
- âComponents, props and state
- âuseEffect for data fetching
- âRouting with React Router
What you'll build
- âDebounced search
- âShow detail page with cast and episodes
- âWatchlist saved in localStorage
- âLoading skeletons and error states
Step-by-step guide
- 1
Set up
npm create vite@latest shows -- --template react; npm i react-router-dom.
- 2
Search
Fetch https://api.tvmaze.com/search/shows?q=... ; debounce typing by 400 ms with setTimeout in useEffect (clear it in the cleanup).
- 3
Results grid
A ShowCard component (image, name, rating, genres); strip HTML from summaries.
- 4
Detail route
Route /show/:id fetching /shows/:id?embed[]=cast&embed[]=episodes; read id with useParams.
- 5
Watchlist
A custom hook useLocalStorage(key, initial) and a context so any component can add/remove shows.
- 6
States
Skeleton cards while loading; a friendly message for no results or network errors.
- 7
Deploy
npm run build and deploy the dist folder to Netlify or Vercel (add a SPA redirect rule).
đ Make it stand out
- +Mark episodes as watched
- +Infinite scroll for popular shows
- +Write tests with Vitest and React Testing Library