Getting Started with Flare CMS
Set up your headless CMS on Cloudflare Workers with D1, R2, and a built-in admin dashboard.
What is Flare CMS?
Flare CMS is an open-source headless content management system built to run entirely on Cloudflare Workers. It uses D1 for database storage, R2 for media files, and KV for caching — no origin server required.
Forked from Flare CMS and rebuilt as a pnpm monorepo, Flare CMS gives you a complete CMS backend with a built-in admin UI, RESTful API, and Astro frontend — all deployed to the edge.
Prerequisites
- Node.js 20+
- pnpm (not npm or yarn)
- A Cloudflare account (free tier works)
- Wrangler CLI installed globally or via npx
Quick Setup
Clone the repository and install dependencies:
git clone https://github.com/jjaimealeman/flarecms
cd flarecms
pnpm install
Build the core package (required before the CMS or site can run):
pnpm build
This produces packages/core/dist/ with 8 entry points: index, services, middleware, routes, templates, plugins, utils, and types.
Start the CMS Locally
cd packages/cms
wrangler dev
Your CMS is now running at http://localhost:8787. Visit /admin for the dashboard and /docs for the Scalar API documentation.
Project Structure
Flare CMS is organized as a pnpm monorepo with three packages:
- packages/core — The engine. Collections, API routes, admin UI templates, database schema, and migrations. Built with tsup.
- packages/cms — The Cloudflare Worker backend. Your collection configs, custom middleware, and wrangler.toml bindings live here.
- packages/site — The Astro 5 frontend. SSR on Cloudflare Pages, consuming the CMS API.
Defining Your First Collection
Collections are defined as plain TypeScript objects with satisfies CollectionConfig:
import type { CollectionConfig } from '@flare-cms/core'
export default {
name: 'blog-posts',
displayName: 'Blog Posts',
schema: {
type: 'object',
properties: {
title: { type: 'string', title: 'Title', required: true },
slug: { type: 'slug', title: 'URL Slug' },
content: { type: 'quill', title: 'Content' },
featuredImage: { type: 'media', title: 'Image' },
},
required: ['title', 'slug', 'content']
},
listFields: ['title', 'status'],
defaultSort: 'createdAt',
defaultSortOrder: 'desc'
} satisfies CollectionConfig
What's Next
Once your CMS is running, you can:
- Create content through the admin dashboard at
/admin - Fetch content via the REST API at
/api/collections/{name}/content - Deploy to production with
wrangler deploy --env production - Connect an Astro frontend to render your content at the edge