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:
@@ -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
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
# nuzlocke-tracker-6aje
|
# nuzlocke-tracker-6aje
|
||||||
title: Update PokeAPI data submodule to latest version
|
title: Update PokeAPI data submodule to latest version
|
||||||
status: todo
|
status: completed
|
||||||
type: task
|
type: task
|
||||||
priority: high
|
priority: high
|
||||||
created_at: 2026-02-06T10:53:45Z
|
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.
|
The local PokeAPI data repository we use as a submodule is outdated. It's missing data for newer Pokemon forms and potentially newer games.
|
||||||
|
|||||||
11
.beans/nuzlocke-tracker-k60g--rewrite-fetch-pokeapi-in-go.md
Normal file
11
.beans/nuzlocke-tracker-k60g--rewrite-fetch-pokeapi-in-go.md
Normal 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
6
.gitignore
vendored
@@ -60,5 +60,11 @@ temp/
|
|||||||
*.tmp
|
*.tmp
|
||||||
*.temp
|
*.temp
|
||||||
|
|
||||||
|
# PokeAPI fetch cache
|
||||||
|
.pokeapi_cache/
|
||||||
|
|
||||||
|
# Go build output
|
||||||
|
tools/fetch-pokeapi/fetch-pokeapi
|
||||||
|
|
||||||
# Local config overrides
|
# Local config overrides
|
||||||
*.local
|
*.local
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
nodejs 24.13.0
|
nodejs 24.13.0
|
||||||
python 3.14.3
|
python 3.14.3
|
||||||
|
golang 1.25.7
|
||||||
|
|||||||
34
README.md
34
README.md
@@ -31,6 +31,8 @@ docker compose exec api alembic -c /app/alembic.ini upgrade head
|
|||||||
|
|
||||||
### Seed the Database
|
### 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
|
```bash
|
||||||
docker compose exec api python -m app.seeds
|
docker compose exec api python -m app.seeds
|
||||||
```
|
```
|
||||||
@@ -41,4 +43,34 @@ To seed and verify the data was loaded correctly:
|
|||||||
docker compose exec api python -m app.seeds --verify
|
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.
|
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/`.
|
||||||
@@ -4,7 +4,7 @@ services:
|
|||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8080:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend/src:/app/src:cached
|
- ./backend/src:/app/src:cached
|
||||||
- ./backend/alembic.ini:/app/alembic.ini:cached
|
- ./backend/alembic.ini:/app/alembic.ini:cached
|
||||||
@@ -27,7 +27,7 @@ services:
|
|||||||
- ./frontend/public:/app/public:cached
|
- ./frontend/public:/app/public:cached
|
||||||
- ./frontend/index.html:/app/index.html:cached
|
- ./frontend/index.html:/app/index.html:cached
|
||||||
environment:
|
environment:
|
||||||
- VITE_API_URL=http://localhost:8000
|
- VITE_API_URL=http://localhost:8080
|
||||||
depends_on:
|
depends_on:
|
||||||
- api
|
- api
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
Reference in New Issue
Block a user