diff --git a/README.md b/README.md index 363caca..acfe86e 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,41 @@ The API is split in two layers: (`/api/software*`, `/api/builds*`, `/api/image`, `/api/download`, `/file/*`) and the catalog ActiveAdmin resources. See its [README](libs/ruby/warp_engine/README.md). - **The host app** (`apps/api`) owns everything TTG-specific: members, events, - wiki proxy, RSS feeds, Devise/ActiveAdmin authentication, theming and assets. - It consumes WarpEngine as a path gem and mounts it at `/`. + the store registry, wiki proxy, RSS feeds, Devise/ActiveAdmin authentication, + theming and assets. It consumes WarpEngine as a path gem and mounts it at `/`. + +## The store registry + +`GET /api/stores` lists the stores a client can install from. The desktop +graphical client reads it on first run, which is why it is **public**: a client has +nobody to log in as. + +```json +[ + { + "name": "Teletype Games", + "catalogUrl": "https://teletypegames.org", + "storeRepositoryUrl": "https://git.teletypegames.org/stores/ttg-desktop-store" + } +] +``` + +A `Store` row is three fields — `name`, `catalog_url`, `store_repository_url` — +maintained from **ActiveAdmin ▸ 🛒 Stores**, and `db/seeds.rb` creates our own. +The client derives everything else: it reads `config.json` from the store +repository, points it at `catalog_url`, and falls back to the engine's defaults if +that repository has no config file. + +This lives in the host app **on purpose, not in WarpEngine**. The engine serves +one catalog and has no business knowing which stores exist for it; who ships a +store for a catalog is a property of the site. + +| | | +|---|---| +| Model | `apps/api/app/models/store.rb` | +| Endpoint | `apps/api/app/controllers/api/stores_controller.rb` | +| Admin | `apps/api/app/admin/stores.rb` | +| Client | [`warp-engine-desktop-gui`](https://git.teletypegames.org/stores/warp-engine-desktop-gui) | ## Development environment