Update project config for Go tool and port change

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>
This commit is contained in:
2026-02-07 19:44:19 +01:00
parent f57d4793f9
commit 23a7b6ad53
7 changed files with 77 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
---
# nuzlocke-tracker-338l
title: Verify fetch_pokeapi.py rewrite
status: in-progress
type: task
created_at: 2026-02-07T15:08:10Z
updated_at: 2026-02-07T15:08:10Z
---
All code changes are complete. Run verification:
1. Run the script to completion
2. Verify output (pokemon.json has forms, correct IDs, etc.)
3. Verify cache speedup on second run
4. Frontend build check
## Checklist
- [ ] Run fetch_pokeapi.py to completion
- [ ] Verify pokemon.json has more entries with forms (megas, gmax, regionals)
- [ ] Verify pokeapi_id/national_dex split is correct
- [ ] Verify route/encounter JSON files
- [ ] Verify cache speedup on second run
- [ ] Frontend build passes

View File

@@ -1,11 +1,11 @@
---
# nuzlocke-tracker-6aje
title: Update PokeAPI data submodule to latest version
status: todo
status: completed
type: task
priority: high
created_at: 2026-02-06T10:53:45Z
updated_at: 2026-02-07T13:39:12Z
updated_at: 2026-02-07T14:35:41Z
---
The local PokeAPI data repository we use as a submodule is outdated. It's missing data for newer Pokemon forms and potentially newer games.

View File

@@ -0,0 +1,11 @@
---
# nuzlocke-tracker-k60g
title: Rewrite fetch_pokeapi in Go
status: completed
type: feature
priority: normal
created_at: 2026-02-07T15:38:58Z
updated_at: 2026-02-07T15:44:25Z
---
Rewrite the Python PokeAPI fetching tool in Go with custom HTTP client, disk caching, and zero external dependencies. Replace aiopoke dependency that crashes on newer PokeAPI fields.

6
.gitignore vendored
View File

@@ -60,5 +60,11 @@ temp/
*.tmp
*.temp
# PokeAPI fetch cache
.pokeapi_cache/
# Go build output
tools/fetch-pokeapi/fetch-pokeapi
# Local config overrides
*.local

View File

@@ -1,2 +1,3 @@
nodejs 24.13.0
python 3.14.3
golang 1.25.7

View File

@@ -31,6 +31,8 @@ docker compose exec api alembic -c /app/alembic.ini upgrade head
### Seed the Database
The seeder reads from pre-generated JSON files in `backend/src/app/seeds/data/` (committed to the repo) and loads them into PostgreSQL. No external API access is needed — everything runs from local files inside the container.
```bash
docker compose exec api python -m app.seeds
```
@@ -42,3 +44,33 @@ docker compose exec api python -m app.seeds --verify
```
This loads game data, Pokemon, routes, and encounter tables for FireRed, LeafGreen, Emerald, HeartGold, and SoulSilver.
### Regenerating Seed Data
The seed JSON files don't normally need regenerating. If you need to update them (e.g., to pull in new PokeAPI data), run the Go fetch tool against a local PokeAPI instance:
1. Start a local PokeAPI (e.g., using [pokeapi/pokeapi](https://github.com/PokeAPI/pokeapi)):
```bash
# In a separate directory
git clone https://github.com/PokeAPI/pokeapi.git && cd pokeapi
docker compose up
```
This serves the API at `http://localhost:8000/api/v2` by default.
2. Run the fetch tool (requires Go 1.22+):
```bash
cd tools/fetch-pokeapi && go run .
```
Set `POKEAPI_URL` if your instance is at a different address:
```bash
POKEAPI_URL=http://localhost:9000/api/v2 go run .
```
Use `--clear-cache` to discard cached API responses and re-fetch everything.
3. Review and commit the updated JSON files in `backend/src/app/seeds/data/`.

View File

@@ -4,7 +4,7 @@ services:
context: ./backend
dockerfile: Dockerfile
ports:
- "8000:8000"
- "8080:8000"
volumes:
- ./backend/src:/app/src:cached
- ./backend/alembic.ini:/app/alembic.ini:cached
@@ -27,7 +27,7 @@ services:
- ./frontend/public:/app/public:cached
- ./frontend/index.html:/app/index.html:cached
environment:
- VITE_API_URL=http://localhost:8000
- VITE_API_URL=http://localhost:8080
depends_on:
- api
restart: unless-stopped