The Pokédex index page (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Navi-27/Proyecto-UPC/llms.txt
Use this file to discover all available pages before exploring further.
GET /) is the main entry point of the application, presenting all 1025 Pokémon as a responsive card grid. Each card shows the Pokémon’s sprite, National Dex number, name, and type badges. From here you can search for any Pokémon by name or instantly narrow the grid to a single type — no page reload needed beyond submitting the filter form.
Query Parameters
The index route accepts two optional query parameters that control which Pokémon are displayed.| Parameter | Description | Example value |
|---|---|---|
busqueda | Case-insensitive substring match against Pokémon names | char |
tipo | Exact type slug to filter by | fire |
Name Search — ?busqueda=<name>
Passing busqueda calls Pokedex.buscar_por_nombre(), which iterates over every cached Pokémon and returns those whose nombre contains the query string (lowercased for comparison). The match is a substring check, so short queries return broad results.
char.
Type Filter — ?tipo=<type>
Passing tipo calls PokeAPI.obtener_por_tipo(), which queries the SQLite cache_pokemon table directly with a LIKE clause against the JSON-encoded tipos column. The result set contains only Pokémon that have the requested type (primary or secondary).
Supported Pokémon Types
All 18 standard Pokémon types are available as filter buttons in the UI and as validtipo values in the URL:
| Type | Type | Type |
|---|---|---|
| normal | fire | water |
| electric | grass | ice |
| fighting | poison | ground |
| flying | psychic | bug |
| rock | ghost | dragon |
| dark | steel | fairy |
Caching Logic
On the very first request to/, the application checks whether the cache_pokemon table is populated by calling PokeAPI.validacion(). This method runs SELECT COUNT(*) FROM cache_pokemon — if the count is zero, the cache is empty and the app must fetch data from PokéAPI.
validacion() returns False), PokeAPI.obtener_lista_pokemones(limite=1025) is called. It fetches the full list of 1025 Pokémon from https://pokeapi.co/api/v2/pokemon?limit=1025, then fetches each individual Pokémon’s data, constructs a Pokemon object, and persists everything to cache_pokemon via INSERT OR IGNORE.
On every subsequent request, PokeAPI.validacion() returns True and PokeAPI.cargar_desde_db() reads all rows from cache_pokemon into memory — no outbound HTTP calls are made:
Searching and type filtering are mutually exclusive. If both
busqueda and tipo are present in the URL, the name search takes priority — the tipo parameter is ignored entirely. Only one filter is applied per request.