Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
426 changes: 145 additions & 281 deletions README.md

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions docs/brainstorms/2026-09-14-github-readme-brainstorm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
date: 2026-09-14
topic: github-readme
---

# A GitHub landing page for demgem

## What we are building

The README becomes a landing page of about 150 lines. The 35 KB of content it holds today, a slice-by-slice log and the operator manual, moves into `docs/guide/`, one page per topic, with the text kept as it is apart from a title and a short lead. Nothing is deleted.

## Why

A visitor to the GitHub page today reads twenty-eight paragraphs that each begin "Slice N is done" before they reach the setup. There is no image, no badge, and no summary of what the app does. The README is a changelog, and the project needs a front door.

## The README, in order

1. A centered header: an SVG wordmark in `docs/readme/`, the one-sentence pitch, and a badge row. The badges are the CI status from `.github/workflows/ci.yml`, the license, PHP 8.4, Laravel 13, Livewire 4, and "Self-host with Docker". All come from shields.io. No external account is needed.
2. A hero screenshot of the run screen with the initiative tracker, full width.
3. "What it does", a two-column HTML table of about twelve cells. Each cell has a small icon, a bold title, and two lines: sessions, the live table, the player screen, maps, handouts and clocks, the compendium and fights, the 5e sheet, the world calendar, quests and arcs, the export to an Obsidian vault, the API, and Discord with scheduling.
4. Three screenshots in a row: the dashboard, the world calendar, and `/table`. The calendar took the map's place because the demo map is a dark placeholder image, and the month grid with two moons reads better at a third of the width.
5. "Run it in three commands", the Docker block, and a one-line pointer to the local setup page.
6. "Documentation", a table of links into `docs/guide/`.
7. "Built with", "Contributing" in three lines with a link to the rules page, "Content licensing" as one paragraph with the SRD notice, and "License".

Content licensing stays in the README because `database/srd/ATTRIBUTION.md` asks for the notice to be visible.

## The guide pages

| File | Holds |
| --- | --- |
| `docs/guide/changelog.md` | The slice log, slices 1 to 28, unchanged. |
| `docs/guide/local-setup.md` | Requirements, the install block, the queue and Reverb note, the demo seeder. |
| `docs/guide/docker.md` | The compose stack, the service table, and the operator notes. |
| `docs/guide/live-table.md` | The three services, the Reverb address table, proxies, and the queue note. |
| `docs/guide/reminders-and-discord.md` | Reminder emails, the mailer, the scheduler, the Discord webhook, the calendar feed. |
| `docs/guide/export-and-import.md` | The archive, the JSON, the importer, and what stays behind. |
| `docs/guide/templates-and-history.md` | Entity templates and body history. |
| `docs/guide/api.md` | The key, the endpoint tables, and the API rules. |
| `docs/guide/contributing.md` | The rules for contributors, the commands table, the environment table, and timezones. |

## Screenshots

Four PNG files under `docs/readme/`, captured at 1440 px wide at 2x from a local run of the demo world, signed in as the demo GM, and compressed with pngquant: the run screen with the tracker, the campaign dashboard, the world calendar, and `/table`. The demo seeder already builds the fight, the maps, and the pins, so no manual setup is needed.

## Out of scope

No code changes. No new dependencies. No committed test. A shell loop checks that every relative link in the README and the guide pages resolves to a file before the commit.
40 changes: 40 additions & 0 deletions docs/guide/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# The API

Every screen's data in JSON, behind the same policies as every page.

Every screen's data, in JSON, for a script or an assistant. Get a key from your profile: it reads what you can read in every campaign you belong to, and writes what you can write if you ticked **Can write** when you made it. Send it as a bearer token.

```sh
curl -H "Authorization: Bearer $DEMGEM_KEY" https://demgem.example/api/v1/me
```

| Method and path | What it does |
|---|---|
| `GET /api/v1/me` | You, and the campaigns you belong to with your role in each. |
| `GET /api/v1/campaigns` | The same campaigns, with each calendar's current date. |
| `GET /api/v1/campaigns/{id}` | One campaign. |
| `GET /api/v1/campaigns/{id}/entities` | Every entity you may see. Filter with `type=locations`, `tag=harbor`, or `q=bell`. Fifty a page. |
| `GET /api/v1/campaigns/{id}/entities/{entityId}` | One entity with its parent, children, and relationships, each through its own visibility gate. |
| `GET /api/v1/campaigns/{id}/search?q=` | Full-text search over what you may see. |
| `GET /api/v1/campaigns/{id}/sessions` | Every session you may see. A player gets the schedule and the published recap; a GM gets the prep too. |
| `GET /api/v1/campaigns/{id}/sessions/{number}` | One session, with scenes, secrets, and prepped entities for GM roles. |
| `POST /api/v1/campaigns/{id}/entities` | Create an entity. GM roles, write key. |
| `PATCH /api/v1/campaigns/{id}/entities/{entityId}` | Change one. GM roles on anything; a player on their own PC's body and record. |
| `PATCH /api/v1/campaigns/{id}/sessions/{number}` | Change a session's title, status, and notes. GM roles, write key. |
| `POST /api/v1/campaigns/{id}/sessions/{number}/publish-recap` | Publish the recap, and save a new one on the way if you send `recap`. |

Templates and history use the same campaign prefix, `/api/v1/campaigns/{id}`:

| Method and path | What it does |
|---|---|
| `GET /entity-templates` | GM-only summaries, 50 per page. Optional `type=character` filter uses the singular entity type. |
| `GET /entity-templates/{templateId}` | GM-only template with its body. |
| `POST /entity-templates` | Create with `name`, singular `type`, and optional `body`. GM role, write key. |
| `PATCH /entity-templates/{templateId}` | Change the template's name, type, or body. GM role, write key. |
| `GET /entities/{entityId}/body-revisions` | GM-only summaries, 25 per page, newest first. |
| `GET /entities/{entityId}/body-revisions/{revisionId}` | One previous body with `recorded_at` and `replaced_by_name`. GM-only. |
| `POST /entities/{entityId}/body-revisions/{revisionId}/restore` | Restore the body and return the updated entity. No payload. GM role, write key. |

`POST /entities` also accepts `template_id` for a matching entity type. Omit `body` to use the template's text; an explicitly supplied body, including null, takes precedence. A template is resolved within the campaign even when the body is overridden. `PATCH /entities/{entityId}` cannot apply a template. Markdown body whitespace is preserved.

The API creates and changes; it never deletes. A field your key may not set comes back as a 422 that names it, not a silent drop. Sixty requests a minute per key. A campaign you are not a member of is a 404, the same as on the web.
Loading
Loading