A modern, feature-rich Pokédex application built with Next.js 15, featuring user authentication, favorites system, advanced search, and comprehensive Pokemon details.
- Paginated Pokemon List - Browse through 1300+ Pokemon with smooth pagination
- Advanced Search - Debounced search with case-insensitive matching
- Type Filtering - Filter Pokemon by any of the 18 types
- Detailed Pokemon View - Comprehensive stats, abilities, types, and artwork
- Secure Registration/Login - Email/password authentication with Better Auth
- Session Management - Persistent login sessions with automatic cleanup
- Protected Routes - Seamless authentication flow with redirect preservation
- Personal Collection - Save favorite Pokemon to your personal list
- Optimistic UI - Instant visual feedback with background persistence
- Dedicated Favorites Page - View and manage your collection with pagination
- Cross-Page Sync - Favorite status consistent across all pages
- Responsive Design - Perfect on desktop, tablet, and mobile
- Dark Mode Support - System-aware theme switching
- Loading Skeletons - Professional loading states
- Error Handling - Graceful error recovery with helpful messages
- Smooth Animations - Micro-interactions and hover effects
- Next.js 15.5.3 - Latest React framework with App Router
- React 19.1.0 - Latest React with concurrent features
- TypeScript - Type safety and developer experience
- Tailwind CSS - Utility-first CSS framework for rapid development
- CSS Modules - Component-scoped styling
- Responsive Design - Mobile-first approach with breakpoints
- tRPC 11.5.1 - End-to-end typesafe APIs
- React Query - Powerful data fetching and caching
- Zod - Schema validation and type inference
- Prisma 6.16.1 - Next-generation ORM with type safety
- SQLite - Lightweight database for development
- Better Auth - Modern authentication solution
- PokéAPI - Comprehensive Pokemon data source
- RESTful Integration - Efficient data fetching and caching
- Node.js 18+
- npm, yarn, or pnpm
- Clone the repository
git clone <repository-url>
cd pokedex-starter- Install dependencies
npm install
# or
yarn install
# or
pnpm install- Set up the database
npx prisma db push- Start the development server
npm run dev
# or
yarn dev
# or
pnpm dev- Open the application Visit http://localhost:3000 in your browser.
- Click "Register" in the navigation bar
- Fill in your email and password (minimum 6 characters)
- After registration, you'll be automatically logged in
- Use "Login" for returning users
- Browse: Use pagination to explore all Pokemon
- Search: Type Pokemon names in the search bar (debounced for performance)
- Filter: Use the "Filter By" dropdown to filter by type
- Details: Click any Pokemon card to view detailed information
- Add to Favorites: Click the heart icon on any Pokemon card or detail page
- Remove from Favorites: Click the filled heart icon to remove
- View Collection: Click "Favorites" in the navigation (requires login)
- Authentication: Non-logged users are prompted to login and returned to their previous context
- High-Quality Artwork: Official Pokemon artwork
- Comprehensive Stats: HP, Attack, Defense, Sp. Attack, Sp. Defense, Speed
- Type Information: Color-coded type badges
- Abilities: Including hidden abilities
- Physical Stats: Height and weight in metric units
- Base Experience: Training value
src/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ ├── favorites/ # Favorites page
│ ├── login/ # Authentication pages
│ ├── pokemon/[name]/ # Dynamic Pokemon detail pages
│ └── page.tsx # Home page
├── components/ # Reusable React components
│ ├── favorite-button.tsx
│ ├── navigation.tsx
│ └── providers.tsx
├── lib/ # Utility libraries
│ ├── auth.ts # Authentication configuration
│ ├── auth-client.ts # Client-side auth hooks
│ └── db.ts # Database connection
├── server/ # Server-side code
│ └── api/ # tRPC routers
│ ├── routers/ # API route handlers
│ └── root.ts # API router configuration
└── utils/ # Shared utilities
└── trpc.ts # tRPC configuration
- Why: End-to-end type safety from backend to frontend
- Benefits: Eliminates API documentation needs, catches errors at compile time
- Usage: Pokemon data fetching, favorites management
- Why: Type-safe database operations with excellent developer experience
- Benefits: Auto-generated types, migration management, query optimization
- Usage: User management, favorites storage
- Why: Modern, secure authentication with minimal setup
- Benefits: Built-in security best practices, session management
- Usage: User registration, login, session handling
- Why: Powerful caching, background refetching, optimistic updates
- Benefits: Automatic loading states, error handling, cache invalidation
- Usage: Pokemon API calls, favorites synchronization
- Why: Runtime type validation with TypeScript integration
- Benefits: API input validation, type inference
- Usage: Form validation, API schema definition
getList- Paginated Pokemon list with search and type filteringgetByName- Individual Pokemon details by name
add- Add Pokemon to user favoritesremove- Remove Pokemon from favoritesisFavorited- Check if Pokemon is favoritedgetUserFavorites- Get user's favorite Pokemon with paginationgetFavoritesCount- Get total favorites count
- Registration, login, logout, session management
- Source: PokéAPI (https://pokeapi.co/)
- Caching: React Query for client-side caching
- Processing: Server-side data transformation and optimization
- Delivery: tRPC for type-safe data transfer
- Registration/Login: Better Auth handles secure authentication
- Session: Persistent sessions with automatic refresh
- Protection: Route-level authentication with redirect preservation
- Optimistic Updates: UI updates immediately
- Background Sync: API calls persist changes
- Cache Invalidation: Automatic data refresh across pages
- Real-time Sync: Consistent state across all components
- Code Splitting: Automatic route-based splitting
- Image Optimization: Next.js automatic image optimization
- Caching Strategy: React Query with intelligent cache invalidation
- Debounced Search: 300ms delay prevents excessive API calls
- Batch Requests: Multiple Pokemon details fetched in parallel
- Database Indexing: Optimized queries for favorites
- Response Caching: Efficient data transformation
- Loading Skeletons: Perceived performance improvement
- Optimistic UI: Immediate feedback for user actions
- Error Boundaries: Graceful error handling
- Advanced Filtering: Multiple simultaneous filters
- Pokemon Comparison: Side-by-side stat comparison
- Team Builder: Create and manage Pokemon teams
- Battle Calculator: Type effectiveness and damage calculation
- Social Features: Share favorites and teams
- Offline Mode: PWA capabilities for offline browsing
- Database Migration: PostgreSQL for production
- Image CDN: Optimized Pokemon image delivery
- Search Enhancement: Elasticsearch for advanced search
- Analytics: User behavior tracking
- Testing: Comprehensive test suite
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PokéAPI - Comprehensive Pokemon data
- Next.js Team - Amazing React framework
- Tailwind CSS - Utility-first CSS framework
- tRPC Team - Type-safe API development
- Prisma Team - Modern database toolkit
Built with ❤️ using modern web technologies