Documentation Index
Fetch the complete documentation index at: https://mintlify.com/soymatudev/Pokedex-Fleek/llms.txt
Use this file to discover all available pages before exploring further.
Overview
PokéDex Fleek follows a feature-based architecture that separates concerns and promotes code reusability. The project is built with React Native and Expo, using modern patterns for navigation, state management, and service abstraction.Feature-Based Folder Structure
The application is organized around domain features rather than technical layers:Directory Breakdown
api/
api/
Contains API clients and type definitions for external services like PokéAPI. This layer handles all HTTP requests and data transformation.
features/
features/
Each subdirectory represents a distinct user feature:
- intro/: Welcome screen and onboarding flow
- home/: Main dashboard with navigation options
- pokedex/: Pokémon list and detail views
- scanner/: Camera-based color detection and AI integration
services/
services/
Pure utility functions with no UI dependencies. Examples:
- ColorService: Euclidean distance calculations
- ColorConverter: Hex to RGB/HSL transformations
- AudioService: TTS voice narration logic
hooks/
hooks/
Custom React hooks that act as a service layer between features and utilities. They encapsulate business logic and provide reusable state management.
Navigation Setup
The app uses React Navigation 7 with a native stack navigator for iOS and Android.AppRouter Implementation
src/navigation/AppRouter.js
Screen Flow
- Intro: Onboarding screen (headerless)
- Home: Main dashboard with feature access
- Scanner: Camera-based Pokémon detection
- PokedexList: Browse all available Pokémon
- Details: Individual Pokémon information with TTS narration
Data Flow
The application follows a unidirectional data flow pattern:Example Flow: Color Detection
- ScannerScreen (UI) captures camera frame
- hexToHue (Service) converts color to HSL
- ColorService.getDistance calculates Euclidean distance
- POKEMON_DB (Data) returns matching Pokémon
- Navigation pushes to DetailsScreen
State Management
The project uses Zustand for global state management, keeping local state in components via
useState when appropriate.State Categories
- Local State: Camera permissions, loading indicators, UI toggles
- Shared State: User preferences, cached Pokémon data, detection history
- API State: Fetched data from PokéAPI with loading/error states
Key Design Patterns
Feature Isolation
Each feature is self-contained with its own components, logic, and assets. Changes to one feature don’t affect others.
Service Layer
Custom hooks abstract business logic from UI components, making them easier to test and reuse.
Pure Functions
Services contain pure functions with no side effects, ensuring predictable behavior and testability.
Component Composition
Atomic components are composed into larger features, promoting reusability and consistency.
Performance Considerations
- Lazy Loading: Screens are loaded on-demand via React Navigation
- Memoization: Heavy computations (color distance) are memoized
- Native Modules: Camera and TensorFlow run on native threads
- Frame Processors: Use Worklets for 60fps camera processing
Next Steps
Color Matching
Learn how the Euclidean distance algorithm maps colors to Pokémon
AI Detection
Explore TensorFlow.js integration and frame processing