How ayan-bain/pokedex-coding_club works
Project Type and Purpose
• This is a React Native (Expo) mobile application named “Kanto PokeDex.”
• Its sole responsibility is to provide a user-friendly interface for browsing, searching, and marking Pokémon as captured or encountered.
• There is no custom backend—data is fetched on-demand from external services (e.g., the public PokeAPI), and client state is held in context.
File Structure Analysis
Top level
• App.js & index.js: Application entry points (register root component, wrap navigation & providers).
• package.json / package-lock.json / eas.json: Dependencies, build & deployment configs.
• assets/: Static resources (fonts).
Logic & UI
• components/: Reusable UI pieces (CustomButton, PokemonCard, SearchHeader).
• screens/: View containers corresponding to app routes (HomeScreen, SearchScreen, CapturedScreen).
• services/: Business-logic and side-effects
– PlayPokemonCry.js: Audio playback utility
– PokeDexContext.js: React Context provider managing global state (list of Pokémon, captured state)
– usePokedex.js: Custom hook to fetch from PokeAPI and interact with the context
Key README Insights
• Describes primary features: browsing info, search & filter, capture/encounter toggles.
• No built-in backend; runs entirely in Expo.
• Mentions prerequisites (Node, expo) and usage (npx expo start).
a. Main Components
1. Mobile App Shell (React Native / Expo runtime)
2. Navigation Layer (React Navigation inside App.js)
3. Screens (Home, Search, Captured)
4. UI Components (PokemonCard, CustomButton, SearchHeader)
5. State Layer (PokeDexContext Provider)
6. Services Layer (usePokedex hook, PlayPokemonCry)
7. External Service (PokeAPI)
8. Assets (fonts & images)
b. Interactions & Data Flow
• App Shell initializes Context Provider →
Context wraps Navigation →
Screens subscribe to Context & call usePokedex →
usePokedex issues HTTP requests to PokeAPI →
Response populates context state →
Screens render UI Components with data →
PlayPokemonCry invoked when user clicks a sound button.
c. Architectural Patterns
• Container–Presentational split: Screens are containers managing data; components purely render UI.
• Context + Custom Hook = centralized state + data-fetch logic.
• Single Page App paradigm transported to mobile via React Navigation.
d. Technologies & Frameworks
• React Native / Expo
• React Navigation (implied)
• React Context API + Custom Hooks
• Native Modules for audio (expo-av or similar)
• Public REST API (PokeAPI)
Final Advice
• Notes on caching or local state where relevant.