How cowglow/pokemon-api-ui works
This is a Pokémon catalog and collection web app. Users browse and search Pokémon, select one for detail views, and add or remove Pokémon from a locally persisted collection; settings manage the user name and onboarding state. The graph follows the documented-by-source Redux/Saga state and persistence structure. Several view components and saga wiring were not excerpted, so those feature branches are included from the source index, while uncertain connections are omitted.
Main entry points: App.tsx App shell and routes · collection.ts Collection state · PokemonsPage.tsx Pokémon page · pokemons.ts Catalog state
Components 29
App and pages
- App shell and routes
src/App.tsx - Pokémon page
src/pages/PokemonsPage.tsx - Collection page
src/pages/CollectionPage.tsx - Settings page
src/pages/SettingsPage.tsx - Shared layout
src/ui/Layout.tsx
Catalog experience
- Searchable catalog
src/components/PokemonList.tsx - Selected Pokémon detail
src/components/SelectedPokemon.tsx - Detail views
src/components/PokemonDetailTabs.tsx - Collection cards
src/components/PokemonCollectionCard.tsx - Add to collection
src/components/Fab/AddToCollection.tsx - Remove dialog
src/components/RemoveFromCollectionDialog.tsx - Onboarding
src/components/OnboardingDialog.tsx - Settings form
src/components/PokemonForm.tsx
State and orchestration
- Catalog state
src/redux/reducers/pokemons.ts - Collection state
src/redux/reducers/collection.ts - User state
src/redux/reducers/user.ts - Redux store
src/redux/store-config.ts - Fetch catalog
src/redux/saga-handlers/fetchPokemonsHandler.ts - Fetch detail
src/redux/saga-handlers/fetchPokemonDetailHandler.ts - Collection sync
src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts - User sync
src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts - Onboarding sync
src/redux/saga-handlers/syncUserSkippedToLocalStorageHandler.ts
Local persistence
- Collection storage
src/lib/collection-storage.ts - User storage
src/lib/user-storage.ts
Pokémon data
- Catalog API model
src/types/pokemon.ts - Detail data model
src/lib/PokemonType.ts - Detail normalization
src/lib/create-pokemon.ts
Other components
- User
- Pokémon API
Connections 43
- User → App shell and routes: opens
- App shell and routes → Shared layout: renders
src/App.tsx - App shell and routes → Pokémon page: routes to
src/App.tsx - App shell and routes → Collection page: routes to
src/App.tsx - App shell and routes → Settings page: routes to
src/App.tsx - App shell and routes → Catalog state: starts fetch
src/App.tsx - App shell and routes → Collection storage: loads collection
src/App.tsx - App shell and routes → Collection state: hydrates
src/App.tsx - App shell and routes → User storage: loads preferences
src/App.tsx - App shell and routes → User state: hydrates
src/App.tsx - Pokémon page → Searchable catalog: renders
src/pages/PokemonsPage.tsx - Pokémon page → Selected Pokémon detail: renders
src/pages/PokemonsPage.tsx - Pokémon page → Add to collection: renders
src/pages/PokemonsPage.tsx - Pokémon page → Onboarding: renders
src/pages/PokemonsPage.tsx - Collection page → Collection cards: renders
src/pages/CollectionPage.tsx - Settings page → Settings form: renders
- Searchable catalog → Catalog state: reads and selects
src/components/PokemonList.tsx - Searchable catalog → Collection state: filters by
src/components/PokemonList.tsx - Selected Pokémon detail → Detail views: shows
- Selected Pokémon detail → Fetch detail: requests detail
- Add to collection → Collection state: dispatches add
src/components/Fab/AddToCollection.tsx - Add to collection → Remove dialog: opens
src/components/Fab/AddToCollection.tsx - Collection cards → Collection state: reads collection
src/components/PokemonCollectionCard.tsx - Collection cards → Remove dialog: opens
src/components/PokemonCollectionCard.tsx - Collection page → Collection state: reads collection
src/pages/CollectionPage.tsx - Settings page → User state: reads and updates
src/pages/SettingsPage.tsx - Settings page → Collection state: manages collection
src/pages/SettingsPage.tsx - Redux store → Catalog state: combines
src/redux/store-config.ts - Redux store → Collection state: combines
src/redux/store-config.ts - Redux store → User state: combines
src/redux/store-config.ts - Fetch catalog → Pokémon API: requests catalog
src/redux/saga-handlers/fetchPokemonsHandler.ts - Fetch catalog → Catalog state: dispatches results
src/redux/saga-handlers/fetchPokemonsHandler.ts - Fetch detail → Pokémon API: requests detail
src/redux/saga-handlers/fetchPokemonDetailHandler.ts - Fetch detail → Detail normalization: normalizes response
src/redux/saga-handlers/fetchPokemonDetailHandler.ts - Fetch detail → Catalog state: dispatches detail
src/redux/saga-handlers/fetchPokemonDetailHandler.ts - Detail normalization → Detail data model: builds model
src/lib/create-pokemon.ts - Collection sync → Collection state: observes changes
src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts - Collection sync → Collection storage: persists collection
src/redux/saga-handlers/syncCollectionToLocalStorageHandler.ts - User sync → User state: observes changes
src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts - User sync → User storage: persists name
src/redux/saga-handlers/syncUserNameToLocalStorageHandler.ts - Onboarding sync → User storage: persists skip
src/redux/saga-handlers/syncUserSkippedToLocalStorageHandler.ts - Catalog API model → Fetch catalog: types results
src/redux/saga-handlers/fetchPokemonsHandler.ts - Detail data model → Detail normalization: types detail
src/redux/saga-handlers/fetchPokemonDetailHandler.ts