Skip to content

rixitgithub/pokedex-caviustech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Pokรฉdex - Cavius Technologies

Image 1 Image 2 Image 3

๐Ÿ“ธ Screenshots

Pokemon Types Grid
Explore diverse Pokรฉmon types with our intuitive grid layout featuring sprite animations and type indicators
Pagination System
Navigate through generations with our smooth pagination system - 151 Pokรฉmon per page
Search and Filters
Advanced search with multiple filters: type, generation, stats, and abilities
Pokemon Details
Comprehensive Pokรฉmon profile with stats, moves, types, and collectible items
Moves Categories
Browse all move categories: Physical, Special, Status - with detailed filtering by type, power, and effects
Types Overview
Complete type catalog showcasing all 18 Pokรฉmon types, dual-type combinations, and type matchups

๐ŸŒŸ Target Audience

Our project caters to three primary user groups:

  1. Pokรฉmon Enthusiasts - Casual users exploring Pokรฉmon data
  2. Frontend Developers - Learning React/TypeScript best practices
  3. Open Source Contributors - Looking to enhance a real-world project

๐Ÿงฉ Core System Architecture

graph TD
    A[PokeAPI] --> B[Network Layer]
    B --> C[State Management]
    C --> D[UI Components]
    D --> E[User Interactions]
    E --> B
Loading

๐Ÿ› ๏ธ Technology Stack

Core Foundation

Technology Purpose Version
React Component-based UI Architecture 18.2
TypeScript Type Safety & Code Quality 4.9
Vite Ultra-Fast Build Tooling 4.0
React Router Client-Side Navigation 6.8

Advanced Features

  • Parallel Data Fetching: Promise.all() for concurrent API requests
  • Memoization: React.memo for performance optimization
  • Error Boundaries: Graceful error handling (WIP)

๐Ÿ“‚ Project Structure

src/
โ”œโ”€โ”€ components/       # Atomic Design Principles
โ”‚   โ”œโ”€โ”€ PokemonCard.tsx  # Card UI with hover effects
โ”‚   โ”œโ”€โ”€ TypeBadge.tsx    # Dynamic type styling
โ”‚   โ””โ”€โ”€ Navbar.tsx       # Responsive navigation
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ Home.tsx         # Grid layout with search
โ”‚   โ””โ”€โ”€ PokemonDetails.tsx # Deep dive view
โ”œโ”€โ”€ services/
โ”‚   โ””โ”€โ”€ pokeapi.ts       # API abstraction layer
โ”œโ”€โ”€ types/
โ”‚   โ””โ”€โ”€ pokemon.d.ts     # TypeScript interfaces
โ””โ”€โ”€ assets/
    โ””โ”€โ”€ styles/          # CSS Modular Architecture

๐Ÿ” Key Components

1. PokemonCard Component

Purpose: Display Pokรฉmon thumbnail information

Tech Highlights:

  • Prop Types Validation
  • Responsive image loading
  • Dynamic type coloring
interface PokemonCardProps {
  id: number;
  name: string;
  types: PokemonType[];
  sprite: string;
}

const PokemonCard: FC<PokemonCardProps> = ({ id, name, types, sprite }) => {
  // Component implementation
}

2. API Service Layer

Design Rationale: Centralized API calls with error handling wrapper

export const fetchPokemonDetails = async (id: string): Promise<Pokemon> => {
  try {
    const response = await fetch(`https://pokeapi.co/api/v2/pokemon/${id}`);
    if (!response.ok) throw new Error('API Error');
    return await response.json();
  } catch (error) {
    console.error('Fetch error:', error);
    throw error;
  }
};

3. Type System Design

Why Interfaces? Strong typing for API responses and component contracts

interface Pokemon {
  id: number;
  name: string;
  types: Array<{
    slot: number;
    type: {
      name: PokemonType;
      url: string;
    };
  }>;
  // ...15+ additional fields
}

๐Ÿš€ Performance Optimizations

Batch Fetching

// Home.tsx - Fetch first 151 Pokรฉmon
const loadPokemon = async () => {
  const list = await fetchPokemonList(151);
  const details = await Promise.all(
    list.map(p => fetchPokemonDetails(p.name))
  );
  setPokemonList(details);
};

CSS Optimization Strategy

  • Minimal global styles
  • Component-scoped CSS
  • Hardware-accelerated animations
  • Responsive grid layout

๐Ÿ“ˆ API Design Decisions

Why PokeAPI?

  • Comprehensive Pokรฉmon data
  • Free & open API
  • Well-maintained documentation
  • Community support

Rate Limiting Strategy

  • Client-side caching (localStorage)
  • Request throttling
  • Error retry mechanism (WIP)

๐Ÿงช Testing Strategy

graph LR
    A[Unit Tests] --> B[Jest]
    B --> C[React Testing Library]
    D[E2E Tests] --> E[Cypress]
    F[Visual Tests] --> G[Storybook]
Loading

๐Ÿšง Development Setup

Environment Requirements

  • Node.js 16+
  • npm 8+
  • Modern browser (Chrome 100+ recommended)

Build Process

# Install dependencies
npm install

# Start dev server
npm run dev

# Production build
npm run build

# Preview build
npm run preview

Connect with Me

GitHub โ€ข LinkedIn โ€ข Email

๐Ÿ”ฌ Built by Rishit Tiwari for Cavius Technologies

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published