# Completed A tracker for a video game collection: what you own, which platform it's on, your score for it, and whether (and when) you finished it. ## Status Each account has its own private collection. The API is usable; there's no GUI yet beyond two read-only clients (see below). ## Running it ```sh just docker-up # starts Postgres and the API on :8080 just docker-down # stops them ``` Or against a Postgres you already have running locally: ```sh export DATABASE_URL="postgres://postgres:password@localhost:5432/gamedb?sslmode=disable" just run-api ``` The API creates its database and runs migrations on startup if needed. Browse `http://localhost:8080/docs` for the generated API docs. ## Using the API ```sh # Register (also logs you in) curl -X POST localhost:8080/api/auth/register -H 'Content-Type: application/json' \ -d '{"email":"you@example.com","password":"a long password","name":"You"}' # -> {"token": "...", "user": {...}} TOKEN=... # the token from above curl -X POST localhost:8080/api/platforms -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' -d '{"name":"PC"}' curl localhost:8080/api/games -H "Authorization: Bearer $TOKEN" ``` A browser-based client can skip the `Authorization` header: register/login also set an httpOnly `session` cookie. ## Other clients - `just run-tui` — a read-only terminal viewer of `/games` (no login yet) - `just run-gui` — a read-only raylib desktop viewer of `/games` (no login yet; planned to move to Fyne) ## Development ```sh just test # go test ./... just sqlc # regenerate internal/db after changing db/query.sql or a migration ``` Schema changes go in `db/migrations` as a new `_.up.sql` / `.down.sql` pair; `sqlc.yaml` reads the schema from that directory directly, so there's no separate schema file to keep in sync.