A simple Pokédex built using the Pokémon API.
- Lists all current Pokémon.
- Filterable by generation.
- Stats for each Pokémon are listed.
- Comparisons allowing the user to compare up to three Pokémon's stats with a graph for visualisation.
- Ability to favourite various Pokémon so you can view their stats quicker without searching through.
- Download Repository as a
.zipor rungit clone https://github.com/mac-h95/pokedex. - Change into the repositories directory and run
npm ioryarn. - Run the application using
npm run startoryarn start.
- I utlised SWR for fetching data, this would allow me to grow the application smoother if I were to add more user interface changes.
- Feather Icons is a convenient library for React icons taken from feather.
- I used a chart rendering library to display comparisons of stats for various Pokémon.
-
I didn't realise the main api url that lists Pokémon would only contain the url, name and id initially so had to figure out a solution for also fetching the Pokémon's stats and sprite.
-
I noticed towards the end of building the app that the
/generationsendpoint contained aspecieskey which contained all of the Pokémon for that generation, had I noticed earlier I would not have hard-coded the generation names, this would be an update I would make if this was a long term project. That way instead of having to manually add, I could run amap()function along the generations which then fetched the Pokémon for that generation. In order to keep within the 4 days set by the challenge I will not add this on here. -
I had an issue adding types to the app context where it would result in an
unexpected end of JSON.
If this where a long term project I would consider adding the following features:
- Better implimentation of typescript.
- A type strength vs. weakness e.g.
fire > grass > water < electricso you know what kind of Pokémon to use against others.