An elegant, modern Pokédex web app built with React, TypeScript, and Vite. Browse, search, and favorite Pokémon using a beautiful UI powered by the PokeAPI GraphQL endpoint.
- Pokémon List: Browse a grid of Pokémon with images and names.
- Detail View: Click a Pokémon to view stats, abilities, types, and description.
- Favorites: Mark Pokémon as favorites and view your favorites list.
- Sorting: Sort Pokémon by number or name.
- Responsive Design: Fully responsive and mobile-friendly.
- Modern UI: Clean, accessible, and visually appealing interface.
git clone https://github.com/jonenn/Pokedex.git
cd Pokedex
npm install
# or
yarn installnpm run dev
# or
yarn devOpen http://localhost:5173 in your browser.
npm run build
# or
yarn buildnpm run lint
# or
yarn lint- React 19
- TypeScript
- Vite
- React Router v7
- PokeAPI GraphQL
- CSS (custom, organized by atomic design)
src/
api/ # API calls and data fetching
assets/ # SVGs and static assets
components/ # React components (atoms, molecules, organisms, pages, templates)
graphql/ # GraphQL queries
styles/ # CSS, organized by atomic design
utils/ # Utility functions and types
App.tsx # Main app component
main.tsx # Entry point
- atoms/: Smallest UI elements (Button, Input, Label, etc.)
- molecules/: Combinations of atoms (Card, SearchBar, Abilities, etc.)
- organisms/: Complex UI sections (Header, AboutSection, StatsSection, etc.)
- pages/: Top-level route components (Home, Character, Favorites)
- templates/: Layout wrappers (MainTemplate, CharTemplate)
This app uses the PokeAPI GraphQL endpoint for all Pokémon data. See src/api/pokemon.ts and src/graphql/queries/ for details.
- src/App.tsx: Main router setup. Defines routes for Home, Character, and Favorites pages using React Router v7.
- src/api/pokemon.ts: Contains all data fetching logic. Uses async functions to fetch Pokémon lists and details via GraphQL queries.
- src/graphql/queries/: Stores GraphQL query strings for fetching Pokémon data.
- src/components/: Organized by atomic design. Atoms are basic UI, molecules are composed, organisms are complex sections, pages are route-level, templates are layout wrappers.
- src/utils/PokemonTypes.ts: TypeScript interfaces for Pokémon data shape.
- Uses React's built-in
useStateanduseEffectfor local state and side effects. - Favorites are persisted in
localStorageunder the keyfavoritePokemons. - No external state management library is used (Redux, Zustand, etc.).
- All data is fetched from the PokeAPI GraphQL endpoint.
- See
fetchAllPokemonsandfetchPokemonByIdinsrc/api/pokemon.tsfor usage examples. - Sorting is handled by passing variables to the GraphQL query.
- CSS is organized by atomic design in
src/styles/. - Uses CSS custom properties for theming and type colors.
- Each component imports its own CSS module.
- Uses React Router v7 for navigation.
- Main routes:
/— Home (Pokémon list)/pokemon/:id— Pokémon detail/favorites— Favorites list
- Create new components in the appropriate atomic folder.
- Add styles in the matching CSS folder.
- Update routing in
App.tsxif needed. - For new data, add queries in
src/graphql/queries/and fetching logic insrc/api/pokemon.ts.
- Lint with
npm run lint(ESLint + TypeScript rules). - No test suite is included by default. Add tests as needed (suggested: React Testing Library + Jest).
- Use the
typeColorsutility for consistent Pokémon type coloring. - To persist new user data, use
localStorageor add a backend. - For SVGs, import from
src/assets/and use as React components or image sources.