How bariskisir/pokedex works
pokedex-electron is a desktop Pokédex whose main workflow is: a user opens the handheld, browses or filters Pokémon, selects an entry, and explores its profile and related information. The React renderer coordinates catalog and detail requests through a controller, which uses the PokéAPI client and local persistence; the device hook manages lid, audio, and native window sizing. The README also documents alternate forms and generation/region labels. Some components and the preload bridge were not sampled, so their internal wiring is shown only where documented or supported by the tree.
Main entry points: App.tsx App shell · PokemonProfile.tsx Pokémon profile · usePokedex.ts Pokédex controller · useDevice.ts Device state
Components 22
Desktop shell
- Electron window
src/electron/main.cts - Preload bridge
src/electron/preload.cts
Pokédex interface
- Renderer entry
src/renderer/main.tsx - App shell
src/renderer/components/App.tsx - Catalog
src/renderer/components/Catalog.tsx - Pokémon profile
src/renderer/components/PokemonProfile.tsx - Artwork display
src/renderer/components/Artwork.tsx - Stats and matchups
src/renderer/components/Stats.tsx - Type matchups
src/renderer/components/TypeMatchups.tsx - Evolution tree
src/renderer/components/EvolutionTree.tsx - Moves list
src/renderer/components/Moves.tsx
Data and domain
- Pokédex controller
src/renderer/hooks/usePokedex.ts - Search and transformations
src/renderer/domain/pokemon.ts - PokéAPI client
src/renderer/api/client.ts - Response schemas
src/renderer/api/schemas.ts - Local preferences and cache
src/renderer/services/storage.ts
Device experience
- Device state
src/renderer/hooks/useDevice.ts - Device controls
src/renderer/components/device/DeviceControls.tsx - Folding cover
src/renderer/components/device/DeviceCover.tsx - Synthesized audio
src/renderer/services/device-audio.ts
Other components
- Desktop user
- PokéAPI v2
Connections 28
- Desktop user → Electron window: launches
- Electron window → Renderer entry: loads renderer
- Renderer entry → App shell: mounts
- Desktop user → App shell: browses
- App shell → Pokédex controller: requests data
- App shell → Catalog: renders
- Catalog → Pokédex controller: filters and selects
- Pokédex controller → Search and transformations: filters and labels
- Pokédex controller → PokéAPI client: requests resources
- PokéAPI client → Response schemas: validates with
- PokéAPI client → PokéAPI v2: fetches resources
- PokéAPI client → Local preferences and cache: reads and caches
- Pokédex controller → Local preferences and cache: saves favorites
- App shell → Pokémon profile: shows selected entry
- Pokémon profile → Artwork display: renders artwork
- Pokémon profile → Stats and matchups: renders stats
- Pokémon profile → Type matchups: renders matchups
- Pokémon profile → Evolution tree: renders evolutions
- Pokémon profile → Moves list: renders moves
- App shell → Device state: coordinates state
- App shell → Device controls: renders controls
- App shell → Folding cover: renders cover
- Device controls → Pokédex controller: navigates and favorites
- Device controls → Device state: toggles device
- Device state → Synthesized audio: plays cues
- Device state → Local preferences and cache: persists mute setting
- Device state → Preload bridge: requests window sizing
- Preload bridge → Electron window: dispatches IPC