Skip to main content

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.

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.

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 busqueda query parameter for name-based search and a tipo parameter 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 /equipo page; the Equipo model 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 the cache_pokemon table; all subsequent reads bypass the network entirely.
  • User registration and session-based authentication — the Usuario model handles account creation with Usuario.crear() and credential verification with Usuario.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 the templates/ directory, including a custom parse_tipos template filter for deserialising stored type lists.
  • Production-ready deployment via Gunicorn — the included Procfile defines web: gunicorn application:application, making the app deployable to any Gunicorn-compatible platform without additional configuration.

Tech Stack

LayerTechnology
Web frameworkFlask (Python 3)
DatabaseSQLite3 via Python’s built-in sqlite3 module
TemplatingJinja2 (bundled with Flask)
HTTP clientrequests (PokéAPI calls)
Password / security utilitiesWerkzeug
Production WSGI serverGunicorn
External data sourcePokéAPI (https://pokeapi.co/api/v2)

Project Structure

The codebase is split into focused modules, each with a clear responsibility:
PathResponsibility
application.pyFlask 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.

Build docs developers (and LLMs) love