Skip to content
J. Shipps

Croft

A small PHP CMS: describe a kind of content in one file, and Croft builds the admin around it.

Croft's home page: "Declare the content. The CMS builds the rest." above a screenshot of its admin

The problem

What I built

Why I built it

Every site I build for a client ends up needing the same things behind the scenes: a list of items, an editor, drafts, a publish date, image sizes, a way to undo a bad save. I kept rebuilding them, slightly differently each time.

Croft is that work turned into one small tool. You describe a kind of content (a recipe, a menu item, a case study) in a single PHP file, and Croft builds everything around it: the database table, the admin list, the editor, publishing, revision history and the public pages.

app/types/recipe.php
return [
    'label'    => 'Recipe',
    'features' => ['slug', 'status', 'schedule', 'seo', 'revisions'],
    'title'    => 'name',
    'public'   => ['index' => '/recipes', 'single' => '/recipes/{slug}', 'template' => 'recipe'],
    'fields'   => [
        ['name' => 'name',   'type' => 'text',     'panel' => 'title'],
        ['name' => 'method', 'type' => 'markdown', 'panel' => 'main', 'editor' => true],
        ['name' => 'serves', 'type' => 'number',   'panel' => 'sidebar'],
    ],
];

Save this file and reload: Croft adds a Recipes table, a list and an editor in the admin, and the pages /recipes and /recipes/{slug}. Add a field later and the column is added for you.

Croft's article editor: a markdown editor with a toolbar on the left, publishing options on the right
The editor: markdown with a toolbar, live preview and word count. Status, scheduling and the page address sit beside it.

What every content type gets

  • 01Drafts, publishing and future-dated scheduling
  • 02Revision history on every save, with restore, including deleted items
  • 03Per-item SEO title, description and social image
  • 04Automatic redirects when an address changes
  • 05Media library with automatic WebP sizes and a warning before deleting a file in use
  • 06Editable lists for navigation, FAQs, team or opening hours
  • 07Admin and editor roles, two-factor sign-in, login rate limiting
  • 08Cookieless visitor counts: no IP addresses, no third parties
Croft's landing page editor: eight page sections in a list, each with visibility, reorder and delete controls, and a History panel
Landing pages are built from sections you can reorder, hide or duplicate. History keeps the previous version on every save.

For developers

  • Plain PHP 8.1+ and SQLite. No framework, no Composer, no npm, no build step, no database server. Unzip it, point a domain at public/, and it runs, including on shared hosting.
  • Small enough to read. About 2,500 lines in fifteen classes, with thirteen guides.
  • Your templates, your CSS. Croft decides what data a template receives and nothing else.
  • One licence per developer, every site you build. Use it on as many client sites as you like and hand the source over with the finished site.

Croft is coming soon. Check in here.