How amauury/pokedex-bts works
Project type and purpose
• This is a full-stack web application (“Pokedex”) with a React front end and a Flask-based REST API back end, backed by an on-disk SQLite database.
• Purpose: allow users to browse, filter, search, sort, and view details (stats, evolutions, shiny mode, multilingual) of Pokémon.
File structure
• Top-level:
• api/ → Flask entrypoint (api.py) + SQLite DB (pokedex.db)
• pokedex/ → React app (package.json, config/, public/, scripts/, src/)
• React side uses webpack, Babel, TypeScript, Jest for testing
• Scripts in pokedex/scripts orchestrate build, start, test
• Flask side uses flask-cors to enable cross-origin calls from React
• SQLite DB file is colocated under api/ for simplicity
README insights
• Explains prerequisites (Node.js, Python, pip/npm/yarn), installation, startup commands, API port 5001, frontend port 3000
• Describes functional features, multilingual support, DB config
Main components & their relationships
a. Frontend (React SPA)
• Runs on Node.js DevServer (webpack dev server) at localhost:3000
• Fetches data via HTTP GET/POST calls to the Flask API
• Contains UI components for listing/filtering/sorting/searching Pokémon, detail pages, language switch
b. Backend API (Flask)
• Exposes REST endpoints (e.g., /pokemons, /pokemon/:id, /filter, /search) on http://localhost:5001
• Uses flask-cors for cross-domain requests
• Reads from SQLite database pokedex.db
• Performs queries, serializes results to JSON
c. Database (SQLite)
• Single file db storing Pokémon data, stats, evolution chains, types, languages
d. Optional external services
• None in this simple setup, but external CDN or translation API could be added later
Architectural patterns & design principles
• Frontend: Single-Page Application (SPA) pattern, component-based architecture
• Backend: RESTful API, MVC-style separation between request handlers and data persistence
• Clear separation of concerns: UI vs. business logic vs. data storage
• Dev vs. Prod configurations managed via webpack, env.js and getHttpsConfig.js
Technologies & frameworks
• Frontend: React, TypeScript, webpack, Babel, Jest, CSS modules
• Backend: Python 3.7+, Flask, flask-cors, SQLite
• Build tools: npm/yarn, pip