How ramzygirgis/pokedex works
The Pokedex CLI accepts commands through a REPL, then lists and explores locations, attempts Pokémon catches, and lets users inspect or list caught Pokémon. The command handlers coordinate API requests, cached location and encounter data, and the in-memory Pokedex; the API client fetches and decodes PokeAPI responses. The README is only a title, so capability details come from the sampled source. The graph reflects those files and does not assume additional behavior.
Main entry points: repl.go REPL · commands.go Map commands · client.go HTTP client · location_list.go Location fetch
Components 20
CLI workflow
- Startup
main.go - REPL
repl.go - Map commands
commands.go - Explore command
commands.go - Catch command
commands.go - Inspect command
commands.go - Pokedex command
commands.go
PokeAPI access
- HTTP client
internal/pokeapi/client.go - Location fetch
internal/pokeapi/location_list.go - Location listing
internal/pokeapi/location_list.go - Encounter fetch
internal/pokeapi/explore_location.go - Encounter listing
internal/pokeapi/explore_location.go - Pokémon fetch
internal/pokeapi/get_pokemon.go - Catch probability
internal/pokeapi/get_pokemon.go - Pokémon display
internal/pokeapi/get_pokemon.go
Local state
- Location cache
internal/pokecache/type_cache.go - Encounter cache
internal/pokecache/type_cache.go - Caught Pokémon
repl.go
Other components
- User
- PokeAPI
Connections 23
- Startup → REPL: starts
- User → REPL: enters commands
- REPL → Map commands: dispatches map
- REPL → Explore command: dispatches explore
- REPL → Catch command: dispatches catch
- REPL → Inspect command: dispatches inspect
- REPL → Pokedex command: dispatches list
- Map commands → Location cache: reads and writes
- Map commands → Location fetch: fetches on miss
- Map commands → Location listing: lists results
- Explore command → Encounter cache: reads and writes
- Explore command → Encounter fetch: fetches on miss
- Explore command → Encounter listing: prints encounters
- Catch command → Pokémon fetch: fetches Pokémon
- Catch command → Catch probability: calculates odds
- Catch command → Caught Pokémon: stores caught
- Inspect command → Caught Pokémon: reads caught
- Inspect command → Pokémon display: prints details
- Pokedex command → Caught Pokémon: lists caught
- Location fetch → HTTP client: uses HTTP
- Encounter fetch → HTTP client: uses HTTP
- Pokémon fetch → HTTP client: uses HTTP
- HTTP client → PokeAPI: sends requests