This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
- Home Page with all 1302 pokemon's names rendered (Click the magnifying glass to see details)
- Individual page for Pokemons (with navigation back to main page and buttons to add to/remove from roster)
- Roster sidebar allowing for up to 6 pokemons (names on the roster can also be clicked to navigate to the pokemon's page for easier deletion)
All data in this assignment has been fetched from https://pokeapi.co/, including the sprite images. For the rendering of sprite images, the "front_default" image URL was used.
- For the Pokemon Search Bar, the client component, "Search Bar", was used to dynamically render the search results as the user types. Since there was a need to render the server-side component, "PokemonData" (responsible for fetching the list of all pokemon names on the home page), the server component was passed as a child to the client component, following the composition pattern outlined at https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns.
- To keep Roster data, a global react Context called "RosterContext" is used to track the team's state.