Quick Start
Create a new project
Section titled “Create a new project”npx create-wolly my-sitecd my-siteThis scaffolds a new WollyCMS project with:
package.jsonwith@wollycms/serverdependency.envwith a generated JWT secret.gitignore,.env.example,docker-compose.ymldata/anduploads/directories
Install and run
Section titled “Install and run”npm installnpm run migratenpm run seednpm run devYour CMS is now running:
- API: http://localhost:4321
- Admin UI: http://localhost:4321/admin
Default login: admin@wollycms.local / admin123
Create your Astro frontend
Section titled “Create your Astro frontend”In a separate directory, create an Astro project:
npm create astro@latest my-frontendcd my-frontendnpm install @wollycms/astroConnect to WollyCMS
Section titled “Connect to WollyCMS”Create src/lib/wolly.ts:
import { createClient } from '@wollycms/astro';
export const wolly = createClient({ apiUrl: 'http://localhost:4321/api/content',});Create the block mapping
Section titled “Create the block mapping”Create src/lib/blocks.ts:
// Map CMS block type slugs to Astro componentsexport { default as hero } from '../blocks/Hero.astro';export { default as rich_text } from '../blocks/RichText.astro';export { default as image } from '../blocks/ImageBlock.astro';// Add more as you create block componentsCreate a catch-all route
Section titled “Create a catch-all route”Create src/pages/[...slug].astro:
---import Layout from '../layouts/Default.astro';import BlockRenderer from '@wollycms/astro/components/BlockRenderer.astro';import { wolly } from '../lib/wolly';import * as blocks from '../lib/blocks';
const slug = Astro.params.slug || 'home';const page = await wolly.pages.getBySlug(slug);---
<Layout title={page.title}> <BlockRenderer blocks={page.regions.hero ?? []} components={blocks} /> <BlockRenderer blocks={page.regions.content ?? []} components={blocks} /></Layout>Create your first block component
Section titled “Create your first block component”Create src/blocks/Hero.astro:
---const { fields } = Astro.props;---
<section> <h1>{fields.heading}</h1> {fields.description && <p>{fields.description}</p>}</section>Next steps
Section titled “Next steps”- Core Concepts — Learn about pages, blocks, and regions
- Astro Integration — Full setup guide for the
@wollycms/astropackage - Deployment — Deploy to Cloudflare Workers, Docker, or Node.js