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:
34
README.md
34
README.md
@@ -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
|
||||
```
|
||||
@@ -41,4 +43,34 @@ To seed and verify the data was loaded correctly:
|
||||
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/`.
|
||||
Reference in New Issue
Block a user