Check out the repo
npm install
# or yarn/pnpm install
# run in developer mode - localhost:3000
npm run dev
# run the production build
npm run build
# Serve the production build - localhost:3000
npm start
Ensure your system is running node >= 18.17
If you have nvm run something like nvm use 18.17
or higher.
npm run dev
# or
npm run build-start
- Styling is achieved with Tailwind for rapid developement. Uusally I would prefer regular css.
- When starting the dev or prod build
http://localhost:3000
will be directed tohttp://localhost:3000/pokemon
- The infinite Scroll is handled using TanStack Query. I didnt have time to implemnet a virtualised list but this would be the prefered approach for better performance. The
useInfiniteQuery
hook returns the results as page chunks containing a property ofnextPage
which can be fetched when you get to the bottom of the list. I usedreact-intersection-observer
for this. - The
PokemonList
renders a list of Pokemon cards from the search results. - The page is fully mobile-first/responsive.
- You are able to search by
Name
,Type
andAbility
via the dropdown in the search panel.- Currently it searches and filters only the available pokemon - ie only the ones that have already been fetched rathe rthat querying the API by Name etc. This is beacuse Poke API does not allow for fuzzy searching - to get a vaild response you would need to type the name exactly which means rapid user feedback on search reults is hard. I decided to go with the option provided for the sake of time.
- Virtualised list.
- A better solution for querying the API by name / attribute.
- Tests