Skip to content

Repository files navigation

SweetRPG Admin API

CI License Issues PRs Dependabot

HTTP microservice for the SweetRPG platform's cross-cutting admin concerns. The first capability is banner messages: platform-, service-, or page-scoped notices with a severity and a required expiration, served to any frontend that wants to render them. A thin Gin-based layer: server/*.go wires routes directly to MongoDB via mongodb.go's generic CRUD functions.

API

  • POST /banners - create a banner message.
  • GET /banners?scope=platform&scope=service:catalog&scope=page:/catalog/browse - list active banners matching any of the given scopes, most-severe-first. Platform-scoped banners are always included regardless of the requested scopes.
  • PUT /banners/{id} - update a banner message.
  • DELETE /banners/{id} - delete a banner message.

expires_at is required on create; a banner without one is rejected. Expired documents are also physically removed by a MongoDB TTL index on expires_at.

Run locally

scripts/run-docker-local.sh

Brings up the service plus its MongoDB dependency via docker/docker-compose.yml. Swagger UI is served at /swagger/index.html once running.

Documentation

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

Swagger UI (swaggo/swag + gin-swagger, generated from handler annotations, not hand-written): /swagger/index.html against whatever host you're running against.

Contributing

See CONTRIBUTING.md for the development workflow.

About

API microservice for platform-wide admin concerns

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages