Expand description
cratefield-module-cms: a small content store with an editor (Cratefield
control-plane issue #10).
use cratefield_module_cms::Cms;
let module = Cms::new().collections(["pages", "posts"]);A content store, not a page builder. A content item is a titled body
plus a JSON data object, addressed by (collection, slug). The editable
draft lives in cms_item; every publish appends an immutable snapshot to
cms_revision, so an item is versioned and the history of what was public
is recoverable. The look comes from the venture’s UI_SPEC (the
prompt-to-UiSpec work), not from here.
The venture keeps its content. Everything is in the venture’s own
database, edited through the harness admin session, so a customer’s content
never leaves their venture and the module inherits the /ui surface, the
admin gate, one-database-per-tenant and the audit trail for free. There is
no external credential to connect: selecting the CMS provisions its tables
and admin UI with the venture.
Public routes are reads. GET /v1/cms/{collection} and
GET /v1/cms/{collection}/{slug} serve published content; every write is
an admin action behind the ADMIN_TOKEN bearer. So the module has no
public write endpoint and needs no captcha.
§cratefield-module-cms
A small content store with an editor, as a Cratefield module. Content is a
titled body plus a JSON data object addressed by (collection, slug), kept
in the venture’s own database. Every publish appends an immutable revision, so
items are versioned and the history of what was public is recoverable.
Public routes are reads (GET /v1/cms/{collection} and
/v1/cms/{collection}/{slug} serve published content); every write is an admin
action behind the ADMIN_TOKEN bearer, so there is no public write endpoint.
The look comes from the venture’s UI_SPEC, not from here — this is a content
store, not a page builder.
use cratefield_module_cms::Cms;
let module = Cms::new().collections(["pages", "posts"]);MIT. Built in the open for Cratefield, a Factory Zero venture.
Structs§
- Cms
- A small content store with an editor.