Skip to content
Projects

handplant/craftcms-lazy-starter-kit

View on GitHub

About

A modern Craft CMS starter kit for agencies and developers — featuring Vite, Tailwind, Datastar, DDEV, MCP, LLM Ready.

Web & App Development

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

CraftCMS Lazy Starter Kit

CraftCMS Lazy is a Craft CMS 5 starter kit for building fast, maintainable, server-rendered websites with Vite, Tailwind CSS, Datastar, and DDEV.

It is designed for agencies, freelancers, and developers who believe Craft's entry model is the architecture: sections, entry types, fields, relations, and templates should be clear before a frontend framework enters the conversation.

The project gives you a practical Craft baseline with real examples for Matrix blocks, CKEditor content, Datastar-powered interactions, maps, search, SEO, and LLM-readable content.

Live Demo: craft-kit.dev


Stack

Craft CMS + Twig + Datastar + Vite + Tailwind CSS + DDEV

First-class Craft plugins when needed: Formie, Blitz, SeoMatic, and others. This starter includes SEOMate and keeps the architecture open for project-specific plugin choices.


Principles

Structure first

Structure is the architecture. In Craft, that structure is built from sections, entry types, fields, and relations. Get those decisions right and the project stays understandable. Get them wrong and no frontend framework will save the site.

Everything is an entry

A page is an entry. A blog post is an entry. A card, CTA, accordion item, navigation item, or reusable content block can also be an entry when that makes the system clearer. Some entries have URLs and sections. Some exist only as related content. They still share the same modeling, querying, and rendering approach.

CraftCMS Lazy leans into that model: atoms, molecules, organisms, and pages are represented through entries where it makes sense. Matrix blocks, block components, and entry type templates resolve through Craft's entry.render() pattern from templates/_partials/entry/, and relations are loaded with eagerly() so developers know where content lives and how it reaches the page.

One reactive UI model

Craft and Twig render the HTML. Datastar handles navigation dropdowns, mobile navigation, the search panel, filters, and server-driven updates through HTML attributes, signals, and server-sent events. There is no Alpine, Vue, or React layer for ordinary UI state. Embla, Leaflet, and GLightbox handle the specialist slider, map, and gallery behavior.

Hypermedia over client-side state

Craft owns authoritative data, validation, and permissions. Datastar signals hold transient browser state, and DOM morphing applies server-rendered HTML updates. This keeps dynamic interfaces close to Craft's content model instead of requiring a separate frontend application.

Local dev, no drama

DDEV and Vite provide a repeatable local environment with hot reload and predictable commands. You can start a project without writing Docker config from scratch.

LLM-readable content

The LLM Ready plugin can expose llms.txt and entry pages as clean Markdown by appending .md to URLs.

SEO, accessibility, and performance

The starter kit includes SEOMate configuration, server-rendered HTML, progressive enhancement, and a structure that keeps performance and accessibility concerns close to the templates.


What Is Included

  • A Craft CMS 5 project structure built around entries, relations, and render()
  • Datastar examples for server-rendered reactive UI
  • Tailwind CSS v4 and Vite asset workflow
  • DDEV local development setup
  • SEO and LLM-readable content
  • Demo content for pages, blog, search, maps, and UI blocks

Formie, Blitz, and other first-class Craft plugins can be added when a project needs forms, static caching, or more specialized production behavior.


Datastar Examples

The demo site uses Datastar for local UI interactions and server-rendered HTML updates over SSE. It does not require a separate frontend application. The Todo List is a JavaScript-dependent, session-backed demonstration.

The Bitcoin ticker in the header and GitHub statistics in the footer are additional Datastar examples using Feed Me for external API data.


Requirements

  • Docker
  • DDEV
  • Git

Composer, PHP, Node, and npm commands are run through DDEV.


Quick Start

Clone the repository and start the local environment:

git clone https://github.com/handplant/craftcms-lazy-starter-kit
cd craftcms-lazy-starter-kit
cp .env.example .env

ddev start
ddev composer install
ddev npm install

Import the included demo database:

ddev import-db --file=demo.sql

Open the site:

https://craftcms-lazy.ddev.site

Craft Control Panel:

https://craftcms-lazy.ddev.site/admin
User: admin
Password: superuser

If you want a clean Craft installation instead of the demo content, skip the database import and run:

ddev craft install

Development

Start the Vite dev server:

ddev npm run dev

Build production assets:

ddev npm run build

The production build writes optimized assets to web/dist/ and updates the Vite manifest used by Craft.

Run Craft migrations and apply project config when needed:

ddev craft migrate/all
ddev craft project-config/apply

Project Structure

templates/_components/       Presentational UI components, included with `with {} only`
templates/_partials/         Twig partials and entry rendering templates
templates/_partials/entry/   Matrix blocks, block components, and entry type templates
templates/_layouts/          Base layouts
templates/_globals/          Navigation, footer, fonts, favicons
templates/_datastar/         Datastar SSE endpoints and partials
templates/_entry/            Entry route templates
templates/_macros/           Twig macros
templates/_cp/               Control Panel templates
templates/_custom/           Demo pages without section or entry routes
templates/_errors/           Error pages
src/css/                     Tailwind CSS source
src/js/                      JavaScript source
config/                      Craft, Vite, Datastar, and plugin config
modules/craftkit/            Example Craft module

Layout and Blocks

Page layout uses one centered ui-container with a maximum content width of 1024px and responsive side padding. Matrix blocks keep full-width backgrounds and vertical spacing on the outer ui-block wrapper, with the container inside. The map demo intentionally remains full width.

Block types have readable classes such as ui-block-text, ui-block-cards, and ui-block-media. Each block retains classWrapper and classContent for styling the two layers.

Matrix and CKEditor use separate base partials. Embedded CKEditor blocks use ui-inline and not-prose, with their own spacing and no additional page container. The Builder demo combines both contexts on a normal page: blockBuilder places the CKEditor example inside Matrix. Internal card and gallery grids remain independent of the page layout. The ui-cards grid fills incomplete rows automatically; ui-cards-2 keeps the two-column variant.

Original illustrations are stored as Craft assets. The aiGenerated asset switch enables the shared badge in templates/_components/image.twig; real editor screenshots remain unmarked.

Shared layout, UI components, and Datastar result styles live in src/css/_components.css. Base styles, utilities, rich-text typography, Embla, and vendor overrides remain in separate CSS files.


Hypermedia-First Architecture

CraftCMS Lazy follows a server-rendered, hypermedia-first approach:

  • Craft and Twig render HTML.
  • Datastar adds reactivity with data-* attributes and SSE.
  • UI state is represented in the document and on the server.
  • Pages should continue to work without JavaScript where possible.
  • Vue, React, and JSON APIs are not required for normal UI state.

Common Datastar attributes used in the project include data-signals, data-on, data-bind, and data-class.


LLM-Ready Content

CraftCMS Lazy includes the LLM Ready Plugin. It can expose llms.txt for site-level context, and you can append .md to entry URLs to get Markdown versions of pages without writing additional templates.


Demo Assets

This repository includes /uploads so the demo works immediately after importing the demo database.

For production projects, move uploaded files to your normal asset storage workflow and add runtime uploads to .gitignore.


Open Source

CraftCMS Lazy is built by Andi Grether as an open source starter kit for building cleaner, faster, and more maintainable Craft CMS sites with a hypermedia-first approach.

Explore related projects

Loading…