Skip to main content

🪐 The Astro CMS example

examples/cms-astro is a multi-user, multi-site content management system that combines four ideas in one installable example:

  • an Astro SSR website using live content collections;
  • a FastAPI API backed by SQLite;
  • a Primer React administration interface with a rich editor composed from @datalayer/jupyter-lexical;
  • an authenticated, in-browser AI author on the published website;
  • Reactor extensions discovered from Python packages, including optional Pro and x402 packages.

Core owns both the Python host and the Astro application. There is no separate application package to coordinate: the built Astro server is copied into the Core wheel beside the browser half of its Reactor extension.

cms-astro/
├── core/
│ ├── cms_astro_core/ Python host, API, auth, database and seed command
│ ├── frontend/ Astro SSR application and Primer React admin
│ └── share/datalayer/ embedded Reactor frontend extension
├── ai-agents/ optional AI authoring extension and frontend
├── pro/ optional editorial extension
├── x402/ optional paid-content extension
└── tests/ API, authorization and x402 acceptance tests

What it demonstrates

ConcernImplementation
ContentDatabase-defined collections, drafts, publishing and revisions
TenancyMultiple sites with a role per user and site
RenderingAstro 6 live collections loaded at request time
AdministrationA client-side React application under /_cms/*, drawn with Primer
AuthoringCMS-owned Jupyter Lexical composition with a rich toolbar and plugins, structured JSON, and a plain-text projection
AppearancePortable Datalayer themes, visibly distinct Editorial/Studio layouts, color modes, and a live homepage preview
AuthenticationPBKDF2 password hashes and expiring bearer sessions
AI authoringChatFloating, an anonymous inference key with a visible timer, and CMS-scoped Reactor frontend tools
DiscoveryPython entry points under datalayer.reactor.extensions
Optional capabilitiesIndependently installable AI Agents, Pro and x402 wheels

The public website reads only published entries. Drafts and revisions remain behind the authenticated CMS API.

Read on

PageWhat it covers
Run and seed the exampleCommands, URLs and demo accounts
ArchitectureAstro, SQLite and the Python-packaged frontend
Users and authoringSite roles, API enforcement and Lexical storage
AI-assisted publishingBrowser agent, anonymous key, crawling and CMS frontend tools
AI Agents, Pro and x402 extensionsRuntime discovery, AI authoring and paid routes

The implementation README is also available at examples/cms-astro/README.md in the repository.