Backend export endpoints return DB data in seed JSON format
(games, routes+encounters, pokemon, evolutions). Frontend
downloads the JSON via new Export buttons on each admin page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fetches routes for the selected game during run creation and hides
the Pinwheel Clause option when no routes have pinwheel zone data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add version group entry with region_id 0 (no PokeAPI region) and region
"lumiose". The Go fetch tool now skips route fetching for region_id 0 so
manually provided data won't be overwritten by re-runs. Includes
placeholder data file and box art.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use local /boxart/{slug}.png images instead of database boxArtUrl with
color-swatch fallback. Add region filter pills and run-status checkboxes
(hide active/completed) to GameGrid. Move the Next button into a sticky
top bar showing selected game summary so it's always visible. Capitalize
region names in all display locations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace inline typeColors maps in PokemonCard and StatusChangeModal
with a shared TypeBadge component that renders the type icon PNGs
from /types/{type}.png.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dupes Clause greys out Pokemon in the encounter modal whose evolution
family has already been caught, preventing duplicate selections. Shiny
Clause adds a dedicated Shiny Box and lets shiny catches bypass the
one-per-route lock via a new is_shiny column on encounters and a
/pokemon/families endpoint that computes evolution family groups.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements a dedicated /stats page showing cross-run aggregate statistics:
run overview with win rate, runs by game bar chart, encounter breakdowns,
top caught/encountered pokemon rankings, mortality analysis with death
causes, and type distribution. Backend endpoint uses aggregate SQL queries
to avoid N+1 fetching.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Creates 6 runs across FireRed, Platinum, Emerald, HeartGold, Black, and
Crystal with mixed statuses (failed/completed/active), diverse encounter
states (caught/fainted/missed/evolved/dead), and varied rule configs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allows each sub-zone within a route group to have its own independent
encounter when the Pinwheel Clause rule is enabled (default on), instead
of the entire group sharing a single encounter.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Regional evolutions (e.g., Pikachu → Alolan Raichu) only occur in specific
regions. This adds a nullable region column so the app can filter evolutions
by the game's region. When a regional evolution exists for a given trigger/item,
the non-regional counterpart is automatically hidden.
Full-stack: migration, model, schemas, API with region query param, seeder,
Go fetch tool, frontend types/API/hook/components, and admin form.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Go to .tool-versions, update .gitignore for Go build output and
cache, document seed data regeneration in README, and change API port
from 8000 to 8080 in docker-compose.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pokemon forms (e.g., Alolan Rattata) had their PokeAPI ID (10091) stored as
national_dex, causing them to display incorrectly. This renames the unique
identifier to pokeapi_id and adds a real national_dex field shared between
forms and their base species, so Alolan Rattata correctly shows as #19.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Moves ~850 lines of inline data from fetch_pokeapi.py into
version_groups.json and route_order.json for easier editing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pokemon forms with dex IDs >= 10000 (e.g., Alolan Rattata = 10091) were
being collected in encounter data but missing from pokemon.json, causing
them to be silently dropped during DB seeding. Now fetch_all_pokemon()
also fetches form entries that appear in encounter data, with clean
display names like "Rattata (Alola)" and correct form-specific types.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merges the run dashboard into the encounters page as a unified view at /runs/:runId,
adds encounter method grouping in the modal and badges on route rows, improves the
home page with recent runs, adds mobile hamburger nav, and polishes empty states.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Starters are now their own "Starter" route entry instead of being
merged into the location where you receive them (Pallet Town, New Bark
Town, Route 101). This makes them always appear first in the route
list for each game.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Define special encounter data (starters, gifts, fossils) in a new
special_encounters module and merge them into route seed JSON during
generation. Add new route locations to ROUTE_ORDER for cities that
previously had no wild encounters (Saffron City, Pewter City, etc.).
Show colored method badges in the EncounterModal UI for special
encounter types.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ROUTE_ORDER maps for Kanto (FRLG), Johto (HGSS), and Hoenn (Emerald)
progressions with aliases for related version groups. Add Export Order
button to admin game detail page for iterating on route orderings.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add End Run button to run dashboard with a confirmation modal offering
Victory/Defeat choice. Backend auto-sets completedAt timestamp and
validates only active runs can be ended. Ended runs show a completion
banner with date and duration, rename team to "Final Team", and hide
encounter logging and status change interactions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add sonner toast notifications to all mutations, evolution management backend
(CRUD endpoints with search/pagination) and frontend (form modal with pokemon
selector, paginated list page), sortable AdminTable columns (Region/Gen/Year
on Games), drag-and-drop route reordering via @dnd-kit, skeleton loading states,
card-styled table wrappers, and responsive mobile nav in AdminLayout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded Tailwind gradient classes with dynamic background
color from the game's color field. Falls back to indigo if no color
is set.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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>
- Update fetch_pokeapi.py to import all 1025 Pokemon species instead of
only those appearing in encounters
- Add paginated response for /pokemon endpoint with total count
- Add pagination controls to AdminPokemon page (First/Prev/Next/Last)
- Show current page and total count in admin UI
- Add bean for Pokemon forms support task
- Update UX improvements bean with route grouping polish item
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Locations like Mt. Moon (with 1F, B1F, B2F floors) are now grouped so
only one encounter can be logged per location group, enforcing Nuzlocke
first-encounter rules correctly.
- Add parent_route_id column with self-referential FK to routes table
- Add parent/children relationships on Route model
- Update games API to return hierarchical route structure
- Add validation in encounters API to prevent parent route encounters
and duplicate encounters within sibling routes (409 conflict)
- Update frontend with collapsible RouteGroup component
- Auto-derive route groups from PokeAPI location/location-area structure
- Regenerate seed data with 70 parent routes and 315 child routes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace all pokebase API calls with local JSON file reads from the
PokeAPI/api-data git submodule, removing the network dependency and
pokebase package. The script now runs with stdlib Python only.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add admin API endpoints for games, routes, pokemon, and route encounters
with full CRUD operations including bulk import. Build admin frontend
with game/route/pokemon management pages, navigation, and data tables.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement status change workflow (alive → dead) with confirmation modal,
death cause recording, and visual status indicators on pokemon cards.
Includes backend migration for death_cause field and graveyard view
on the run dashboard.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Run list at /runs shows all runs with status badges. Run dashboard at
/runs/:id displays stats, active team, graveyard, and rule badges.
Encounter tracking at /runs/:runId/encounters shows route list with
status indicators, progress bar, filters, and a modal for logging or
editing encounters with pokemon picker.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Build a 3-step wizard at /runs/new: select game (themed gradient cards
grouped by generation with filter tabs), configure rules (reuses existing
RulesConfiguration), and name/create run. Remove standalone Games and Rules
pages since they're now integrated into the wizard flow.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Install @tanstack/react-query, create a fetch-based API client with typed
functions for all endpoints, and add query/mutation hooks for games, pokemon,
runs, and encounters. Includes Vite dev proxy for /api and QueryClientProvider
setup.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement 13 endpoints: read-only reference data (games, routes, pokemon),
run CRUD with cascading deletes, and encounter management. Uses Pydantic v2
with camelCase alias generation to match frontend types, and nested response
schemas for detail views.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Seed the database with Pokemon game data for 5 games (FireRed, LeafGreen,
Emerald, HeartGold, SoulSilver) using pokebase. Includes Alembic migrations
for route unique constraints and encounter level ranges, a two-phase seed
system (offline fetch to JSON, then idempotent upserts), and Dockerfile
updates for the seed runner.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Define Game, Route, Pokemon, RouteEncounter, Encounter, and NuzlockeRun
types mirroring the backend schema, with EncounterStatus and RunStatus
discriminated union types.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>