Add all Gen 1-9 games with colors to seed data

- Add 37 games from Gen 1-9 (Red/Blue through Scarlet/Violet)
- Add color field to Game model matching box art/branding
- Add migration for games.color column
- Update fetch_pokeapi.py to fetch all games and output colors
- Update seed loader to upsert game colors
- Update frontend Game type to include color field

Games without PokeAPI encounter data (ORAS, Let's Go, Sword/Shield,
BDSP, Legends Arceus, Scarlet/Violet) have location structure but
empty encounter tables.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-06 11:46:10 +01:00
parent 5406e5a386
commit f7f5417b6b
41 changed files with 130695 additions and 32 deletions

View File

@@ -10,13 +10,39 @@ parent: nuzlocke-tracker-f5ob
Routes are currently in alphabetical order from PokeAPI. Update the order field in each game's JSON seed file to reflect actual game progression (e.g., Pallet Town → Route 1 → Viridian City → Route 2 → ...).
## Details
- 646 routes total across 5 games
## Automated Approach: Bulbapedia Walkthrough Scraping
We already have all location/encounter data from PokeAPI. The missing piece is progression order, which can be extracted from Bulbapedia walkthroughs.
### Data Source
Every game has a Bulbapedia walkthrough with routes listed in progression order:
- https://bulbapedia.bulbagarden.net/wiki/Walkthrough:Pokémon_FireRed_and_LeafGreen
- https://bulbapedia.bulbagarden.net/wiki/Walkthrough:Pokémon_Emerald
- https://bulbapedia.bulbagarden.net/wiki/Walkthrough:Pokémon_HeartGold_and_SoulSilver
- (and so on for all games through Gen 8)
### Implementation Plan
1. **Scrape walkthrough TOCs** - Parse the section headings from each game's walkthrough page to get route order
2. **Normalize names** - Map Bulbapedia location names to PokeAPI location names (handle differences like "Route 1" vs "Kanto Route 1")
3. **Generate ordering** - Create a JSON mapping of `{game: {location_name: order_number}}`
4. **Update fetch_pokeapi.py** - Apply ordering when generating seed data
### Benefits
- Automatable for all games (Gen 1-8)
- Bulbapedia walkthroughs are community-maintained and accurate
- Scales as we add more games
- Only needs to run once per game (or when walkthroughs update)
### Considerations
- Gen 9 (Scarlet/Violet) is open-world so ordering is less meaningful
- Some games have branching paths - may need to pick a canonical order
- Name matching between Bulbapedia and PokeAPI may need fuzzy matching
## Current Scope
- FireRed and LeafGreen share the same route progression (Kanto)
- HeartGold and SoulSilver share the same route progression (Johto + Kanto)
- Emerald has its own progression (Hoenn)
- So effectively 3 unique orderings to define
- After updating JSON files, re-run the seed: `podman compose exec -e PYTHONUNBUFFERED=1 -w /app/src api python -m app.seeds`
- So effectively 3 unique orderings to define for current games
## Files
- `backend/src/app/seeds/data/firered.json`