Pokédex Web App is a full-stack Python web application built with Flask that brings the entire Pokémon universe to your browser. Powered by the public PokéAPI, it fetches and locally caches all 1025 Pokémon into a SQLite database, giving users a fast, offline-capable Pokédex experience. The project is designed around object-oriented programming (OOP) principles — every major concept (Pokémon, user, team, Pokédex) is modelled as a Python class — making it an ideal study project for developers learning Python web development with Flask, Jinja2 templating, and SQLite data persistence.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.
Quickstart
Get the app running locally in under 5 minutes. Clone, install, and launch.
Browsing Pokémon
Search by name, filter by type, and explore detailed Pokémon stat pages.
Team Builder
Build your personal 6-member Pokémon team from any Pokémon detail page.
Project Structure
Understand how the Flask app, models, services, and templates fit together.
Key Features
- Full Pokédex browser with search-by-name and filter-by-type — the index page supports a
busquedaquery parameter for name-based search and atipoparameter to filter the entire list by Pokémon type. - Detailed Pokémon view showing stats, types, height, and weight — every Pokémon detail page renders base stats (HP, Attack, Defense, etc.), one or two types, height, and weight sourced from PokéAPI and cached in SQLite.
- Personal team builder (up to 6 Pokémon per user) — authenticated users can add Pokémon to their team from any detail page and remove them from the
/equipopage; theEquipomodel enforces the 6-member cap. - User-specific Pokédex tracking every Pokémon viewed — each time a logged-in user visits a Pokémon detail page,
PokedexUsuario.registrar_visto()records that Pokémon with a timestamp, building a personal “seen” history accessible at/mi-pokedex. - Local SQLite cache of all 1025 Pokémon fetched from PokéAPI — on first run,
PokeAPI.obtener_lista_pokemones(limite=1025)downloads every Pokémon and stores them in thecache_pokemontable; all subsequent reads bypass the network entirely. - User registration and session-based authentication — the
Usuariomodel handles account creation withUsuario.crear()and credential verification withUsuario.login(); Flask sessions store the authenticated user’s ID and username. - Server-side rendered Jinja2 templates with Flask — all pages are rendered with
render_template()using Jinja2 HTML templates located in thetemplates/directory, including a customparse_tipostemplate filter for deserialising stored type lists. - Production-ready deployment via Gunicorn — the included
Procfiledefinesweb: gunicorn application:application, making the app deployable to any Gunicorn-compatible platform without additional configuration.
Tech Stack
| Layer | Technology |
|---|---|
| Web framework | Flask (Python 3) |
| Database | SQLite3 via Python’s built-in sqlite3 module |
| Templating | Jinja2 (bundled with Flask) |
| HTTP client | requests (PokéAPI calls) |
| Password / security utilities | Werkzeug |
| Production WSGI server | Gunicorn |
| External data source | PokéAPI (https://pokeapi.co/api/v2) |
Project Structure
The codebase is split into focused modules, each with a clear responsibility:| Path | Responsibility |
|---|---|
application.py | Flask application factory, secret_key configuration, all route handlers (/, /pokemon/<nombre>, /equipo, /registro, /login, /logout, /mi-pokedex), and the parse_tipos Jinja2 template filter. |
models/ | OOP data layer. Contains Pokemon, Pokedex, PokedexUsuario, Equipo, Usuario, and database.py. database.py defines init_db() (schema creation) and get_connection() (SQLite connection factory). |
services/ | PokéAPI client. poke_api.py contains the PokeAPI class, which handles fetching all Pokémon, fetching a single Pokémon by name or ID, filtering by type, and managing the local SQLite cache. |
templates/ | Jinja2 HTML templates for every page: index.html, detalle.html, equipo.html, mi-pokedex.html, registro.html, and login.html. |
static/ | CSS stylesheets and image assets served directly by Flask. |