This blog didn't start as a blog. It started as a bare Dotkernel Light installation — a minimal starter project built on Mezzio, with Twig for templating, FastRoute for routing, PSR-7 via Laminas Diactoros, and a PSR-11 container using Laminas Service Manager. No database, no posts, just the skeleton for a simple website.
Starting from Dotkernel Light
The setup itself is a single clone away:
git clone https://github.com/dotkernel/light.git dotkernel-light
At that point you have routing, templating and a working request lifecycle, but nothing to persist. Dotkernel Light is deliberately unopinionated about storage — it's up to the project to add a persistence layer if it needs one.
Adding Doctrine, following Tutorial 101
This project needed one: categories, authors, tags, and posts, all queryable and paginated. Rather than wiring Doctrine ORM in from scratch, the official Tutorial 101 was followed, which walks through exactly this on top of a fresh Dotkernel Light install:
- Installing Doctrine ORM and wiring it into the container.
- Defining entities and generating migrations to create the schema.
- Loading fixture data and building the repositories/queries needed to list and display it.
Following that path is what turned this project's Category, Author, Tag and Post entities, their migrations, and the repositories behind every listing and category page on this site into what they are now.
Where the data comes from
The actual content — every article, its author, its category and tags — is authored as data in src/App/src/Fixture/articles_cleaned.json and loaded into the database with php bin/doctrine-fixtures. That file wasn't written from scratch: it was built from what already existed in dotkernel.com's own database, cleaned up and reshaped into fixture data so it could be loaded into this project's schema. Doctrine takes care of turning that into rows; the entities and repositories added while following Tutorial 101 take care of turning those rows back into the pages you're browsing right now.
Frequently Asked Questions
What is Dotkernel Light? +
A minimal Mezzio-based starter project for building a simple website — routing (FastRoute), templating (Twig) and PSR-7 (Laminas Diactoros) out of the box, without a database layer.
Why was Doctrine added on top? +
Dotkernel Light doesn't include persistence by default. This blog needed categories, authors, tags and posts stored and queried from a database, so Doctrine ORM was added following the official Tutorial 101.
Where does the article content come from? +
From src/App/src/Fixture/articles_cleaned.json, loaded into the database via php bin/doctrine-fixtures.