game-systems-api

module
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: MIT

README

SweetRPG Game Systems API

CI License Issues PRs Dependabot

HTTP microservice that owns the platform-wide catalog of game systems (ruleset/edition, name, publisher reference, metadata). A Gin-based Go service, matching catalog-api's conventions, backed by its own MongoDB database.

catalog-api resolves a Volume's system references against this service rather than maintaining its own copy - see sweetrpg/platform's openspec/changes/game-systems-service for the full design.

Run locally

go run ./cmd/game-systems-api

Needs a MongoDB instance reachable per mongodb.go's DB_* environment variables (DB_URI, or DB_HOST/DB_SCHEME/DB_USER/DB_PW/DB_NAME/DB_PORT/DB_OPTS).

HTTP API

GET /systems lists live game systems, filtered/sorted/paged at the query layer:

Param Default Notes
q - Case-insensitive substring match on name
sort name One of name, -name, created, -created
page 1 1-based
per_page 24 Hard max 100; larger values are clamped, not rejected

Response:

{ "systems": [ /* flattened current views */ ], "total": 0, "page": 1, "per_page": 24 }

A non-integer page/per_page or an off-allowlist sort returns 400. With no params the endpoint returns the first page under the default sort and size.

Documentation

Package documentation: pkg.go.dev/github.com/sweetrpg/game-systems-api.

Contributing

See CONTRIBUTING.md for the development workflow.

Directories

Path Synopsis
cmd
backfill-audit-fields command
Command backfill-audit-fields populates the platform audit fields (PADR-0001) on game_systems_meta records that predate the convention: updated_at / updated_by (mirrored from created_at / created_by), leaving deleted_at / deleted_by null.
Command backfill-audit-fields populates the platform audit fields (PADR-0001) on game_systems_meta records that predate the convention: updated_at / updated_by (mirrored from created_at / created_by), leaving deleted_at / deleted_by null.
backfill-canonical-user-ids command
Command backfill-canonical-user-ids rewrites pre-adoption Auth0-subject values in the game_systems_meta and game_systems_versions audit fields (created_by, updated_by, submitted_by, reviewed_by) to the canonical users._id each subject maps to, using users-api's internal resolve-subjects batch endpoint.
Command backfill-canonical-user-ids rewrites pre-adoption Auth0-subject values in the game_systems_meta and game_systems_versions audit fields (created_by, updated_by, submitted_by, reviewed_by) to the canonical users._id each subject maps to, using users-api's internal resolve-subjects batch endpoint.
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL